Skip to content

Commit

Permalink
added toggles if there's only 1 image
Browse files Browse the repository at this point in the history
  • Loading branch information
ickynavigator committed Feb 24, 2024
1 parent ca6699a commit 4c24a45
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/(root)/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const Page = async () => {
}
})();

const isMultipleImages = projectImages?.length > 1;

return (
<Card
shadow="sm"
Expand All @@ -108,7 +110,12 @@ const Page = async () => {
>
<Stack>
<CardSection>
<Carousel withControls={false}>
<Carousel
withControls={isMultipleImages}
draggable={isMultipleImages}
loop
withIndicators={isMultipleImages}
>
{projectImages?.map(i => (
<CarouselSlide key={i.asset._ref}>
<Image
Expand Down

0 comments on commit 4c24a45

Please sign in to comment.