Remove zoom option from videos (#1471)

This commit is contained in:
Abhinav Kumar 2023-11-28 16:16:56 +05:30 committed by GitHub
commit 0c8634351c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {
<DeleteIcon />
</button>
)}
<button
className="pswp__button pswp__button--custom"
onClick={toggleZoomInAndOut}
title={t('ZOOM_IN_OUT')}>
<ZoomInOutlinedIcon />
</button>
{showZoomButton && (
<button
className="pswp__button pswp__button--custom"
onClick={toggleZoomInAndOut}
title={t('ZOOM_IN_OUT')}>
<ZoomInOutlinedIcon />
</button>
)}
<button
className="pswp__button pswp__button--custom"
onClick={() => {