diff --git a/src/hooks/auth.ts b/src/hooks/auth.ts index c73a862..4c57fcd 100644 --- a/src/hooks/auth.ts +++ b/src/hooks/auth.ts @@ -196,6 +196,7 @@ export const useUserData: electric_bill_document_url: userData.electric_bill_document_url, residence_photo_url: userData.residence_photo_url, affiliation_code: userData.affiliation_code, + isVerified: userData.is_verified, } as User; } }; \ No newline at end of file diff --git a/src/hooks/interface.ts b/src/hooks/interface.ts index b30f13e..6adaf56 100644 --- a/src/hooks/interface.ts +++ b/src/hooks/interface.ts @@ -34,6 +34,7 @@ export interface GetUserDataResponse extends Response { electric_bill_document_url: string; residence_photo_url: string; affiliation_code: string; + is_verified: boolean; }; } @@ -68,4 +69,5 @@ export interface User { electric_bill_document_url: string; residence_photo_url: string; affiliation_code: string; + isVerified: boolean; } diff --git a/src/hooks/openReg.ts b/src/hooks/openReg.ts index 9075c3a..d771046 100644 --- a/src/hooks/openReg.ts +++ b/src/hooks/openReg.ts @@ -40,8 +40,8 @@ export const openRegSchema = z.object({ return files?.size <= MAX_FILE_SIZE; }, `Max image size is 5MB.`) .refine( - (files) => ACCEPTED_IMAGE_TYPES.includes(files?.type), - "Only .jpg, .jpeg, .png and .webp formats are supported." + (files) => files?.type === "application/pdf", + "Only .PDF formats are supported." ), motivationLetter: z .any() diff --git a/src/hooks/user.ts b/src/hooks/user.ts index c7101b9..c92c72e 100644 --- a/src/hooks/user.ts +++ b/src/hooks/user.ts @@ -74,6 +74,7 @@ export const getUserData = async () => { electric_bill_document_url: userData.electric_bill_document_url, residence_photo_url: userData.residence_photo_url, affiliation_code: userData.affiliation_code, + isVerified: userData.is_verified, } as User; } }; diff --git a/src/modules/ProfilePageModule/index.tsx b/src/modules/ProfilePageModule/index.tsx index fbd7e1a..b884628 100644 --- a/src/modules/ProfilePageModule/index.tsx +++ b/src/modules/ProfilePageModule/index.tsx @@ -11,21 +11,31 @@ export const ProfilePageModule = ({ user }: { user: User }) => {
- - - - {user.fullname.charAt(0).toUpperCase()} - - +
+ + + + {user.fullname.charAt(0).toUpperCase()} + + +

+ {user.fullname} ({user.nickname}) +

+
-

Nama Lengkap

-

{user.fullname}

+

Status

+

+ {user.isVerified ? "Peserta BETIS 2025" : "Belum diterima"} +

-

Nama Panggilan

-

{user.nickname}

+

Metode Belajar

+

{user.study_method}

Email

@@ -47,7 +57,7 @@ export const ProfilePageModule = ({ user }: { user: User }) => { )}
{isRegisterPeserta && ( -
+

Nama Sekolah

{user.school_name}

@@ -56,10 +66,6 @@ export const ProfilePageModule = ({ user }: { user: User }) => {

Kelas

{user.grade}

-
-

Metode Belajar

-

{user.study_method}

-

Wakil

diff --git a/src/modules/RegistrationModule/index.tsx b/src/modules/RegistrationModule/index.tsx index 5b7343f..d29a8b0 100644 --- a/src/modules/RegistrationModule/index.tsx +++ b/src/modules/RegistrationModule/index.tsx @@ -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]" @@ -793,7 +816,11 @@ const RegistrationModule = () => { />