Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: prevent sign waiver from showing when user is confirmed and properly update vertical timeline #254

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ async function Portal() {
const submittedWaiver =
status === PortalStatus.waived || status === PortalStatus.confirmed;

const isAccepted = status === PortalStatus.accepted || submittedWaiver;
const isAccepted = status === PortalStatus.accepted;

return (
<div className="bg-white text-black max-w-4xl rounded-2xl p-6 flex flex-col mb-24 w-full">
<h2 className="text-4xl font-semibold">Status</h2>
<VerticalTimeline status={status as PortalStatus} />
<Message status={status as PortalStatus} />
{isAccepted && <SignWaiver status={status as PortalStatus} />}
{isAccepted && !submittedWaiver && <SignWaiver />}
{submittedWaiver && <ConfirmAttendance status={status} />}
</div>
);
Expand Down
10 changes: 2 additions & 8 deletions apps/site/src/app/(main)/portal/@applicant/SignWaiver.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import Button from "@/lib/components/Button/Button";

import { PortalStatus } from "./ApplicantPortal";

interface SignWaiverProps {
status: PortalStatus;
}

function SignWaiver({ status }: SignWaiverProps) {
return status === PortalStatus.waived ? null : (
function SignWaiver() {
return (
<div>
<hr />
<h3 className="text-3xl my-4">Waiver</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function VerticalTimeline({ status }: VerticalTimelineProps) {
) : null;

const rsvp_component =
status === PortalStatus.accepted || PortalStatus.waived ? (
status === PortalStatus.accepted || status === PortalStatus.waived ? (
<li className="flex flex-row items-center border-t">
<Image
src={BorderCircle}
Expand Down