Skip to content

Commit

Permalink
fix: toast for field
Browse files Browse the repository at this point in the history
  • Loading branch information
TrayMachi committed Jan 1, 2025
1 parent f88b6fd commit fc3b342
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/modules/RegistrationModule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,31 @@ const RegistrationModule = () => {
isLoading={isLoading}
type="submit"
onClick={() => {
if (!form.formState.isValid) {
toast.warning("Please fill in all required fields");
if (
form.getValues().fullName === "" ||
form.getValues().username === "" ||
form.getValues().phoneNumber === "" ||
form.getValues().address === "" ||
form.getValues().identityCard === undefined ||
form.getValues().studyMethood === "" ||
form.getValues().parentName === "" ||
form.getValues().relationWithParent === "" ||
form.getValues().parentPhoneNumber === "" ||
form.getValues().highschoolName === "" ||
form.getValues().highschoolClass === "" ||
form.getValues().meanScore === "" ||
form.getValues().studentReport === undefined ||
form.getValues().motivationLetter ===
undefined ||
form.getValues().commitmentLetter ===
undefined ||
form.getValues().proofOfFollowing === undefined ||
form.getValues().proofOfTwibbon === undefined ||
form.getValues().proofOfSg === undefined
) {
toast.warning(
"Please fill in all required fields"
);
}
}}
className="rounded-[20px]"
Expand Down Expand Up @@ -793,7 +816,11 @@ const RegistrationModule = () => {
/>

<Image
src={isHovered || page === 1 ? getAsset("/MascotDewasa.png") : getAsset("/MascotLesu.png")}
src={
isHovered || page === 1
? getAsset("/MascotDewasa.png")
: getAsset("/MascotLesu.png")
}
width={isHovered || page === 1 ? 224 : 216}
height={isHovered || page === 1 ? 590 : 582}
alt="Mascot"
Expand Down

0 comments on commit fc3b342

Please sign in to comment.