Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab21652

Browse files
committed
chore: show iframe controls on preview slug only
1 parent556b095 commitab21652

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

‎site/src/pages/TaskPage/TaskAppIframe.tsx

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -58,42 +58,44 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
5858

5959
return(
6060
<divclassName={cn([active ?"flex" :"hidden","w-full h-full flex-col"])}>
61-
<divclassName="bg-surface-tertiary flex items-center p-2 py-1 gap-1">
62-
<Button
63-
size="icon"
64-
variant="subtle"
65-
onClick={(e)=>{
66-
e.preventDefault();
67-
if(frameRef.current?.contentWindow){
68-
frameRef.current.contentWindow.location.href=appHref();
69-
}
70-
}}
71-
>
72-
<HouseIcon/>
73-
<spanclassName="sr-only">Home</span>
74-
</Button>
61+
{app.slug==="preview"&&(
62+
<divclassName="bg-surface-tertiary flex items-center p-2 py-1 gap-1">
63+
<Button
64+
size="icon"
65+
variant="subtle"
66+
onClick={(e)=>{
67+
e.preventDefault();
68+
if(frameRef.current?.contentWindow){
69+
frameRef.current.contentWindow.location.href=appHref();
70+
}
71+
}}
72+
>
73+
<HouseIcon/>
74+
<spanclassName="sr-only">Home</span>
75+
</Button>
7576

76-
{/* Possibly we will put a URL bar here, but for now we cannot due to
77-
* cross-origin restrictions in iframes. */}
78-
<divclassName="w-full"></div>
77+
{/* Possibly we will put a URL bar here, but for now we cannot due to
78+
* cross-origin restrictions in iframes. */}
79+
<divclassName="w-full"></div>
7980

80-
<DropdownMenu>
81-
<DropdownMenuTriggerasChild>
82-
<Buttonsize="icon"variant="subtle"aria-label="More options">
83-
<EllipsisVerticalaria-hidden="true"/>
84-
<spanclassName="sr-only">More options</span>
85-
</Button>
86-
</DropdownMenuTrigger>
87-
<DropdownMenuContentalign="end">
88-
<DropdownMenuItemasChild>
89-
<RouterLinkto={frameSrc}target="_blank">
90-
<ExternalLinkIcon/>
91-
Open app in new tab
92-
</RouterLink>
93-
</DropdownMenuItem>
94-
</DropdownMenuContent>
95-
</DropdownMenu>
96-
</div>
81+
<DropdownMenu>
82+
<DropdownMenuTriggerasChild>
83+
<Buttonsize="icon"variant="subtle"aria-label="More options">
84+
<EllipsisVerticalaria-hidden="true"/>
85+
<spanclassName="sr-only">More options</span>
86+
</Button>
87+
</DropdownMenuTrigger>
88+
<DropdownMenuContentalign="end">
89+
<DropdownMenuItemasChild>
90+
<RouterLinkto={frameSrc}target="_blank">
91+
<ExternalLinkIcon/>
92+
Open app in new tab
93+
</RouterLink>
94+
</DropdownMenuItem>
95+
</DropdownMenuContent>
96+
</DropdownMenu>
97+
</div>
98+
)}
9799

98100
<iframe
99101
ref={frameRef}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp