Skip to content

Commit

Permalink
change wording on CTA when at capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelandgraf committed Sep 23, 2024
1 parent 13581aa commit 6fcd742
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
24 changes: 8 additions & 16 deletions website/app/modules/event-details/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,7 @@ export function SponsorsSection({ sponsors }: { sponsors: Sponsor[] }) {
}

export function EventDetailsPage({ children }: { children?: React.ReactNode }) {
const {
event: eventData,
isAtCapacity,
attendeeCount,
attendeeLimit,
isInPast,
isRegistrationDisabled,
} = useLoaderData<typeof loader>();
const { event: eventData, isAtCapacity, attendeeCount, attendeeLimit, isInPast } = useLoaderData<typeof loader>();
const event = deserializeExpandedEvent(eventData);
return (
<PageLayout>
Expand All @@ -161,8 +154,8 @@ export function EventDetailsPage({ children }: { children?: React.ReactNode }) {
<AlertCircleIcon className="h-6 w-6 text-destructive pr-2" />
<AlertTitle>Registration closed</AlertTitle>
<AlertDescription>
This event is fully booked! Please check back later for any available spots or upcoming events. We
appreciate your interest!
This event is fully booked! Join the waitlist to be notified if any spots open up. We appreciate your
interest!
</AlertDescription>
</Alert>
</div>
Expand All @@ -185,15 +178,14 @@ export function EventDetailsPage({ children }: { children?: React.ReactNode }) {
<p className="max-w-[600px] text-muted-foreground md:text-xl">{event.tagline}</p>
</div>
<div className="flex flex-col gap-2 min-[400px]:flex-row">
<Link
to={event.enableRegistrations ? `/${event.slug}/register?utm_source=web` : event.lumaUrl}
disabled={event.enableRegistrations && isRegistrationDisabled}
>
<Link to={event.enableRegistrations ? `/${event.slug}/register?utm_source=web` : event.lumaUrl}>
{event.enableRegistrations
? 'Register now'
: isRegistrationDisabled
: isInPast
? 'View on Luma'
: 'Register on Luma'}
: isAtCapacity
? 'Join waitlist on Luma'
: 'Register on Luma'}
</Link>
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions website/app/modules/event-details/loader.sever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ export async function eventDetailsLoader(slug: string) {
: await getLumaAttendeeCount(event.lumaEventId);
const isAtCapacity = attendeeCount >= event.attendeeLimit;
const isInPast = isEventInPast(event);
const isRegistrationDisabled = isAtCapacity || isInPast;
return {
event,
attendeeCount,
attendeeLimit: event.attendeeLimit,
isAtCapacity,
isInPast,
isRegistrationDisabled,
};
}

Expand Down

0 comments on commit 6fcd742

Please sign in to comment.