Skip to content

Commit

Permalink
Merge pull request #276 from dhrumishah/dhrumishah
Browse files Browse the repository at this point in the history
updated new post section
  • Loading branch information
narayan954 authored May 21, 2023
2 parents f9c6712 + cc61a59 commit 6f087cd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/ImgUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function ImgUpload(props) {
});
};

const handleUpload = () => {
function handleUpload() {
if ((!image && !caption) || !isValidimage) {
enqueueSnackbar("Upload valid image and caption!", {
variant: "error",
Expand Down Expand Up @@ -135,7 +135,7 @@ function ImgUpload(props) {
props.onUploadEnd();
}
});
};
}

return (
<div className="imageUpload">
Expand Down Expand Up @@ -182,6 +182,7 @@ function ImgUpload(props) {
<TextField
onChange={(e) => setCaption(e.target.value)}
value={caption}
variant="filled"
placeholder="Enter a Caption.."
label="Caption"
multiline
Expand All @@ -190,9 +191,17 @@ function ImgUpload(props) {
sx={{
backgroundColor: "white",
borderRadius: "8px",

"& .MuiFormLabel-root.Mui-focused": {
fontWeight: "bold",
},
}}
/>
<AnimatedButton onClick={handleUpload} loading={uploadingPost}>
<AnimatedButton
onClick={handleUpload}
loading={uploadingPost}
style={{ fontWeight: "bold" }}
>
Upload
</AnimatedButton>
</div>
Expand Down

0 comments on commit 6f087cd

Please sign in to comment.