Skip to content

Commit

Permalink
fix: keep application form closed until apps open
Browse files Browse the repository at this point in the history
  • Loading branch information
waalbert committed Nov 25, 2024
1 parent 607045b commit f3a671d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/site/src/app/(main)/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -36,6 +37,7 @@ export default async function Apply({
}

const deadlinePassed = hasDeadlinePassed();
const applicationsOpened = haveApplicationsOpened();

const applyBody = hasAcceptedQueryParam ? (
<>
Expand Down Expand Up @@ -73,7 +75,11 @@ export default async function Apply({
);
return (
<div className="flex flex-col items-center gap-10 my-32 min-h-[calc(100vh-8rem)]">
{deadlinePassed ? <ApplicationsClosed /> : applyBody}
{!applicationsOpened || deadlinePassed ? (
<ApplicationsClosed />
) : (
applyBody
)}
</div>
);
}

0 comments on commit f3a671d

Please sign in to comment.