diff --git a/resources/js/guest/pages/GalleryPage.tsx b/resources/js/guest/pages/GalleryPage.tsx index 6532201..f15555f 100644 --- a/resources/js/guest/pages/GalleryPage.tsx +++ b/resources/js/guest/pages/GalleryPage.tsx @@ -315,12 +315,8 @@ export default function GalleryPage() { releaseLabel={t('common.releaseToRefresh')} refreshingLabel={t('common.refreshing')} > - - + +
@@ -351,40 +347,41 @@ export default function GalleryPage() { )}
-
- -
+ + + {loading && ( {t('galleryPage.loading', 'Lade…')} )} - - {list.map((p: GalleryPhoto) => { - const imageUrl = normalizeImageUrl(p.thumbnail_path || p.file_path); - const createdLabel = p.created_at - ? new Date(p.created_at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) - : t('galleryPage.photo.justNow', 'Gerade eben'); - const likeCount = counts[p.id] ?? (p.likes_count || 0); - const localizedTaskTitle = localizeTaskLabel(p.task_title ?? null, locale); - const altSuffix = localizedTaskTitle - ? t('galleryPage.photo.altTaskSuffix', { task: localizedTaskTitle }) - : ''; - const altText = t('galleryPage.photo.alt', { id: p.id, suffix: altSuffix }, `Foto ${p.id}${altSuffix}`); - const openPhoto = () => { - const index = list.findIndex((photo) => photo.id === p.id); - setCurrentPhotoIndex(index >= 0 ? index : null); - }; + + {list.map((p: GalleryPhoto) => { + const imageUrl = normalizeImageUrl(p.thumbnail_path || p.file_path); + const createdLabel = p.created_at + ? new Date(p.created_at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + : t('galleryPage.photo.justNow', 'Gerade eben'); + const likeCount = counts[p.id] ?? (p.likes_count || 0); + const localizedTaskTitle = localizeTaskLabel(p.task_title ?? null, locale); + const altSuffix = localizedTaskTitle + ? t('galleryPage.photo.altTaskSuffix', { task: localizedTaskTitle }) + : ''; + const altText = t('galleryPage.photo.alt', { id: p.id, suffix: altSuffix }, `Foto ${p.id}${altSuffix}`); - return ( + const openPhoto = () => { + const index = list.findIndex((photo) => photo.id === p.id); + setCurrentPhotoIndex(index >= 0 ? index : null); + }; + + return (
- ); - })} - {list.length === 0 && Array.from({ length: 6 }).map((_, idx) => ( - -
-
- -
-
-
- - ))} + ); + })} + {list.length === 0 && Array.from({ length: 6 }).map((_, idx) => ( + +
+
+ +
+
+
+ + ))} + -
{currentPhotoIndex !== null && list.length > 0 && (