Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix appearance in the info drawer

Manav Rathief38b639ebeb
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
index 5dcf1d1ac3..2e8ab400de 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
@@ -4,6 +4,7 @@ import { nameAndExtension } from "@/base/file";
import type { ParsedMetadata } from "@/media/file-metadata";
import { FileType } from "@/media/file-type";
import { UnidentifiedFaces } from "@/new/photos/components/PeopleList";
+import { photoSwipeZIndex } from "@/new/photos/components/PhotoViewer";
import { tagNumericValue, type RawExifTags } from "@/new/photos/services/exif";
import { isMLEnabled } from "@/new/photos/services/ml";
import { EnteFile } from "@/new/photos/types/file";
@@ -339,7 +340,7 @@ const parseExifInfo = (
const FileInfoSidebar = styled((props: DialogProps) => (
<EnteDrawer {...props} anchor="right" />
))({
- zIndex: 1501,
+ zIndex: photoSwipeZIndex + 1,
"& .MuiPaper-root": {
padding: 8,
},
diff --git a/web/packages/new/photos/components/PhotoDateTimePicker.tsx b/web/packages/new/photos/components/PhotoDateTimePicker.tsx
index 10173c5fd4..cab2a51ddd 100644
--- a/web/packages/new/photos/components/PhotoDateTimePicker.tsx
+++ b/web/packages/new/photos/components/PhotoDateTimePicker.tsx
@@ -1,4 +1,5 @@
import type { ParsedMetadataDate } from "@/media/file-metadata";
+import { photoSwipeZIndex } from "@/new/photos/components/PhotoViewer";
import {
LocalizationProvider,
MobileDateTimePicker,
@@ -99,10 +100,13 @@ export const PhotoDateTimePicker: React.FC<PhotoDateTimePickerProps> = ({
},
},
},
- }}
- DialogProps={{
- sx: {
- zIndex: "1502",
+ /* We also get opened from the info drawer in the photo
+ viewer, so give our dialog a higher z-index than both the
+ photo viewer and the info drawer */
+ dialog: {
+ sx: {
+ zIndex: photoSwipeZIndex + 2,
+ },
},
}}
/>
diff --git a/web/packages/new/photos/components/PhotoViewer.tsx b/web/packages/new/photos/components/PhotoViewer.tsx
new file mode 100644
index 0000000000..c320a73cf5
--- /dev/null
+++ b/web/packages/new/photos/components/PhotoViewer.tsx
@@ -0,0 +1,5 @@
+/**
+ * PhotoSwipe sets the zIndex of its "pswp" class to 1500. We need to go higher
+ * than that for our drawers and dialogs to show above it.
+ */
+export const photoSwipeZIndex = 1500;