Skip to content

Commit

Permalink
Setup/application preface (#110)
Browse files Browse the repository at this point in the history
Preface is shown before actual application.

Clicking button will add query parameter /apply?prefaceAccepted=true which will allow the application component to render

Advertises mentor and volunteer forms at bottom
  • Loading branch information
IanWearsHat authored Dec 18, 2023
1 parent 9b5b2bc commit 900ce6e
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 30 deletions.
76 changes: 46 additions & 30 deletions apps/site/src/app/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,60 @@ import Image from "next/image";
import koiLeft from "@/assets/images/koi-swim-left.png";
import koiRight from "@/assets/images/koi-swim-right.png";

import ApplyConfirm from "./sections/ApplyConfirmation/ApplyConfirm";
import Form from "./sections/Form/Form";
import Title from "./sections/Title/Title";

import styles from "./Apply.module.scss";

export const revalidate = 60;

export default function Apply() {
export default function Apply({
searchParams,
}: {
searchParams?: {
prefaceAccepted?: string;
};
}) {
const applyBody =
searchParams !== undefined &&
searchParams?.prefaceAccepted === "true" ? (
<>
<Title />
<div className="relative w-full flex flex-col items-center">
<Image
src={koiLeft}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-0 right-0`}
/>
<Image
src={koiRight}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-1/4 left-0`}
/>
<Image
src={koiLeft}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-1/2 right-0`}
/>
<Image
src={koiRight}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-3/4 left-0`}
/>
<Form />
</div>
</>
) : (
<ApplyConfirm />
);
return (
<div className="flex flex-col items-center gap-10 my-32">
<Title />
<div className="relative w-full flex flex-col items-center">
<Image
src={koiLeft}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-0 right-0`}
/>
<Image
src={koiRight}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-1/4 left-0`}
/>
<Image
src={koiLeft}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-1/2 right-0`}
/>
<Image
src={koiRight}
height="250"
alt="Koi fish"
className={`${styles.image} absolute top-3/4 left-0`}
/>
<Form />
</div>
<div className="flex flex-col items-center gap-10 my-32 min-h-[calc(100vh-8rem)]">
{applyBody}
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import getUserIdentity from "@/lib/utils/getUserIdentity";
import ConfirmationDetails from "./ConfirmationDetails";

export default async function ApplyConfirm() {
const identity = await getUserIdentity();
return (
<div className="flex flex-col items-center gap-10">
<ConfirmationDetails isLoggedIn={identity.uid !== null} />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.header {
color: var(--color-brown);
}

.details {
background-color: #ffffff;
border-radius: 10px;

& > p {
color: #432810;
}
}

.policy {
color: var(--color-brown);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Button from "@/lib/components/Button/Button";
import styles from "./ConfirmationDetails.module.scss";
import Link from "next/link";

interface ConfirmationDetailsProps {
isLoggedIn: boolean;
}

export default async function ConfirmationDetails({
isLoggedIn,
}: ConfirmationDetailsProps) {
return (
<div
className={`${styles.details} w-8/12 flex flex-col items-center p-12 gap-10 z-1 max-[800px]:w-9/12 max-[400px]:w-11/12`}
>
<h1 className={`${styles.header} text-5xl`}>Before Applying</h1>
<p className={`${styles.policy} text-lg`}>
By submitting an application for IrvineHacks 2024, I understand
that IrvineHacks will take place in person during the day from
January 26 to 28, and that IrvineHacks will not be providing
transportation or overnight accommodations. In addition, I
understand that I must check in at certain times on all three
event days in order to be eligible to win prizes. Lastly, I
acknowledge that I am currently a student enrolled in an
accredited high school, college, or university in the United
States and will be over the age of 18 by January 26th, 2024.
</p>
<strong className="text-lg text-[#FF2222]">
Applications are due on January 14th, 2024 at 11:59PM PST.
</strong>
<Button
text={isLoggedIn ? "Proceed to Application" : "Log in to Apply"}
href={isLoggedIn ? "/apply?prefaceAccepted=true" : "/login"}
/>
<hr className="mt-5 w-full h-0.5 bg-[#432810]" />
<p className="text-display">
Interested in helping out instead? Consider applying to be a{" "}
<Link className="underline" href="/mentor">
mentor
</Link>{" "}
or a{" "}
<Link className="underline" href="/volunteer">
volunteer
</Link>
.
</p>
</div>
);
}

0 comments on commit 900ce6e

Please sign in to comment.