diff --git a/src/main/front/package-lock.json b/src/main/front/package-lock.json index 1822343..9f70161 100644 --- a/src/main/front/package-lock.json +++ b/src/main/front/package-lock.json @@ -16,6 +16,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-infinite-scroller": "^1.2.6", + "react-photoswipe-gallery": "^3.0.2", "react-router-dom": "^6.26.2", "react-show-more-text": "github:junglesub/react-show-more-text", "recoil": "^0.7.7" @@ -4133,6 +4134,16 @@ "node": ">=8" } }, + "node_modules/photoswipe": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/photoswipe/-/photoswipe-5.4.4.tgz", + "integrity": "sha512-WNFHoKrkZNnvFFhbHL93WDkW3ifwVOXSW3w1UuZZelSmgXpIGiZSNlZJq37rR8YejqME2rHs9EhH9ZvlvFH2NA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.12.0" + } + }, "node_modules/picocolors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", @@ -4252,6 +4263,17 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/react-photoswipe-gallery": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/react-photoswipe-gallery/-/react-photoswipe-gallery-3.0.2.tgz", + "integrity": "sha512-TLkpzp2BSUUL/4GPRU5SQWXfJ8xuUBKgS8qUaHyhsT1co6CStr1mVCl4oQrSSFbWxAKhB5fHbr12l1R+TkqFcQ==", + "license": "MIT", + "peerDependencies": { + "photoswipe": ">= 5.2.2", + "prop-types": ">= 15.7.0", + "react": ">= 16.8.0" + } + }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", diff --git a/src/main/front/package.json b/src/main/front/package.json index 8b9d8c8..dbe4a31 100644 --- a/src/main/front/package.json +++ b/src/main/front/package.json @@ -18,6 +18,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-infinite-scroller": "^1.2.6", + "react-photoswipe-gallery": "^3.0.2", "react-router-dom": "^6.26.2", "react-show-more-text": "github:junglesub/react-show-more-text", "recoil": "^0.7.7" diff --git a/src/main/front/src/components/FeedCardGallery.jsx b/src/main/front/src/components/FeedCardGallery.jsx index 2fc58e7..300092c 100644 --- a/src/main/front/src/components/FeedCardGallery.jsx +++ b/src/main/front/src/components/FeedCardGallery.jsx @@ -1,33 +1,69 @@ import "./FeedCardGallery.css"; +import { Gallery, useGallery } from "react-photoswipe-gallery"; import { getExtensionFromUrl, isImage, isVideo } from "../tools/tools"; +import "photoswipe/dist/photoswipe.css"; +import FeedCardImageItem from "./FeedCardImageItem"; + const FeedCardGallery = ({ images = [] }) => { const filteredImages = images.filter((url) => isImage(url) || isVideo(url)); if (filteredImages.length === 0) return <>>; return (