Skip to content

Commit 9e81f4c

Browse files
committed
Add GetYourTicket section
1 parent 8b49b8e commit 9e81f4c

File tree

4 files changed

+123
-1
lines changed

4 files changed

+123
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { clsx } from "clsx"
2+
import { TicketPeriods } from "./ticket-periods"
3+
4+
export function GetYourTicket({ className }: { className?: string }) {
5+
return (
6+
<section
7+
className={clsx(
8+
"dark relative overflow-hidden bg-pri-dark px-4 py-8",
9+
className,
10+
)}
11+
>
12+
<div className="gql-conf-container lg:px-12 xl:gap-x-24 xl:px-24">
13+
<header className="flex flex-wrap justify-between gap-6 md:items-end">
14+
<h2 className="whitespace-pre text-white typography-h2">
15+
Get your ticket now
16+
</h2>
17+
<p className="text-neu-800 typography-body-md">
18+
The registration deadline is 23:59 Central European Time on the
19+
respective date.
20+
</p>
21+
</header>
22+
23+
<div className="mt-6 grid gap-px md:mt-10 md:grid-cols-3">
24+
<TicketPeriods />
25+
</div>
26+
</div>
27+
</section>
28+
)
29+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Button } from "@/app/conf/_design-system/button"
2+
import { clsx } from "clsx"
3+
4+
export interface TicketPeriodProps {
5+
price: string
6+
date: string
7+
disabled?: boolean
8+
name: string
9+
}
10+
11+
export function TicketPeriod({
12+
price,
13+
date,
14+
disabled,
15+
name,
16+
}: TicketPeriodProps) {
17+
return (
18+
<article
19+
className={clsx(
20+
"flex flex-col backdrop-blur-md [container-type:inline-size]",
21+
!disabled
22+
? "border border-pink-200 bg-pri-dark/[0.24]"
23+
: "border-r border-pink-200/50 bg-white/[0.12] last:border-r-0",
24+
)}
25+
>
26+
<header className="p-6">
27+
<h3 className="text-white typography-h3">{name}</h3>
28+
</header>
29+
<div className="flex flex-col gap-6 p-6 pt-0">
30+
<div className="flex items-end justify-between gap-2">
31+
<span className="text-white typography-h2">{price}</span>
32+
<span className="text-white typography-body-md">{date}</span>
33+
</div>
34+
<Button variant="primary" disabled={disabled} className="w-full">
35+
Get a ticket
36+
</Button>
37+
</div>
38+
</article>
39+
)
40+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"use client"
2+
3+
import { useState } from "react"
4+
import { useEffect } from "react"
5+
import { TicketPeriod } from "./ticket-period"
6+
import { useSyncExternalStore } from "react"
7+
8+
// The registration deadline is 23:59 Central European Time on the respective date.
9+
// Ticket period end dates (using zero-indexed months)
10+
const EARLY_BIRD_END_DATE = new Date(2025, 6, 13, 23, 59) // July 13th
11+
const STANDARD_END_DATE = new Date(2025, 7, 31, 23, 59) // August 31st
12+
const LATE_END_DATE = new Date(2025, 8, 10, 23, 59) // September 10th
13+
14+
export function TicketPeriods() {
15+
const now = useCurrentDate()
16+
17+
return (
18+
<>
19+
<TicketPeriod
20+
name="Early Bird"
21+
price="$599"
22+
date="Through 13 July"
23+
disabled={now > EARLY_BIRD_END_DATE}
24+
/>
25+
<TicketPeriod
26+
name="Standard"
27+
price="$799"
28+
date="14 July - 31 August"
29+
disabled={now > STANDARD_END_DATE || now < EARLY_BIRD_END_DATE}
30+
/>
31+
<TicketPeriod
32+
name="Late"
33+
price="$899"
34+
date="1 September - 10 September"
35+
disabled={now > LATE_END_DATE || now < STANDARD_END_DATE}
36+
/>
37+
</>
38+
)
39+
}
40+
41+
const DEFAULT_DATE = new Date(2025, 8, 12)
42+
43+
function useCurrentDate() {
44+
const [date, setDate] = useState<Date>(DEFAULT_DATE)
45+
46+
useEffect(() => {
47+
setDate(new Date())
48+
}, [])
49+
50+
return date
51+
}

src/app/conf/2025/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { RegisterToday } from "./components/register-today"
1111
import { Hero } from "./components/hero"
1212
import WhatToExpectSection from "./components/what-to-expect"
1313
import TopMindsSection from "./components/top-minds"
14-
14+
import { GetYourTicket } from "./components/get-your-ticket"
1515
export const metadata: Metadata = {
1616
title: "GraphQLConf 2025 — Sept 08-10",
1717
}
@@ -25,6 +25,8 @@ export default function Page() {
2525
<WhatToExpectSection className="md:mb-8 md:mt-24" />
2626
<TopMindsSection className="md:mb-8 md:mt-24" hasSpeakersPage={false} />
2727
</div>
28+
<GetYourTicket />
29+
2830
<div className="container my-20 flex flex-col gap-20 md:my-32 md:gap-32 [.light_&_.text-white]:text-neu-900 [.light_&_[alt='Grafbase_logo']]:invert">
2931
<Sponsors />
3032
<Sponsor />

0 commit comments

Comments
 (0)