From 236101d34e087fa5fab6a9ef1d2e9f39895f9483 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 5 Sep 2024 20:31:23 -0500 Subject: [PATCH] Wrap page titles in

tags --- src/photo/PhotoDetailPage.tsx | 1 + src/photo/PhotoHeader.tsx | 25 +++++++++++++++---------- src/photo/PhotoLarge.tsx | 18 ++++++++++++------ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/photo/PhotoDetailPage.tsx b/src/photo/PhotoDetailPage.tsx index ecfd14d7..a23f0505 100644 --- a/src/photo/PhotoDetailPage.tsx +++ b/src/photo/PhotoDetailPage.tsx @@ -102,6 +102,7 @@ export default function PhotoDetailPage({ priority prefetchRelatedLinks showTitle={Boolean(customHeader)} + showTitleAsH1 showCamera={!camera} showSimulation={!simulation} shouldShare={shouldShare} diff --git a/src/photo/PhotoHeader.tsx b/src/photo/PhotoHeader.tsx index a0e33a56..d798eedf 100644 --- a/src/photo/PhotoHeader.tsx +++ b/src/photo/PhotoHeader.tsx @@ -77,6 +77,18 @@ export default function PhotoHeader({ : <>{end}
– {start}} ; + const renderContentA = () => entity ?? ( + selectedPhoto !== undefined && + + { + selectedPhoto.title || + formatDate(selectedPhoto.takenAt, 'tiny') + } + ); + return ( - {entity ?? (selectedPhoto !== undefined && - - { - selectedPhoto.title || - formatDate(selectedPhoto.takenAt, 'tiny') - } - )} + {headerType === 'photo-detail-with-entity' + ? renderContentA() + :

{renderContentA()}

} {/* Content B: Filter Set Meta or Photo Pagination */}
+ ; + return (
- {hasTitle && - } + {hasTitle && (showTitleAsH1 + ?

{renderPhotoLink()}

+ : renderPhotoLink())}