From 0d1bd3e2984c9a98f80e6672e7ddde19e8d580ec Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 29 Aug 2025 12:36:12 +0300 Subject: [PATCH] feat(react/global_menu): add show/hide conditions --- .../src/widgets/buttons/global_menu.tsx | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/client/src/widgets/buttons/global_menu.tsx b/apps/client/src/widgets/buttons/global_menu.tsx index 09747d9f7..5b3cfe862 100644 --- a/apps/client/src/widgets/buttons/global_menu.tsx +++ b/apps/client/src/widgets/buttons/global_menu.tsx @@ -48,12 +48,8 @@ export default function GlobalMenu({ isHorizontalLayout }: { isHorizontalLayout: - - {isMobile() ? ( - - ) : ( - - )} + + @@ -63,9 +59,7 @@ export default function GlobalMenu({ isHorizontalLayout }: { isHorizontalLayout: {isUpdateAvailable && window.open("https://github.com/TriliumNext/Trilium/releases/latest")} icon="bx bx-sync" text={`Version ${latestVersion} is available, click to download.`} /> } - - - + {!isElectron() && } ) } @@ -82,12 +76,29 @@ function AdvancedMenu() { - + {isElectron() && } ) } +function BrowserOnlyOptions() { + return <> + + + ; +} + +function SwitchToOptions() { + if (isElectron()) { + return; + } else if (!isMobile()) { + return + } else { + return + } +} + function MenuItem({ icon, text, title, command, disabled, active, outsideChildren }: MenuItemProps void)>) { return