Skip to content

Commit f7730a2

Browse files
committed
fix: prevent unregistered users from joining workshop
1 parent db48201 commit f7730a2

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/app/(app)/workshop/[workshopId]/_components/workshop-button.tsx

+14-6
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ export function WorkshopButton({
5454
)
5555
}
5656

57+
if (hasWorkshopStarted && isUserRegistered) {
58+
return (
59+
<Link
60+
className={cn(buttonVariants({ size: "sm" }))}
61+
href={`/session/${workshopId}`}
62+
>
63+
Join
64+
</Link>
65+
)
66+
}
67+
5768
return (
58-
<Link
59-
className={cn(buttonVariants({ size: "sm" }))}
60-
href={`/session/${workshopId}`}
61-
>
62-
Join
63-
</Link>
69+
<Button size="sm" disabled>
70+
Closed
71+
</Button>
6472
)
6573
}

0 commit comments

Comments
 (0)