Refine lightbox styles

This commit is contained in:
Sam Becker 2025-10-05 10:56:11 -05:00
parent a2a8538948
commit e8517c6cdd
2 changed files with 14 additions and 13 deletions

View File

@ -17,6 +17,8 @@ export default function PhotoGrid({
photos, photos,
selectedPhoto, selectedPhoto,
prioritizeInitialPhotos, prioritizeInitialPhotos,
className,
classNamePhoto,
animate = true, animate = true,
canStart, canStart,
animateOnFirstLoadOnly, animateOnFirstLoadOnly,
@ -31,6 +33,8 @@ export default function PhotoGrid({
photos: Photo[] photos: Photo[]
selectedPhoto?: Photo selectedPhoto?: Photo
prioritizeInitialPhotos?: boolean prioritizeInitialPhotos?: boolean
className?: string
classNamePhoto?: string
animate?: boolean animate?: boolean
canStart?: boolean canStart?: boolean
animateOnFirstLoadOnly?: boolean animateOnFirstLoadOnly?: boolean
@ -52,7 +56,9 @@ export default function PhotoGrid({
} = useSelectPhotosState(); } = useSelectPhotosState();
return ( return (
<div {...{ [DATA_KEY_PHOTO_GRID]: selectable }}> <div
{...{ [DATA_KEY_PHOTO_GRID]: selectable, className }}
>
<AnimateItems <AnimateItems
className={clsx( className={clsx(
'grid', 'grid',
@ -91,6 +97,7 @@ export default function PhotoGrid({
'flex w-full h-full', 'flex w-full h-full',
// Prevent photo navigation when selecting // Prevent photo navigation when selecting
isSelectingPhotos && 'pointer-events-none', isSelectingPhotos && 'pointer-events-none',
classNamePhoto,
)} )}
{...{ {...{
photo, photo,

View File

@ -1,11 +1,8 @@
'use client';
import { clsx } from 'clsx/lite'; import { clsx } from 'clsx/lite';
import { Photo } from '.'; import { Photo } from '.';
import { PhotoSetCategory } from '../category'; import { PhotoSetCategory } from '../category';
import PhotoGrid from './PhotoGrid'; import PhotoGrid from './PhotoGrid';
import Link from 'next/link'; import Link from 'next/link';
import { useAppText } from '@/i18n/state/client';
export default function PhotoLightbox({ export default function PhotoLightbox({
count, count,
@ -19,8 +16,6 @@ export default function PhotoLightbox({
maxPhotosToShow?: number maxPhotosToShow?: number
moreLink: string moreLink: string
} & PhotoSetCategory) { } & PhotoSetCategory) {
const { utility } = useAppText();
const photoCountToShow = maxPhotosToShow < count const photoCountToShow = maxPhotosToShow < count
? maxPhotosToShow - 1 ? maxPhotosToShow - 1
: maxPhotosToShow; : maxPhotosToShow;
@ -31,7 +26,7 @@ export default function PhotoLightbox({
return ( return (
<div className={clsx( <div className={clsx(
'border-main p-1.5 lg:p-2 rounded-md', 'border-main p-1 rounded-md',
'bg-gray-50 dark:bg-gray-950', 'bg-gray-50 dark:bg-gray-950',
)}> )}>
<PhotoGrid <PhotoGrid
@ -43,15 +38,14 @@ export default function PhotoLightbox({
href={moreLink} href={moreLink}
className={clsx( className={clsx(
'flex flex-col items-center justify-center', 'flex flex-col items-center justify-center',
'gap-0.5 lg:gap-1', 'gap-0.5',
'text-[1.1rem] lg:text-[1.25rem]',
)} )}
> >
<div className="text-[1.1rem] lg:text-[1.5rem]">
+{countNotShown} +{countNotShown}
</div>
<div className="text-dim">{utility.more}</div>
</Link> </Link>
: undefined} : undefined}
classNamePhoto="rounded-sm overflow-hidden border-main"
selectable={false} selectable={false}
small small
/> />