From bb58c91977a21e243adc966446ac52d4abab8a93 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 8 Mar 2025 11:20:40 -0600 Subject: [PATCH] Add tooltip to recipe button on desktop --- src/admin/ExifCaptureButton.tsx | 2 +- src/admin/PhotoSyncButton.tsx | 2 +- .../primitives/TooltipPrimitive.tsx | 12 ++-- src/photo/PhotoLarge.tsx | 55 ++++++++++++------- 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/admin/ExifCaptureButton.tsx b/src/admin/ExifCaptureButton.tsx index cd867398..cdfc0f7d 100644 --- a/src/admin/ExifCaptureButton.tsx +++ b/src/admin/ExifCaptureButton.tsx @@ -21,7 +21,7 @@ export default function ExifCaptureButton({ return ( (null); @@ -29,7 +29,7 @@ export default function TooltipPrimitive({ const supportsHover = useSupportsHover(); - const includeButton = supportMobile && !supportsHover; + const includeButton = !desktopOnly && !supportsHover; useClickInsideOutside({ htmlElements: [refTrigger, refContent], @@ -39,19 +39,19 @@ export default function TooltipPrimitive({ }); const classNameTrigger = clsx( - 'link cursor-default inline-block', + 'cursor-default inline-block', classNameTriggerProp, ); return ( - + {includeButton ? diff --git a/src/photo/PhotoLarge.tsx b/src/photo/PhotoLarge.tsx index 2a624174..c77426bd 100644 --- a/src/photo/PhotoLarge.tsx +++ b/src/photo/PhotoLarge.tsx @@ -27,6 +27,7 @@ import { ALLOW_PUBLIC_DOWNLOADS, SHOW_TAKEN_AT_TIME, SHOW_RECIPES, + SHOW_FILM_SIMULATIONS, } from '@/app/config'; import AdminPhotoMenuClient from '@/admin/AdminPhotoMenuClient'; import { RevalidatePhoto } from './InfinitePhotoScroll'; @@ -325,33 +326,47 @@ export default function PhotoLarge({
  • {photo.exposureCompensationFormatted ?? '0ev'}
  • {( - (showSimulation && photo.filmSimulation) || - (SHOW_RECIPES && showRecipe && photo.recipeData) + ( + SHOW_FILM_SIMULATIONS && + showSimulation && + photo.filmSimulation + ) || + (SHOW_RECIPES && photo.recipeData) ) &&
    - {showSimulation && photo.filmSimulation && + {( + SHOW_FILM_SIMULATIONS && + showSimulation && + photo.filmSimulation + ) && } {SHOW_RECIPES && photo.recipeData && - } + + + }
    } }