From f7a57f9922df9b3589d488facb0866c2787a6c30 Mon Sep 17 00:00:00 2001 From: Dhrumi Shah <84569241+dhrumishah@users.noreply.github.com> Date: Sun, 21 May 2023 09:22:44 +0530 Subject: [PATCH 1/2] updated new post section --- src/components/ImgUpload.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/ImgUpload.jsx b/src/components/ImgUpload.jsx index e37bc8696..965185bd1 100644 --- a/src/components/ImgUpload.jsx +++ b/src/components/ImgUpload.jsx @@ -182,6 +182,7 @@ function ImgUpload(props) { setCaption(e.target.value)} value={caption} + variant="filled" placeholder="Enter a Caption.." label="Caption" multiline @@ -190,9 +191,17 @@ function ImgUpload(props) { sx={{ backgroundColor: "white", borderRadius: "8px", + + "& .MuiFormLabel-root.Mui-focused": { + fontWeight: "bold", + }, }} /> - + Upload From cc61a593ed8ab6fa5158e21cc936270c02a0d7a8 Mon Sep 17 00:00:00 2001 From: Dhrumi Shah <84569241+dhrumishah@users.noreply.github.com> Date: Sun, 21 May 2023 16:01:47 +0530 Subject: [PATCH 2/2] solved code analysis from deepsource --- src/components/ImgUpload.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ImgUpload.jsx b/src/components/ImgUpload.jsx index 965185bd1..7bfa608d6 100644 --- a/src/components/ImgUpload.jsx +++ b/src/components/ImgUpload.jsx @@ -89,7 +89,7 @@ function ImgUpload(props) { }); }; - const handleUpload = () => { + function handleUpload() { if ((!image && !caption) || !isValidimage) { enqueueSnackbar("Upload valid image and caption!", { variant: "error", @@ -135,7 +135,7 @@ function ImgUpload(props) { props.onUploadEnd(); } }); - }; + } return (