From 65120de9cb16c0d54f9b917d1966afdbc4beeea2 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Wed, 4 Sep 2024 14:49:19 -0500 Subject: [PATCH] Refactor photo header breakpoints --- src/photo/PhotoHeader.tsx | 56 ++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/src/photo/PhotoHeader.tsx b/src/photo/PhotoHeader.tsx index 863ce75c..a0e33a56 100644 --- a/src/photo/PhotoHeader.tsx +++ b/src/photo/PhotoHeader.tsx @@ -54,7 +54,11 @@ export default function PhotoHeader({ (indexNumber || (selectedPhotoIndex ?? 0 + 1)) + ' of ' + (count ?? photos.length); - const isPhotoSet = selectedPhotoIndex === undefined; + const headerType = selectedPhotoIndex === undefined + ? 'photo-set' + : entity + ? 'photo-detail-with-entity' + : 'photo-detail'; const renderPrevNext = () => - {entity ?? (selectedPhoto !== undefined && { selectedPhoto.title || formatDate(selectedPhoto.takenAt, 'tiny') } )} - - + {/* Content B: Filter Set Meta or Photo Pagination */} +
{entity && <> - {isPhotoSet + {headerType === 'photo-set' ? <> {entityDescription} {sharePath && @@ -130,9 +147,12 @@ export default function PhotoHeader({ {entityVerb} {paginationLabel} } } - +
+ {/* Content C: Nav */}
{selectedPhoto