From 7c7f9e4f13e109ff637d6aa6baf807810c62704b Mon Sep 17 00:00:00 2001 From: cagsun Date: Fri, 27 Jun 2025 00:53:43 +0200 Subject: [PATCH] Added captions to the carousel. Added double carousel option. --- docs/Build_Guide/first2.md | 4 ++-- src/components/ImageCarousel.js | 10 ++++++++- src/components/ImageCarousel.module.css | 21 +++++++++++++++++++ src/components/StepWithDoubleCarousel.js | 18 ++++++++++++++++ .../StepWithDoubleCarousel.module.css | 20 ++++++++++++++++++ 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 src/components/StepWithDoubleCarousel.js create mode 100644 src/components/StepWithDoubleCarousel.module.css diff --git a/docs/Build_Guide/first2.md b/docs/Build_Guide/first2.md index cdc75f8..cdffe1f 100644 --- a/docs/Build_Guide/first2.md +++ b/docs/Build_Guide/first2.md @@ -12,11 +12,11 @@ import StepWithCarousel from '@site/src/components/StepWithCarousel'; diff --git a/src/components/ImageCarousel.js b/src/components/ImageCarousel.js index 3b9b4dd..1c194aa 100644 --- a/src/components/ImageCarousel.js +++ b/src/components/ImageCarousel.js @@ -41,6 +41,9 @@ export default function ImageCarousel({ images }) { className={styles.mainImage} onClick={() => setIsOpen(true)} /> + {currentImage.caption && ( +
{currentImage.caption}
+ )}
{images.map((img, i) => ( ❮ - {currentImage.caption} +
+ {currentImage.caption} + {currentImage.caption && ( +
{currentImage.caption}
+ )} +