diff --git a/apps/photos/src/components/PhotoViewer/index.tsx b/apps/photos/src/components/PhotoViewer/index.tsx index b0756d3f3..214fa052c 100644 --- a/apps/photos/src/components/PhotoViewer/index.tsx +++ b/apps/photos/src/components/PhotoViewer/index.tsx @@ -137,6 +137,8 @@ function PhotoViewer(props: Iprops) { const [showEditButton, setShowEditButton] = useState(false); + const [showZoomButton, setShowZoomButton] = useState(false); + useEffect(() => { if (publicCollectionGalleryContext.accessedThroughSharedURL) { publicCollectionDownloadManager.setProgressUpdater( @@ -338,6 +340,10 @@ function PhotoViewer(props: Iprops) { ); } + function updateShowZoomButton(file: EnteFile) { + setShowZoomButton(file.metadata.fileType === FILE_TYPE.IMAGE); + } + const openPhotoSwipe = () => { const { items, currentIndex } = props; const options = { @@ -411,6 +417,7 @@ function PhotoViewer(props: Iprops) { updateShowConvertBtn(currItem); updateIsSourceLoaded(currItem); updateShowEditButton(currItem); + updateShowZoomButton(currItem); }); photoSwipe.listen('resize', () => { if (!photoSwipe?.currItem) return; @@ -766,12 +773,14 @@ function PhotoViewer(props: Iprops) { )} - + {showZoomButton && ( + + )}