@@ -51,6 +51,7 @@ import { SlackIcon } from "~/assets/icons/SlackIcon";
5151import { VercelLogo } from "~/components/integrations/VercelLogo" ;
5252import { Avatar } from "~/components/primitives/Avatar" ;
5353import { UserProfilePhoto } from "~/components/UserProfilePhoto" ;
54+ import { useCopyPublicUrl } from "~/hooks/useCopyPublicUrl" ;
5455import { type MatchedEnvironment } from "~/hooks/useEnvironment" ;
5556import { usePageSwitcher } from "~/hooks/useEnvironmentSwitcher" ;
5657import { useFeatureFlags } from "~/hooks/useFeatureFlags" ;
@@ -1622,7 +1623,11 @@ function OrgSelector({
16221623 { isCollapsed && (
16231624 < div className = "border-t border-grid-bright p-1" >
16241625 < SideMenuPopoverSubMenu title = "Account" icon = { < UserProfilePhoto className = "size-5" /> } >
1625- < AccountMenuItems isAdmin = { isAdmin } isImpersonating = { isImpersonating } />
1626+ < AccountMenuItems
1627+ isAdmin = { isAdmin }
1628+ isImpersonating = { isImpersonating }
1629+ onClose = { ( ) => setOrgMenuOpen ( false ) }
1630+ />
16261631 </ SideMenuPopoverSubMenu >
16271632 </ div >
16281633 ) }
@@ -1638,11 +1643,14 @@ function OrgSelector({
16381643function AccountMenuItems ( {
16391644 isAdmin,
16401645 isImpersonating,
1646+ onClose,
16411647} : {
16421648 isAdmin : boolean ;
16431649 isImpersonating : boolean ;
1650+ onClose : ( ) => void ;
16441651} ) {
16451652 const submit = useSubmit ( ) ;
1653+ const copyPublicUrl = useCopyPublicUrl ( ) ;
16461654 const stopImpersonating = ( ) =>
16471655 submit ( null , { action : "/resources/impersonation" , method : "delete" } ) ;
16481656
@@ -1688,6 +1696,26 @@ function AccountMenuItems({
16881696 className = { SIDE_MENU_POPOVER_ITEM_LABEL }
16891697 />
16901698 ) }
1699+ { copyPublicUrl . enabled && (
1700+ < PopoverMenuItem
1701+ title = {
1702+ < div className = "flex w-full items-center justify-between" >
1703+ < span > Copy public URL</ span >
1704+ < ShortcutKey
1705+ shortcut = { { modifiers : [ "mod" , "alt" ] , key : "l" } }
1706+ variant = "medium/bright"
1707+ />
1708+ </ div >
1709+ }
1710+ icon = { ChainLinkIcon }
1711+ onClick = { ( ) => {
1712+ copyPublicUrl . copy ( ) ;
1713+ onClose ( ) ;
1714+ } }
1715+ leadingIconClassName = { SIDE_MENU_POPOVER_ITEM_ICON }
1716+ className = { SIDE_MENU_POPOVER_ITEM_LABEL }
1717+ />
1718+ ) }
16911719 </ div >
16921720 ) }
16931721 < div className = "flex flex-col gap-1 p-1" >
@@ -1785,7 +1813,11 @@ function AccountMenu({ isAdmin, isImpersonating }: { isAdmin: boolean; isImperso
17851813 style = { { maxHeight : `calc(var(--radix-popover-content-available-height) - 10vh)` } }
17861814 >
17871815 < PopoverSectionHeader title = "Account" />
1788- < AccountMenuItems isAdmin = { isAdmin } isImpersonating = { isImpersonating } />
1816+ < AccountMenuItems
1817+ isAdmin = { isAdmin }
1818+ isImpersonating = { isImpersonating }
1819+ onClose = { ( ) => setIsOpen ( false ) }
1820+ />
17891821 </ PopoverContent >
17901822 </ Popover >
17911823 ) ;
0 commit comments