From 4f910b2d2a30b8d4d2ffcba9b6e3cd158e6975d0 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Tue, 3 Feb 2026 22:16:02 +0100 Subject: [PATCH] Refine guest v2 gallery empty states --- .../js/guest-v2/screens/GalleryScreen.tsx | 134 ++++++++++++++++-- 1 file changed, 119 insertions(+), 15 deletions(-) diff --git a/resources/js/guest-v2/screens/GalleryScreen.tsx b/resources/js/guest-v2/screens/GalleryScreen.tsx index 3db6cf68..2c221c6d 100644 --- a/resources/js/guest-v2/screens/GalleryScreen.tsx +++ b/resources/js/guest-v2/screens/GalleryScreen.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Button } from '@tamagui/button'; -import { Image as ImageIcon, Filter } from 'lucide-react'; +import { Camera, Image as ImageIcon, Filter } from 'lucide-react'; import AppShell from '../components/AppShell'; import PhotoFrameTile from '../components/PhotoFrameTile'; import { useEventData } from '../context/EventDataContext'; @@ -56,6 +56,7 @@ export default function GalleryScreen() { const [loading, setLoading] = React.useState(false); const { data: delta } = usePollGalleryDelta(token ?? null, { locale }); const [filter, setFilter] = React.useState('latest'); + const uploadPath = React.useMemo(() => buildEventPath(token ?? null, '/upload'), [token]); React.useEffect(() => { if (!token) { @@ -139,6 +140,8 @@ export default function GalleryScreen() { const displayPhotos = filteredPhotos; const leftColumn = displayPhotos.filter((_, index) => index % 2 === 0); const rightColumn = displayPhotos.filter((_, index) => index % 2 === 1); + const isEmpty = !loading && displayPhotos.length === 0; + const isSingle = !loading && displayPhotos.length === 1; React.useEffect(() => { if (filter === 'photobooth' && !photos.some((photo) => photo.ingestSource === 'photobooth')) { @@ -265,10 +268,88 @@ export default function GalleryScreen() { - - - {(loading || leftColumn.length === 0 ? Array.from({ length: 5 }, (_, index) => index) : leftColumn).map( - (tile, index) => { + {isEmpty ? ( + + + + + + {t('galleryPage.emptyTitle', 'Noch keine Fotos')} + + + {t('galleryPage.emptyDescription', 'Lade das erste Foto hoch und starte die Galerie.')} + + + + ) : isSingle ? ( + + + + + ) : ( + + + {(loading ? Array.from({ length: 5 }, (_, index) => index) : leftColumn).map((tile, index) => { if (typeof tile === 'number') { return ; } @@ -289,12 +370,10 @@ export default function GalleryScreen() { ); - } - )} - - - {(loading || rightColumn.length === 0 ? Array.from({ length: 5 }, (_, index) => index) : rightColumn).map( - (tile, index) => { + })} + + + {(loading ? Array.from({ length: 5 }, (_, index) => index) : rightColumn).map((tile, index) => { if (typeof tile === 'number') { return ; } @@ -315,10 +394,35 @@ export default function GalleryScreen() { ); - } - )} - - + })} + {!loading && rightColumn.length === 0 ? ( + + ) : null} + + + )}