Skip to content

Commit

Permalink
🍁 submit button in Q&A page corrected (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayamRana808 authored May 16, 2024
1 parent 330d647 commit 98bcd3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions frontend/src/pages/Q&A/Q&A.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,17 @@ function Ques(props) {
body: JSON.stringify(formdata),
});
const data = await response.json();
if(data.errStack){
setToastMessage(`${data.errStack}`);
setOpenToast(true);
setSeverity("error");
}else{
setToastMessage("Q&A added successfully!");
setOpenToast(true);
setSeverity("success");
}
setIsUploadingData(false);
setToastMessage("Q&A added successfully!");
setOpenToast(true);
setSeverity("success");

setFormData({
title: "",
description: "",
Expand Down Expand Up @@ -421,14 +428,13 @@ function Ques(props) {
style={{ justifyContent: "space-around" }}
>
<div className="data-loader">
{isUploadingData ? <Loader /> : null}
</div>
<Button2
{isUploadingData ? <Loader /> : <Button2
style={{ marginRight: "3%" }}
className={style["submit-btn-text"]}
label="Submit"
type="submit"
/>
/>}
</div>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Q&A/Ques.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
.data-loader {
width: 100%;
display: flex;
height: 10px;
height: 60px;
justify-content: center;
align-items: center;
}

0 comments on commit 98bcd3d

Please sign in to comment.