diff --git a/web/apps/photos/src/components/PhotoFrame.tsx b/web/apps/photos/src/components/PhotoFrame.tsx index 1cd1bf5661..8052fcb36c 100644 --- a/web/apps/photos/src/components/PhotoFrame.tsx +++ b/web/apps/photos/src/components/PhotoFrame.tsx @@ -123,7 +123,7 @@ export interface PhotoFrameProps { } /** - * TODO: Rename me to FileListWithViewer + * TODO: Rename me to FileListWithViewer (or Gallery?) */ const PhotoFrame = ({ mode, @@ -503,7 +503,10 @@ const PhotoFrame = ({ return ( - {process.env.NEXT_PUBLIC_ENTE_WIP_PS5 && } + {process.env.NEXT_PUBLIC_ENTE_WIP_PS5 && ( + /* @ts-expect-error TODO(PS): test */ + + )} {({ height, width }) => ( { +const FileViewer: React.FC = ({ files, index }) => { const pswpRef = useRef(); - console.log(PhotoSwipeLightBox); + useEffect(() => { const pswp = new PhotoSwipe({ - // mainClass: "our-extra-pswp-main-class", + // Opaque background. + bgOpacity: 1, + // TODO(PS): padding option? for handling custom title bar. + // TODO(PS): will we need this? + mainClass: "our-extra-pswp-main-class", }); // Provide data about slides to PhotoSwipe via callbacks // https://photoswipe.com/data-sources/#dynamically-generated-data @@ -58,6 +86,7 @@ const FileViewer: React.FC = () => { height: 100, }; }); + // initializing PhotoSwipe Core adds it to the DOM. pswp.init(); pswpRef.current = pswp; @@ -66,6 +95,7 @@ const FileViewer: React.FC = () => { pswpRef.current = undefined; }; }, []); + return (