From 68eed4e5fd3e43064723b3f074b9254f9466dfd7 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Tue, 1 Apr 2025 21:37:01 +0100 Subject: [PATCH] fix: don't show carousel buttons when only one image is present and image dimensions --- src/app/components/carousel.tsx | 36 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/app/components/carousel.tsx b/src/app/components/carousel.tsx index d867c89..3cb748f 100644 --- a/src/app/components/carousel.tsx +++ b/src/app/components/carousel.tsx @@ -30,28 +30,32 @@ export default function Carousel({ images, className }: Props) {
{images.map((src, index) => (
- +
))}
- - + {images.length > 1 && ( + <> + + -
- {scrollSnaps.map((_, index) => ( -
+
+ {scrollSnaps.map((_, index) => ( +
+ + )} ); }