Fix recipe overlay shadow/background

This commit is contained in:
Sam Becker 2025-04-17 17:27:47 -05:00
parent 46d49299d6
commit aa7918563e
3 changed files with 11 additions and 6 deletions

View File

@ -90,10 +90,9 @@ export default function Modal({
className={clsx( className={clsx(
container && 'w-[calc(100vw-1.5rem)] sm:w-[min(540px,90vw)]', container && 'w-[calc(100vw-1.5rem)] sm:w-[min(540px,90vw)]',
container && !noPadding && 'p-3 md:p-4', container && !noPadding && 'p-3 md:p-4',
container && 'rounded-lg md:rounded-xl', container && 'rounded-lg md:rounded-xl border-medium',
container && 'border-medium', container && 'bg-white dark:bg-black',
'bg-white dark:bg-black', container && 'shadow-2xl/20 dark:shadow-2xl/100',
'shadow-2xl/20 dark:shadow-2xl/100',
className, className,
)} )}
> >

View File

@ -26,9 +26,11 @@ export default function PhotoRecipeOverlay({
data, data,
film, film,
onClose, onClose,
isOnPhoto = true,
}: RecipeProps & { }: RecipeProps & {
ref?: RefObject<HTMLDivElement | null> ref?: RefObject<HTMLDivElement | null>
onClose?: () => void onClose?: () => void
isOnPhoto?: boolean
}) { }) {
const { const {
dynamicRange, dynamicRange,
@ -96,7 +98,11 @@ export default function PhotoRecipeOverlay({
'z-10', 'z-10',
'w-[20rem] p-3 space-y-3', 'w-[20rem] p-3 space-y-3',
'scroll-mt-8', 'scroll-mt-8',
'rounded-lg shadow-2xl', 'rounded-lg',
isOnPhoto
? 'shadow-2xl'
// Soften shadow to mimic <Modal />
: 'shadow-2xl/20 dark:shadow-2xl/100',
'text-[13.5px] text-black', 'text-[13.5px] text-black',
'bg-white/70 border border-neutral-200/30', 'bg-white/70 border border-neutral-200/30',
'backdrop-blur-xl saturate-[300%]', 'backdrop-blur-xl saturate-[300%]',

View File

@ -12,13 +12,13 @@ export default function ShareModals() {
if (recipeModalProps) { if (recipeModalProps) {
return <Modal return <Modal
className="bg-transparent!"
onClose={() => setRecipeModalProps?.(undefined)} onClose={() => setRecipeModalProps?.(undefined)}
container={false} container={false}
> >
<PhotoRecipeOverlay {...{ <PhotoRecipeOverlay {...{
...recipeModalProps, ...recipeModalProps,
onClose: () => setRecipeModalProps?.(undefined), onClose: () => setRecipeModalProps?.(undefined),
isOnPhoto: false,
}}/> }}/>
</Modal>; </Modal>;
} }