Skip to content

Commit

Permalink
feat: add RSVP message to portal
Browse files Browse the repository at this point in the history
  • Loading branch information
njhuey committed Jan 17, 2024
1 parent 25ababf commit 283ae55
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { redirect } from "next/navigation";

import getUserIdentity from "@/lib/utils/getUserIdentity";

import ConfirmAttendance from "./ConfirmAttendance";
import Message from "./Message";
import VerticalTimeline from "./VerticalTimeline";
import SignWaiver from "./SignWaiver";
Expand Down Expand Up @@ -35,6 +36,7 @@ async function Portal() {
<VerticalTimeline status={status as PortalStatus} />
<Message status={status as PortalStatus} />
{isAccepted && <SignWaiver status={status as PortalStatus} />}
{isAccepted && <ConfirmAttendance status={status} />}
</div>
);
}
Expand Down
36 changes: 36 additions & 0 deletions apps/site/src/app/(main)/portal/@applicant/ConfirmAttendance.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { PortalStatus } from "./ApplicantPortal";
import Button from "@/lib/components/Button/Button";

interface ConfirmAttendanceProps {
status: string;
}

function ConfirmAttendance({ status }: ConfirmAttendanceProps) {
const buttonText =
status === PortalStatus.confirmed
? "I am no longer able to attend Hack at UCI 2023"
: "I will be attending Hack at UCI 2023";

return (
<div className="mt-4">
<hr />
<h3 className="text-3xl my-4">RSVP</h3>
{status === PortalStatus.confirmed ? (
<p>
Thank you for confirming your attendance. We look forward to seeing
you at the event!
</p>
) : (
<p>
If you plan on attending IrvineHacks 2024, please confirm your
attendance below!
</p>
)}
<form method="post" action="/api/user/rsvp">
<Button className="text-color-red" text={buttonText} />
</form>
</div>
);
}

export default ConfirmAttendance;
7 changes: 6 additions & 1 deletion apps/site/src/app/(main)/portal/@applicant/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ function Message({ status }: MessageProps) {
event!
</>
),
[PortalStatus.confirmed]: <></>,
[PortalStatus.confirmed]: (
<p>
Thank you for confirming your attendance! We look forward to seeing you
at IrvineHacks!
</p>
),
};

return <div>{messages[status]}</div>;
Expand Down
3 changes: 2 additions & 1 deletion apps/site/src/app/(main)/portal/@applicant/SignWaiver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function SignWaiver({ status }: SignWaiverProps) {
return status === PortalStatus.waived ? null : (
<div>
<hr />
<p>
<h3 className="text-3xl my-4">Waiver</h3>
<p className="mt-4">
In order to attend IrvineHacks 2024, please fill out the waiver below
</p>
<Button
Expand Down

0 comments on commit 283ae55

Please sign in to comment.