diff --git a/components/communityImages.jsx b/components/communityImages.jsx index a2d0012..25bec04 100644 --- a/components/communityImages.jsx +++ b/components/communityImages.jsx @@ -1,23 +1,56 @@ -import Image from 'next/image'; +import Image from "next/image"; +import { useState } from "react"; export default function CommunityImages({ images, basePath }) { + const [currentIndex, setCurrentIndex] = useState(0); + + const nextImage = () => { + setCurrentIndex((prevIndex) => (prevIndex + 1) % images.length); + }; + + const prevImage = () => { + setCurrentIndex( + (prevIndex) => (prevIndex - 1 + images.length) % images.length + ); + }; + return ( -
- {images.map((image, index) => ( -
-

{image.name}

- +
+ +
+ {image.name}
- ))} + +
+

{images[currentIndex].name}

); } diff --git a/config/communityImages.json b/config/communityImages.json index e0f7cd6..d652446 100644 --- a/config/communityImages.json +++ b/config/communityImages.json @@ -6,5 +6,13 @@ { "name": "", "image": "WN24_DSN.JPG" + }, + { + "name": "", + "image": "mass_meeting1.JPG" + }, + { + "name": "", + "image": "mass_meeting2.JPG" } ] diff --git a/public/images/community/mass_meeting2.JPG b/public/images/community/mass_meeting2.JPG index d08d0c7..a29366a 100644 Binary files a/public/images/community/mass_meeting2.JPG and b/public/images/community/mass_meeting2.JPG differ