From 4de275e05418390f7b7e698e49b0d2ad6d2e2b9d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 18 May 2023 18:56:43 +0300 Subject: [PATCH] Prompt to join Pool after check-in --- app/features/tournament-bracket/index.ts | 1 + .../tournament/routes/to.$id.register.tsx | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 app/features/tournament-bracket/index.ts diff --git a/app/features/tournament-bracket/index.ts b/app/features/tournament-bracket/index.ts new file mode 100644 index 000000000..c362d7f1b --- /dev/null +++ b/app/features/tournament-bracket/index.ts @@ -0,0 +1 @@ +export { HACKY_resolvePoolCode } from "./tournament-bracket-utils"; diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx index 08a581546..917024205 100644 --- a/app/features/tournament/routes/to.$id.register.tsx +++ b/app/features/tournament/routes/to.$id.register.tsx @@ -81,6 +81,7 @@ import { import type { TournamentLoaderData } from "./to.$id"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { deleteTeam } from "../queries/deleteTeam.server"; +import { HACKY_resolvePoolCode } from "~/features/tournament-bracket"; export const handle: SendouRouteHandle = { breadcrumb: () => ({ @@ -413,16 +414,13 @@ function RegistrationProgress({ ); })} - {!checkedIn ? ( - !step.completed).length === 1} - status={ - checkInIsOpen ? "OPEN" : checkInIsOver ? "OVER" : "UPCOMING" - } - startDate={checkInStartsDate} - endDate={checkInEndsDate} - /> - ) : null} + !step.completed).length === 1} + status={checkInIsOpen ? "OPEN" : checkInIsOver ? "OVER" : "UPCOMING"} + startDate={checkInStartsDate} + endDate={checkInEndsDate} + checkedIn={checkedIn} + />
Free editing of any information before the tournament starts allowed. @@ -436,12 +434,15 @@ function CheckIn({ canCheckIn, startDate, endDate, + checkedIn, }: { status: "OVER" | "OPEN" | "UPCOMING"; canCheckIn: boolean; startDate: Date; endDate: Date; + checkedIn?: boolean; }) { + const data = useOutletContext(); const { i18n } = useTranslation(); const isMounted = useIsMounted(); const fetcher = useFetcher(); @@ -478,6 +479,15 @@ function CheckIn({ return
Check-in is over
; } + if (checkedIn) { + return ( +
+ Your team is checked in. Please join the Pool{" "} + {HACKY_resolvePoolCode(data.event)} +
+ ); + } + return (