This commit is contained in:
Manav Rathi
2025-02-10 15:41:01 +05:30
parent 97bdc9362a
commit 970da9f29c

View File

@@ -19,17 +19,18 @@ import PhotoSwipeLightBox from "./ps5/dist/photoswipe-lightbox.esm.js";
import PhotoSwipe from "./ps5/dist/photoswipe.esm.js";
const FileViewer: React.FC = () => {
const pswpRef = useRef<PhotoSwipe | undefined>();
console.log(PhotoSwipeLightBox);
useEffect(() => {
const lightbox = new PhotoSwipeLightBox({
gallery: "#test-gallery",
mainClass: "our-extra-pswp-main-class",
pswpModule: PhotoSwipe,
const pswp = new PhotoSwipe({
// mainClass: "our-extra-pswp-main-class",
});
lightbox.init();
pswp.init();
pswpRef.current = pswp;
return () => {
lightbox.destroy();
pswp.destroy();
pswpRef.current = undefined;
};
}, []);
return (