From dcfa7a46d8b85af086aad3bddaec513566c80ad3 Mon Sep 17 00:00:00 2001 From: asif Date: Fri, 27 Dec 2024 16:20:36 +0530 Subject: [PATCH] removed form disabling mechanism and fixed notification bug in CheckInOutManagement.jsx --- src/pages/ChargeEdit.jsx | 6 +----- src/pages/CheckInOutManagement.jsx | 10 +++------- src/pages/KeySwap.jsx | 13 ++++--------- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/pages/ChargeEdit.jsx b/src/pages/ChargeEdit.jsx index 7cc3322..3c727a4 100644 --- a/src/pages/ChargeEdit.jsx +++ b/src/pages/ChargeEdit.jsx @@ -166,10 +166,7 @@ function ChargeEdit() { {notification.message !== "" && } -
- {notification.type === "success" && ( -
- )} + {formFields.map(renderField)}
); } diff --git a/src/pages/CheckInOutManagement.jsx b/src/pages/CheckInOutManagement.jsx index 6e18a2b..375c772 100644 --- a/src/pages/CheckInOutManagement.jsx +++ b/src/pages/CheckInOutManagement.jsx @@ -14,11 +14,7 @@ import FieldsWrapper from "../components/FieldsWrapper"; function CheckInOutManagement() { const [accountNumber, setAccountNumber] = useState(""); - const [notification, setNotification] = useState({ - visible: false, - message: "", - type: "", - }); + const [notification, setNotification] = useState({ message: "", type: "" }); const showToast = useToast(); const { setIsLoading } = useLoading(); @@ -64,7 +60,7 @@ function CheckInOutManagement() { return (
- {notification.visible && } + { notification.message !== "" && } @@ -80,7 +76,7 @@ function CheckInOutManagement() { }} /> - +
diff --git a/src/pages/KeySwap.jsx b/src/pages/KeySwap.jsx index 4fa12e1..76fb4fb 100644 --- a/src/pages/KeySwap.jsx +++ b/src/pages/KeySwap.jsx @@ -166,15 +166,10 @@ function KeySwap() { {notification.message !== "" && } -
- {notification.type === "success" && ( -
- )} - - {formFields.map(renderField)} -
+ + {formFields.map(renderField)} +
); }