From 3aa92b2e03e7831bc4feece29866463ee2c76ca8 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 24 Apr 2025 09:20:56 -0500 Subject: [PATCH] Hide app menu tooltips when admin menu is open --- src/app/ViewSwitcher.tsx | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/app/ViewSwitcher.tsx b/src/app/ViewSwitcher.tsx index 052c0225..7b0f6700 100644 --- a/src/app/ViewSwitcher.tsx +++ b/src/app/ViewSwitcher.tsx @@ -36,10 +36,12 @@ export default function ViewSwitcher({ icon={} href={PATH_FEED_INFERRED} active={currentSelection === 'feed'} - tooltip={{ - content: 'Feed', - keyCommand: 'F', - }} + tooltip={!isAdminMenuOpen + ? { + content: 'Feed', + keyCommand: 'F', + } + : undefined} noPadding />; @@ -48,10 +50,12 @@ export default function ViewSwitcher({ icon={} href={PATH_GRID_INFERRED} active={currentSelection === 'grid'} - tooltip={{ - content: 'Grid', - keyCommand: 'G', - }} + tooltip={!isAdminMenuOpen + ? { + content: 'Grid', + keyCommand: 'G', + } + : undefined} noPadding />; @@ -69,7 +73,9 @@ export default function ViewSwitcher({ icon={} isInteractive={false} noPadding - tooltip={{ content: 'Admin Menu' }} + tooltip={!isAdminMenuOpen + ? { content: 'Admin Menu' } + : undefined} />} {isUserSignedIn && } - tooltip={{ content: 'Admin Menu' }} + tooltip={!isAdminMenuOpen + ? { content: 'Admin Menu' } + : undefined} noPadding />} @@ -86,11 +94,13 @@ export default function ViewSwitcher({ title="Search" icon={} onClick={() => setIsCommandKOpen?.(true)} - tooltip={{ - content: 'Search', - keyCommand: 'K', - keyCommandModifier: '⌘', - }} + tooltip={!isAdminMenuOpen + ? { + content: 'Search', + keyCommand: 'K', + keyCommandModifier: '⌘', + } + : undefined} />