Skip to content

Commit

Permalink
fix: center the gallery image
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Oct 16, 2023
1 parent cab78d8 commit 7c63699
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/ui/gallery/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,19 @@ export const Gallery: FC<GalleryProps> = (props) => {
<div
className={clsx('w-full', 'relative', styles['root'])}
ref={ref}
onTouchMove={handleCancelAutoplay}
onWheel={handleCancelAutoplay}
onTouchStart={handleCancelAutoplay}
>
<div
className={clsx(
'w-full overflow-auto whitespace-nowrap',
styles['container'],
)}
ref={setContainerRef}
onTouchStart={handleCancelAutoplay}
onScroll={handleOnScroll}
ref={setContainerRef}
onTouchMove={handleCancelAutoplay}
onWheel={handleCancelAutoplay}
>
{images.map((image) => {
return <GalleryItem key={image.url} image={image} />
Expand Down Expand Up @@ -198,7 +201,7 @@ const GalleryItem: FC<{
return (
<div
style={childStyle}
className={clsx(styles['child'], 'inline-block')}
className={clsx(styles['child'], 'inline-block self-center')}
key={`${image.url}-${image.name || ''}`}
>
<FixedZoomedImage
Expand All @@ -210,3 +213,5 @@ const GalleryItem: FC<{
</div>
)
})

GalleryItem.displayName = 'GalleryItem'

1 comment on commit 7c63699

@vercel
Copy link

@vercel vercel bot commented on 7c63699 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
shiro-innei.vercel.app
springtide.vercel.app
innei.in

Please sign in to comment.