From 0d2f223ed8f27e597f2c1df4a42b29a41a882671 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 4 Mar 2025 07:39:33 -0800 Subject: [PATCH] Fix focal share links --- src/app/paths.ts | 8 ++++---- src/photo/PhotoDetailPage.tsx | 1 + src/photo/index.ts | 2 +- src/share/ShareModals.tsx | 23 +++++++++++++++-------- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/app/paths.ts b/src/app/paths.ts index f1bb086a..a2247184 100644 --- a/src/app/paths.ts +++ b/src/app/paths.ts @@ -119,10 +119,10 @@ export const pathForPhoto = ({ ? `${pathForCamera(camera)}/${getPhotoId(photo)}` : simulation ? `${pathForFilmSimulation(simulation)}/${getPhotoId(photo)}` - : focal - ? `${pathForFocalLength(focal)}/${getPhotoId(photo)}` - : recipe - ? `${pathForRecipe(recipe)}/${getPhotoId(photo)}` + : recipe + ? `${pathForRecipe(recipe)}/${getPhotoId(photo)}` + : focal + ? `${pathForFocalLength(focal)}/${getPhotoId(photo)}` : `${PREFIX_PHOTO}/${getPhotoId(photo)}`; export const pathForTag = (tag: string) => diff --git a/src/photo/PhotoDetailPage.tsx b/src/photo/PhotoDetailPage.tsx index 619ffae8..777f771c 100644 --- a/src/photo/PhotoDetailPage.tsx +++ b/src/photo/PhotoDetailPage.tsx @@ -123,6 +123,7 @@ export default function PhotoDetailPage({ shouldShareCamera={camera !== undefined} shouldShareSimulation={simulation !== undefined} shouldShareRecipe={recipe !== undefined} + shouldShareFocalLength={focal !== undefined} includeFavoriteInAdminMenu={includeFavoriteInAdminMenu} />, ]} diff --git a/src/photo/index.ts b/src/photo/index.ts index 4cd58e99..e7c51031 100644 --- a/src/photo/index.ts +++ b/src/photo/index.ts @@ -113,8 +113,8 @@ export interface PhotoSetCategory { tag?: string camera?: Camera simulation?: FilmSimulation - focal?: number recipe?: string + focal?: number lens?: Lens // Unimplemented as a set } diff --git a/src/share/ShareModals.tsx b/src/share/ShareModals.tsx index 45811390..21644e70 100644 --- a/src/share/ShareModals.tsx +++ b/src/share/ShareModals.tsx @@ -24,19 +24,26 @@ export default function ShareModals() { } = shareModalProps; if (photo) { - return ; + return ; } else if (photos) { const attributes = {photos, count, dateRange}; if (tag) { - return ; + return ; } else if (camera) { - return ; + return ; } else if (simulation) { - return ; - } else if (focal !== undefined) { - return ; + return ; } else if (recipe) { - return ; - } + return ; + } else if (focal !== undefined) { + return ; + } } }