Hide share button for hidden images

This commit is contained in:
Sam Becker 2024-05-26 12:45:02 -05:00
parent 9babc102d4
commit 41968fd6de
3 changed files with 24 additions and 16 deletions

View File

@ -70,6 +70,7 @@ export default async function PhotoTagHiddenPage({
count,
dateRange,
tag: TAG_HIDDEN,
shouldShare: false,
}} />
);
}

View File

@ -25,6 +25,7 @@ export default function PhotoDetailPage({
indexNumber,
count,
dateRange,
shouldShare,
}: {
photo: Photo
photos: Photo[]
@ -36,6 +37,7 @@ export default function PhotoDetailPage({
indexNumber?: number
count?: number
dateRange?: PhotoDateRange
shouldShare?: boolean
}) {
return (
<div>
@ -110,6 +112,7 @@ export default function PhotoDetailPage({
prefetchRelatedLinks
showCamera={!camera}
showSimulation={!simulation}
shouldShare={shouldShare}
shouldShareTag={tag !== undefined}
shouldShareCamera={camera !== undefined}
shouldShareSimulation={simulation !== undefined}

View File

@ -41,6 +41,7 @@ export default function PhotoLarge({
revalidatePhoto,
showCamera = true,
showSimulation = true,
shouldShare = true,
shouldShareTag,
shouldShareCamera,
shouldShareSimulation,
@ -56,6 +57,7 @@ export default function PhotoLarge({
revalidatePhoto?: RevalidatePhoto
showCamera?: boolean
showSimulation?: boolean
shouldShare?: boolean
shouldShareTag?: boolean
shouldShareCamera?: boolean
shouldShareSimulation?: boolean
@ -193,6 +195,7 @@ export default function PhotoLarge({
photo={photo}
className="text-medium"
/>
{shouldShare &&
<ShareButton
className={clsx(
'md:translate-x-[-2.5px]',
@ -204,11 +207,12 @@ export default function PhotoLarge({
camera: shouldShareCamera ? camera : undefined,
// eslint-disable-next-line max-len
simulation: shouldShareSimulation ? photo.filmSimulation : undefined,
// eslint-disable-next-line max-len
focal: shouldShareFocalLength ? photo.focalLength : undefined,
})}
prefetch={prefetchRelatedLinks}
shouldScroll={shouldScrollOnShare}
/>
/>}
</div>
</div>
</DivDebugBaselineGrid>}