Commit aafcc21a authored by boojack's avatar boojack

fix: improve image preview dialog and live photo trigger

parent 6b0487dc
...@@ -41,10 +41,11 @@ const MotionPhotoPreview = ({ ...@@ -41,10 +41,11 @@ const MotionPhotoPreview = ({
containerClassName={cn("max-w-full max-h-full", containerClassName)} containerClassName={cn("max-w-full max-h-full", containerClassName)}
mediaClassName={mediaClassName} mediaClassName={mediaClassName}
/> />
<button <div
type="button" role="button"
tabIndex={0}
className={cn( className={cn(
"absolute rounded-full border border-border/45 bg-background/65 px-2.5 py-1 text-xs font-semibold tracking-wide text-foreground backdrop-blur-sm transition-colors hover:bg-background/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50", "absolute select-none rounded-full border border-border/45 bg-background/65 px-2.5 py-1 text-xs font-semibold tracking-wide text-foreground backdrop-blur-sm transition-colors hover:bg-background/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
badgeClassName, badgeClassName,
)} )}
onMouseEnter={() => setMotionActive(true)} onMouseEnter={() => setMotionActive(true)}
...@@ -64,10 +65,16 @@ const MotionPhotoPreview = ({ ...@@ -64,10 +65,16 @@ const MotionPhotoPreview = ({
} }
}} }}
onPointerCancel={() => setMotionActive(false)} onPointerCancel={() => setMotionActive(false)}
onKeyDown={(event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
setMotionActive((prev) => !prev);
}
}}
aria-label="Hover or press to play live photo" aria-label="Hover or press to play live photo"
> >
LIVE LIVE
</button> </div>
</div> </div>
); );
}; };
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment