From 9675a1c4913f400532fe57fc008a480d6addc9fe Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Sun, 13 Oct 2024 21:57:12 +0700 Subject: [PATCH] Refactor Apply page component to adjust left margin for company information section and simplify pitchDeckSchema validation --- src/app/business/apply/page.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index f423147..3faf2f2 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -41,12 +41,14 @@ export default function Apply() { }), projectPitchDeck: pitchDeckSchema, projectLogo: z - .any() - .refine((file) => file?.size <= MAX_FILE_SIZE, `Max image size is 5MB.`) - .refine( - (file) => ACCEPTED_IMAGE_TYPES.includes(file?.type), - "Only .jpg, .jpeg, and .png formats are supported." - ), + .instanceof(File) + .refine((file) => ACCEPTED_IMAGE_TYPES.includes(file.type), { + message: "Only .jpg, .jpeg, and .png formats are supported.", + }) + .refine((file) => file.size <= MAX_FILE_SIZE, { + message: "Max image size is 5MB.", + }), + projectPhotos: z .array( z.object({