Skip to content

Commit 3077ca6

Browse files
committed
Fix attendancing registration bug
1 parent d249646 commit 3077ca6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/web/src/app/events/components/AttendanceCard/RegistrationButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Attendance, AttendancePool, Attendee } from "@dotkomonline/types"
1+
import type { Attendance, AttendancePool, AttendanceStatus, Attendee } from "@dotkomonline/types"
22
import { Button, Icon, Text, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@dotkomonline/ui"
33
import clsx from "clsx"
44
import type { FC } from "react"
@@ -16,15 +16,15 @@ const getButtonColor = (disabled: boolean, attendee: boolean, isPoolFull: boolea
1616
}
1717
}
1818

19-
const getDisabledText = (status: string, attendee: boolean, pool: boolean, isPastDeregisterDeadline: boolean) => {
19+
const getDisabledText = (status: AttendanceStatus, attendee: boolean, pool: boolean, isPastDeregisterDeadline: boolean) => {
2020
switch (true) {
2121
case status === "NotOpened":
2222
return "Påmeldinger har ikke åpnet"
2323
case status === "Closed" && !attendee:
2424
return "Påmeldingen er stengt"
2525
case !pool && !attendee:
2626
return "Du har ingen påmeldingsgruppe"
27-
case isPastDeregisterDeadline && !attendee:
27+
case status === "Closed" && isPastDeregisterDeadline && !attendee:
2828
return "Avmeldingsfristen har utløpt"
2929
default:
3030
return null
@@ -38,7 +38,7 @@ interface Props {
3838
unregisterForAttendance: () => void
3939
pool: AttendancePool | undefined | null
4040
isLoading: boolean
41-
status: "NotOpened" | "Open" | "Closed" | "Full"
41+
status: AttendanceStatus
4242
}
4343

4444
export const RegistrationButton: FC<Props> = ({

0 commit comments

Comments
 (0)