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

View File

@ -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 (
<div>
<AnimatePresence>
{notification.visible && <Notification notification={notification} />}
{ notification.message !== "" && <Notification {...notification} /> }
</AnimatePresence>
<FormBox title="Check In/Out">
<FieldsWrapper>
@ -80,7 +76,7 @@ function CheckInOutManagement() {
}}
/>
</FormField>
</FieldsWrapper>
</FieldsWrapper>
<Button text="Next" onClick={handleNext} />
</FormBox>
</div>

View File

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