Skip to content

Commit

Permalink
updated review modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Swathi-eGov committed May 24, 2024
1 parent f09b070 commit 23cb581
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
13 changes: 5 additions & 8 deletions react/ui-components/src/atoms/UploadImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ const UploadImage = ({
}
};
useEffect(() => {
window.addEventListener("resize", () => {
onResize();
});
window.addEventListener("resize", onResize);

return () => {
window.addEventListener("resize", () => {
onResize();
});
window.removeEventListener("resize", onResize);
};
});
}, []);

const selectfile = (e) => {
handleChange(e);
Expand Down Expand Up @@ -145,7 +142,7 @@ const UploadImage = ({
<div className="digit-img-container">
{previews.map((preview, index) => {
return (
<Fragment key={index}>
<Fragment key={`preview-${index}`}>
<div
className={`preview-container ${
uploadedFilesCount > 1 ? " multiple" : ""
Expand Down
14 changes: 5 additions & 9 deletions react/ui-components/src/atoms/UploadPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ const UploadPopup = ({
}
};
useEffect(() => {
window.addEventListener("resize", () => {
onResize();
});
window.addEventListener("resize", onResize);

return () => {
window.addEventListener("resize", () => {
onResize();
});
window.removeEventListener("resize", onResize);
};
});
}, []);

const dragDropJSX = (
<div
Expand Down Expand Up @@ -105,8 +102,7 @@ const UploadPopup = ({
};

const handleChange = async (newFiles) => {
let newlyUploadedFiles;
newlyUploadedFiles = multiple ? [...files, ...newFiles] : [newFiles];
const newlyUploadedFiles = multiple ? [...files, ...newFiles] : [newFiles];
setFiles(newlyUploadedFiles);
};

Expand Down

0 comments on commit 23cb581

Please sign in to comment.