Skip to content

Commit

Permalink
Fixed eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gaagul committed Oct 4, 2023
1 parent 2261510 commit e80d626
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/Attachments/Preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ const Preview = ({
downloadRef.current?.focus();
};

const handleKeyDown = event => {
if (event.key === "ArrowRight") {
handleRightArrowClick();
} else if (event.key === "ArrowLeft") {
handleLeftArrowClick();
}
};

const handleDownload = () => {
saveAs(url, filename);
};
Expand Down Expand Up @@ -74,14 +82,8 @@ const Preview = ({
className="ne-attachments-preview"
isOpen={!isEmpty(selectedAttachment)}
size="large"
onClose={onClose}
onKeyDown={event => {
if (event.key === "ArrowRight") {
handleRightArrowClick();
} else if (event.key === "ArrowLeft") {
handleLeftArrowClick();
}
}}
{...{ onClose }}
onKeyDown={handleKeyDown}
>
<Modal.Header className="ne-attachments-preview__header">
<Typography style="h2">{filename}</Typography>
Expand Down

0 comments on commit e80d626

Please sign in to comment.