removed form disabling mechanism and fixed notification bug in CheckInOutManagement.jsx

This commit is contained in:
Md Asif 2024-12-27 16:20:36 +05:30
parent 2afefc7442
commit dcfa7a46d8
3 changed files with 8 additions and 21 deletions

View File

@ -166,10 +166,7 @@ function ChargeEdit() {
<AnimatePresence> <AnimatePresence>
{notification.message !== "" && <Notification {...notification} />} {notification.message !== "" && <Notification {...notification} />}
</AnimatePresence> </AnimatePresence>
<div className="relative">
{notification.type === "success" && (
<div className="absolute inset-0 bg-[#fff]/50 z-10 rounded-3xl" />
)}
<FormBox title={t("chargeEdit")}> <FormBox title={t("chargeEdit")}>
<FieldsWrapper>{formFields.map(renderField)}</FieldsWrapper> <FieldsWrapper>{formFields.map(renderField)}</FieldsWrapper>
<Button <Button
@ -180,7 +177,6 @@ function ChargeEdit() {
} }
/> />
</FormBox> </FormBox>
</div>
</div> </div>
); );
} }

View File

@ -14,11 +14,7 @@ import FieldsWrapper from "../components/FieldsWrapper";
function CheckInOutManagement() { function CheckInOutManagement() {
const [accountNumber, setAccountNumber] = useState(""); const [accountNumber, setAccountNumber] = useState("");
const [notification, setNotification] = useState({ const [notification, setNotification] = useState({ message: "", type: "" });
visible: false,
message: "",
type: "",
});
const showToast = useToast(); const showToast = useToast();
const { setIsLoading } = useLoading(); const { setIsLoading } = useLoading();
@ -64,7 +60,7 @@ function CheckInOutManagement() {
return ( return (
<div> <div>
<AnimatePresence> <AnimatePresence>
{notification.visible && <Notification notification={notification} />} { notification.message !== "" && <Notification {...notification} /> }
</AnimatePresence> </AnimatePresence>
<FormBox title="Check In/Out"> <FormBox title="Check In/Out">
<FieldsWrapper> <FieldsWrapper>
@ -80,7 +76,7 @@ function CheckInOutManagement() {
}} }}
/> />
</FormField> </FormField>
</FieldsWrapper> </FieldsWrapper>
<Button text="Next" onClick={handleNext} /> <Button text="Next" onClick={handleNext} />
</FormBox> </FormBox>
</div> </div>

View File

@ -166,15 +166,10 @@ function KeySwap() {
<AnimatePresence> <AnimatePresence>
{notification.message !== "" && <Notification {...notification} />} {notification.message !== "" && <Notification {...notification} />}
</AnimatePresence> </AnimatePresence>
<div className="relative"> <FormBox title={t("lockerStatus")}>
{notification.type === "success" && ( <FieldsWrapper>{formFields.map(renderField)}</FieldsWrapper>
<div className="absolute inset-0 bg-[#fff]/50 z-10 rounded-3xl" /> <Button text={t("submit")} onClick={handleKeySwap} />
)} </FormBox>
<FormBox title={t("lockerStatus")}>
<FieldsWrapper>{formFields.map(renderField)}</FieldsWrapper>
<Button text={t("submit")} onClick={handleKeySwap} />
</FormBox>
</div>
</div> </div>
); );
} }