From 9dcced260fbcfdca0b4122a98ee9de9d58ec9011 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 14 Feb 2025 13:21:12 +0530 Subject: [PATCH] Same nomenclature --- .../PhotoViewer/ImageEditorOverlay.tsx | 16 +++++++++------- .../photos/src/components/PhotoViewer/index.tsx | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay.tsx index f4e3e40af8..e2805f6594 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay.tsx @@ -7,6 +7,7 @@ import { RowButtonGroupTitle, RowSwitch, } from "@/base/components/RowButton"; +import type { ModalVisibilityProps } from "@/base/components/utils/modal"; import { nameAndExtension } from "@/base/file-name"; import log from "@/base/log"; import { downloadAndRevokeObjectURL } from "@/base/utils/web"; @@ -55,10 +56,11 @@ import React, { type RefObject, } from "react"; -interface ImageEditorOverlayProps { +type ImageEditorOverlayProps = ModalVisibilityProps & { + /** + * The (Ente) file to edit. + */ file: EnteFile; - show: boolean; - onClose: () => void; /** * Called when the user activates the button to save a copy of the given * {@link enteFile} to their Ente account with the edits they have made. @@ -73,7 +75,7 @@ interface ImageEditorOverlayProps { collection: Collection, enteFile: EnteFile, ) => void; -} +}; const filterDefaultValues = { brightness: 100, @@ -446,9 +448,9 @@ export const ImageEditorOverlay: React.FC = ( }; useEffect(() => { - if (!props.show || !props.file) return; + if (!props.open || !props.file) return; loadCanvas(); - }, [props.show, props.file]); + }, [props.open, props.file]); const handleClose = () => { setFileURL(undefined); @@ -463,7 +465,7 @@ export const ImageEditorOverlay: React.FC = ( } }; - if (!props.show) { + if (!props.open) { return <>; } diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx index 015ea73137..a875819696 100644 --- a/web/apps/photos/src/components/PhotoViewer/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/index.tsx @@ -1011,9 +1011,9 @@ export const PhotoViewer: React.FC = ({ onSelectPerson={handleSelectPerson} />