Skip to content

Commit

Permalink
Merge pull request #2211 from graphcommerce-org/feature/no-thumbnail-…
Browse files Browse the repository at this point in the history
…when-there-is-only-one-picture-GCOM-1335

Feature/no thumbnail when there is only one picture gcom 1335
  • Loading branch information
paales authored Feb 19, 2024
2 parents 7937b20 + 2fc62cd commit 227076b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-beans-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphcommerce/framer-scroller": minor
---

We stopped showing the thumbnails in the sidebargallery when there is only 1 image.
24 changes: 13 additions & 11 deletions packages/framer-scroller/components/ScrollerThumbnails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ const componentName = 'ScrollerThumbnails'
export function ScrollerThumbnails(props: ThumbnailsProps) {
const { images, sx = [], ...buttonProps } = props
return (
<ThumbnailContainer sx={sx}>
{images.map((item, i) => (
<ScrollerThumbnail
// eslint-disable-next-line react/no-array-index-key
key={`${i}-image`}
idx={i}
image={item}
{...buttonProps}
/>
))}
</ThumbnailContainer>
images.length > 1 && (
<ThumbnailContainer sx={sx}>
{images.map((item, i) => (
<ScrollerThumbnail
// eslint-disable-next-line react/no-array-index-key
key={`${i}-image`}
idx={i}
image={item}
{...buttonProps}
/>
))}
</ThumbnailContainer>
)
)
}

Expand Down

0 comments on commit 227076b

Please sign in to comment.