π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Anchor
Manav Rathi5adac095a61f
diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsxindex 30afccb4a3..dc70c52075 100644--- a/web/packages/gallery/components/viewer/FileViewer.tsx+++ b/web/packages/gallery/components/viewer/FileViewer.tsx@@ -32,7 +32,7 @@ import {ImageEditorOverlay,type ImageEditorOverlayProps,} from "@/new/photos/components/ImageEditorOverlay";-import { Button, styled } from "@mui/material";+import { Button, Menu, styled } from "@mui/material";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { fileInfoExifForFile } from "./data-source";import {@@ -200,6 +200,9 @@ const FileViewer: React.FC<FileViewerProps> = ({>(undefined);const [openFileInfo, setOpenFileInfo] = useState(false);+ const [moreMenuAnchorEl, setMoreMenuAnchorEl] = useState<+ HTMLElement | undefined+ >(undefined);const [openImageEditor, setOpenImageEditor] = useState(false);// If `true`, then we need to trigger a sync with remote when we close.@@ -245,7 +248,7 @@ const FileViewer: React.FC<FileViewerProps> = ({[],);- const handleInfoClose = useCallback(() => setOpenFileInfo(false), []);+ const handleFileInfoClose = useCallback(() => setOpenFileInfo(false), []);const handleScheduleUpdate = useCallback(() => setNeedsSync(true), []);@@ -271,11 +274,17 @@ const FileViewer: React.FC<FileViewerProps> = ({annotatedFile: FileViewerAnnotatedFile,buttonElement: HTMLElement,) => {- console.log({ annotatedFile, buttonElement });+ setActiveAnnotatedFile(annotatedFile);+ setMoreMenuAnchorEl(buttonElement);},[],);+ const handleMoreMenuClose = useCallback(+ () => setMoreMenuAnchorEl(undefined),+ [],+ );+const handleEditImage = useMemo(() => {return onSaveEditedImageCopy? (annotatedFile: FileViewerAnnotatedFile) => {@@ -368,6 +377,7 @@ const FileViewer: React.FC<FileViewerProps> = ({handleClose,handleAnnotate,handleViewInfo,+ handleMore,handleEditImage,]);@@ -382,7 +392,7 @@ const FileViewer: React.FC<FileViewerProps> = ({<Button>Test</Button><FileInfoopen={openFileInfo}- onClose={handleInfoClose}+ onClose={handleFileInfoClose}file={activeAnnotatedFile?.file}exif={activeFileExif}allowEdits={!!activeAnnotatedFile?.annotation.isOwnFile}@@ -394,6 +404,13 @@ const FileViewer: React.FC<FileViewerProps> = ({onSelectPerson={handleSelectPerson}{...{ fileCollectionIDs, allCollectionsNameByID }}/>+ <Menu+ open={!!moreMenuAnchorEl}+ onClose={handleMoreMenuClose}+ anchorEl={moreMenuAnchorEl}+ >+ Test+ </Menu><ImageEditorOverlayopen={openImageEditor}onClose={handleImageEditorClose}