From ad89adeed1b85dcdf33b65110ef06b88af664787 Mon Sep 17 00:00:00 2001 From: nikec <43032218+niikeec@users.noreply.github.com> Date: Fri, 3 May 2024 14:18:56 +0200 Subject: [PATCH] [ENG-1772] Fix sidebar issues (#2452) fix sidebar issues --- .../app/$libraryId/Explorer/QuickPreview/index.tsx | 4 ++-- .../Layout/Sidebar/sections/Locations/ContextMenu.tsx | 10 +++++++++- .../Layout/Sidebar/sections/Tags/ContextMenu.tsx | 10 +++++++++- interface/app/$libraryId/settings/Sidebar.tsx | 11 ++++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/interface/app/$libraryId/Explorer/QuickPreview/index.tsx b/interface/app/$libraryId/Explorer/QuickPreview/index.tsx index e1288210d..67aa7119d 100644 --- a/interface/app/$libraryId/Explorer/QuickPreview/index.tsx +++ b/interface/app/$libraryId/Explorer/QuickPreview/index.tsx @@ -254,7 +254,7 @@ export const QuickPreview = () => { { /> e.preventDefault()} onEscapeKeyDown={(e) => isRenaming && e.preventDefault()} onContextMenu={(e) => e.preventDefault()} diff --git a/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx b/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx index 0c6557cdf..803fa6b8f 100644 --- a/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx @@ -9,6 +9,8 @@ import { openDirectoryPickerDialog } from '~/app/$libraryId/settings/library/loc import { useLocale } from '~/hooks'; import { usePlatform } from '~/util/Platform'; +import { useSidebarContext } from '../../SidebarLayout/Context'; + export const ContextMenu = ({ children, locationId @@ -17,10 +19,16 @@ export const ContextMenu = ({ const platform = usePlatform(); const libraryId = useLibraryContext().library.uuid; + const sidebar = useSidebarContext(); + const { t } = useLocale(); return ( - + sidebar.onLockedChange(open)} + className="z-[100]" + > { try { diff --git a/interface/app/$libraryId/Layout/Sidebar/sections/Tags/ContextMenu.tsx b/interface/app/$libraryId/Layout/Sidebar/sections/Tags/ContextMenu.tsx index 439d36bda..e9d9ea4a0 100644 --- a/interface/app/$libraryId/Layout/Sidebar/sections/Tags/ContextMenu.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/sections/Tags/ContextMenu.tsx @@ -7,13 +7,21 @@ import CreateDialog from '~/app/$libraryId/settings/library/tags/CreateDialog'; import DeleteDialog from '~/app/$libraryId/settings/library/tags/DeleteDialog'; import { useLocale } from '~/hooks'; +import { useSidebarContext } from '../../SidebarLayout/Context'; + export const ContextMenu = ({ children, tagId }: PropsWithChildren<{ tagId: number }>) => { const navigate = useNavigate(); + const sidebar = useSidebarContext(); + const { t } = useLocale(); return ( - + sidebar.onLockedChange(open)} + className="z-[100]" + > { - const { platform } = usePlatform(); const os = useOperatingSystem(); + const { platform } = usePlatform(); + const { sidebar } = useLayoutStore(); // const isPairingEnabled = useFeatureFlag('p2pPairing'); const isBackupsEnabled = useFeatureFlag('backups'); @@ -41,7 +43,10 @@ export default () => { {platform === 'tauri' ? (