fix(ImgViewer): Make ImgViewer clickable to close the image

This commit is contained in:
haitaoo
2023-04-25 15:09:02 +08:00
parent ddda7e6d5a
commit f89687d021
+5
View File
@@ -66,8 +66,13 @@ const Index: FC<{
contentClassName="bg-transparent"
onHide={onClose}>
<Modal.Body onClick={onClose} className="img-viewer p-0 d-flex">
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */}
<img
className="cursor-zoom-out img-fluid m-auto"
onClick={(evt) => {
evt.stopPropagation();
onClose();
}}
src={imgSrc}
alt={imgSrc}
/>