fix(ui): image metadata viewer stuck when spamming hotkey

This commit is contained in:
psychedelicious 2024-05-07 09:50:54 +10:00
parent 886f5c90a3
commit e8d60e8d83

View File

@ -103,24 +103,11 @@ const CurrentImagePreview = ({
dataTestId="image-preview" dataTestId="image-preview"
/> />
)} )}
<AnimatePresence> {shouldShowImageDetails && imageDTO && withMetadata && (
{shouldShowImageDetails && imageDTO && withMetadata && ( <Box position="absolute" opacity={0.8} top={0} width="full" height="full" borderRadius="base">
<Box <ImageMetadataViewer image={imageDTO} />
as={motion.div} </Box>
key="metadataViewer" )}
initial={initial}
animate={animateMetadata}
exit={exit}
position="absolute"
top={0}
width="full"
height="full"
borderRadius="base"
>
<ImageMetadataViewer image={imageDTO} />
</Box>
)}
</AnimatePresence>
<AnimatePresence> <AnimatePresence>
{withNextPrevButtons && shouldShowNextPrevButtons && imageDTO && ( {withNextPrevButtons && shouldShowNextPrevButtons && imageDTO && (
<Box <Box
@ -152,10 +139,6 @@ const animateArrows: AnimationProps['animate'] = {
opacity: 1, opacity: 1,
transition: { duration: 0.07 }, transition: { duration: 0.07 },
}; };
const animateMetadata: AnimationProps['animate'] = {
opacity: 0.8,
transition: { duration: 0.07 },
};
const exit: AnimationProps['exit'] = { const exit: AnimationProps['exit'] = {
opacity: 0, opacity: 0,
transition: { duration: 0.07 }, transition: { duration: 0.07 },