diff --git a/src/photo/PhotoLarge.tsx b/src/photo/PhotoLarge.tsx index 880f3b11..2a624174 100644 --- a/src/photo/PhotoLarge.tsx +++ b/src/photo/PhotoLarge.tsx @@ -106,9 +106,8 @@ export default function PhotoLarge({ const showZoomControls = showZoomControlsProp && areZoomControlsShown; const refRecipe = useRef(null); - const refRecipeTitle = useRef(null); const refRecipeButton = useRef(null); - const refTriggers = useMemo(() => [refRecipeTitle, refRecipeButton], []); + const refTriggers = useMemo(() => [refRecipeButton], []); const { shouldShowRecipe, toggleRecipe, @@ -271,11 +270,8 @@ export default function PhotoLarge({ />} {showRecipeContent && } {showTagsContent && diff --git a/src/recipe/RecipeHeader.tsx b/src/recipe/RecipeHeader.tsx index a90356a8..422f5fca 100644 --- a/src/recipe/RecipeHeader.tsx +++ b/src/recipe/RecipeHeader.tsx @@ -4,7 +4,7 @@ import { Photo, PhotoDateRange } from '@/photo'; import PhotoHeader from '@/photo/PhotoHeader'; import PhotoRecipe from './PhotoRecipe'; import { useAppState } from '@/state/AppState'; -import { descriptionForRecipePhotos } from '.'; +import { descriptionForRecipePhotos, photoHasRecipe } from '.'; export default function RecipeHeader({ recipe, photos, @@ -22,8 +22,9 @@ export default function RecipeHeader({ }) { const { setRecipeModalProps } = useAppState(); - const photo = photos.find(({ filmSimulation, recipeData }) => - recipeData && filmSimulation); + const photo = photoHasRecipe(selectedPhoto) + ? selectedPhoto + : photos.find(photoHasRecipe); return ( + photo?.filmSimulation && photo?.recipeData; diff --git a/src/tag/index.ts b/src/tag/index.ts index 29cc8805..628df972 100644 --- a/src/tag/index.ts +++ b/src/tag/index.ts @@ -51,9 +51,9 @@ export const shareTextForTag = (tag: string) => export const sortTags = ( tags: string[], - tagToHide?: string, + tagToExclude?: string, ) => tags - .filter(tag => tag !== tagToHide) + .filter(tag => tag !== tagToExclude) .sort((a, b) => isTagFavs(a) ? -1 : a.localeCompare(b)); export const sortTagsObject = (