From f3a671d3c5658a7aec64056df6854d0882003bcf Mon Sep 17 00:00:00 2001 From: Albert Wang Date: Sun, 24 Nov 2024 16:32:17 -0800 Subject: [PATCH] fix: keep application form closed until apps open --- apps/site/src/app/(main)/apply/page.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/site/src/app/(main)/apply/page.tsx b/apps/site/src/app/(main)/apply/page.tsx index f556cc31..5e990f0a 100644 --- a/apps/site/src/app/(main)/apply/page.tsx +++ b/apps/site/src/app/(main)/apply/page.tsx @@ -2,6 +2,7 @@ import Image from "next/image"; import { redirect } from "next/navigation"; import hasDeadlinePassed from "@/lib/utils/hasDeadlinePassed"; +import haveApplicationsOpened from "@/lib/utils/haveApplicationsOpened"; import ApplyConfirm from "./sections/ApplyConfirmation/ApplyConfirm"; import Form from "./sections/Form/Form"; @@ -36,6 +37,7 @@ export default async function Apply({ } const deadlinePassed = hasDeadlinePassed(); + const applicationsOpened = haveApplicationsOpened(); const applyBody = hasAcceptedQueryParam ? ( <> @@ -73,7 +75,11 @@ export default async function Apply({ ); return (
- {deadlinePassed ? : applyBody} + {!applicationsOpened || deadlinePassed ? ( + + ) : ( + applyBody + )}
); }