Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(sandbox): render desktop templates in iframe to fix sideNav visibility (#1844)

Kenton Quatman9becf05a5371
diff --git a/apps/sandbox/src/app/(fullscreen)/PreviewShell.tsx b/apps/sandbox/src/app/(fullscreen)/PreviewShell.tsx
index 569868b907..03654e67c2 100644
--- a/apps/sandbox/src/app/(fullscreen)/PreviewShell.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/PreviewShell.tsx
@@ -910,7 +910,23 @@ export function PreviewShell({children}: {children: React.ReactNode}) {
{view === 'preview' ? (
isBlock ? (
children
- ) : viewport !== 'desktop' ? (
+ ) : viewport === 'desktop' ? (
+ <div
+ style={{
+ flex: 1,
+ overflow: 'hidden',
+ }}>
+ <iframe
+ src={`${basePath}${pathname}?embed=1`}
+ title={`${pageName} — ${viewport}`}
+ style={{
+ width: '100%',
+ height: '100%',
+ border: 'none',
+ }}
+ />
+ </div>
+ ) : (
<div
style={{
flex: 1,
@@ -933,14 +949,6 @@ export function PreviewShell({children}: {children: React.ReactNode}) {
}}
/>
</div>
- ) : (
- <div
- style={{
- flex: 1,
- overflow: 'auto',
- }}>
- {children}
- </div>
)
) : (
<div style={{flex: 1, overflow: 'auto'}}>