Skip to content

Commit 6da987d

Browse files
committed
wip
1 parent 14d7aa9 commit 6da987d

File tree

6 files changed

+264
-151
lines changed

6 files changed

+264
-151
lines changed

src/app/conf/2025/components/speaker-card.tsx

Lines changed: 6 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import { Anchor } from "../../_design-system/anchor"
77
import { Tag } from "../../_design-system/tag"
88
import { SchedSpeaker } from "../../2023/types"
99
import { StripesDecoration } from "../../_design-system/stripes-decoration"
10-
import { SocialIcon, SocialIconType } from "../../_design-system/social-icon"
1110

12-
import ReloadIcon from "@/app/conf/_design-system/pixelarticons/reload.svg?svgr"
13-
import PlayIcon from "@/app/conf/_design-system/pixelarticons/play.svg?svgr"
11+
import { SpeakerTags } from "./speaker-tags"
12+
import { SpeakerLinks } from "./speaker-links"
1413

1514
import styles from "./speaker-card.module.css"
16-
import { returningSpeakers, speakerSessions } from "../_data"
1715

1816
export interface SpeakerCardProps extends React.HTMLAttributes<HTMLDivElement> {
1917
tags?: string[]
@@ -43,7 +41,10 @@ export function SpeakerCard({
4341
>
4442
<div className="flex h-full flex-col gap-4 p-4 @[420px]:flex-row md:gap-6 md:p-6">
4543
{showSocials && (
46-
<SpeakerLinks speaker={speaker} className="absolute right-6 top-6" />
44+
<SpeakerLinks
45+
speaker={speaker}
46+
className="absolute right-6 top-6 z-[3]"
47+
/>
4748
)}
4849

4950
<div className="relative aspect-square shrink-0 overflow-hidden @[420px]:size-[176px]">
@@ -107,41 +108,6 @@ export function SpeakerCard({
107108
)
108109
}
109110

110-
function SpeakerLinks({
111-
speaker,
112-
className,
113-
}: {
114-
speaker: SchedSpeaker
115-
className?: string
116-
}) {
117-
const speakerUrls = SocialIconType.all
118-
.map(social => speaker.socialurls.find(x => x.service === social))
119-
.concat([{ service: "website", url: speaker.url || "" }])
120-
.filter((x): x is Exclude<typeof x, undefined> => !!x?.url)
121-
.slice(-3)
122-
123-
return (
124-
<div
125-
className={clsx(
126-
"z-[3] flex divide-x divide-neu-200 border border-neu-200 dark:border-neu-100",
127-
className,
128-
)}
129-
>
130-
{speakerUrls.map(social => (
131-
<a
132-
key={social.url}
133-
href={social.url}
134-
target="_blank"
135-
rel="noreferrer"
136-
className="flex items-center p-2 text-neu-900"
137-
>
138-
<SocialIcon type={social.service.toLowerCase()} className="size-5" />
139-
</a>
140-
))}
141-
</div>
142-
)
143-
}
144-
145111
function Stripes() {
146112
return (
147113
<div
@@ -155,38 +121,3 @@ function Stripes() {
155121
</div>
156122
)
157123
}
158-
159-
function SpeakerTags({
160-
speaker,
161-
className,
162-
}: {
163-
speaker: SchedSpeaker
164-
className?: string
165-
}) {
166-
const eventType = speakerSessions.get(speaker.username)?.[0]?.event_type
167-
168-
return (
169-
<div className={clsx("flex basis-0 flex-wrap gap-2", className)}>
170-
{eventType && (
171-
<Tag color={eventsColors[eventType] || "hsl(var(--color-sec-base))"}>
172-
{eventType === "Federation and Composite Schemas"
173-
? "Federation"
174-
: eventType}
175-
</Tag>
176-
)}
177-
178-
<Tag color="hsl(var(--color-neu-500))">
179-
{returningSpeakers.has(speaker.username) ? (
180-
<>
181-
<ReloadIcon className="-mx-0.5 size-3" />
182-
returning speaker
183-
</>
184-
) : (
185-
<>
186-
<PlayIcon className="-mx-1 size-3" /> first time speaker
187-
</>
188-
)}
189-
</Tag>
190-
</div>
191-
)
192-
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import clsx from "clsx"
2+
3+
import { SchedSpeaker } from "@/app/conf/2023/types"
4+
import {
5+
SocialIcon,
6+
SocialIconType,
7+
} from "@/app/conf/_design-system/social-icon"
8+
9+
export interface SpeakerLinksProps
10+
extends React.HTMLAttributes<HTMLDivElement> {
11+
speaker: SchedSpeaker
12+
size?: "lg" | "md"
13+
}
14+
15+
export function SpeakerLinks({
16+
speaker,
17+
className,
18+
size = "md",
19+
...rest
20+
}: SpeakerLinksProps) {
21+
const speakerUrls = SocialIconType.all
22+
.map(social => speaker.socialurls.find(x => x.service === social))
23+
.concat([{ service: "website", url: speaker.url || "" }])
24+
.filter((x): x is Exclude<typeof x, undefined> => !!x?.url)
25+
.slice(-3)
26+
27+
return (
28+
<div
29+
className={clsx(
30+
"flex divide-x divide-neu-200 border border-neu-200 dark:border-neu-100",
31+
className,
32+
)}
33+
{...rest}
34+
>
35+
{speakerUrls.map(social => (
36+
<a
37+
key={social.url}
38+
href={social.url}
39+
target="_blank"
40+
rel="noreferrer"
41+
className={clsx(
42+
"flex items-center text-neu-900",
43+
size === "lg" ? "p-4" : "p-2",
44+
)}
45+
>
46+
<SocialIcon
47+
type={social.service.toLowerCase()}
48+
className={size === "lg" ? "size-6" : "size-5"}
49+
/>
50+
</a>
51+
))}
52+
</div>
53+
)
54+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import clsx from "clsx"
2+
3+
import { SchedSpeaker } from "@/app/conf/2023/types"
4+
import { Tag } from "@/app/conf/_design-system/tag"
5+
import ReloadIcon from "@/app/conf/_design-system/pixelarticons/reload.svg?svgr"
6+
import PlayIcon from "@/app/conf/_design-system/pixelarticons/play.svg?svgr"
7+
8+
import { returningSpeakers, speakerSessions } from "../_data"
9+
import { eventsColors } from "../utils"
10+
11+
export function SpeakerTags({
12+
speaker,
13+
className,
14+
}: {
15+
speaker: SchedSpeaker
16+
className?: string
17+
}) {
18+
const eventType = speakerSessions.get(speaker.username)?.[0]?.event_type
19+
20+
return (
21+
<div className={clsx("flex basis-0 flex-wrap gap-2", className)}>
22+
{eventType && (
23+
<Tag color={eventsColors[eventType] || "hsl(var(--color-sec-base))"}>
24+
{eventType === "Federation and Composite Schemas"
25+
? "Federation"
26+
: eventType}
27+
</Tag>
28+
)}
29+
30+
<Tag color="hsl(var(--color-neu-500))">
31+
{returningSpeakers.has(speaker.username) ? (
32+
<>
33+
<ReloadIcon className="-mx-0.5 size-3" />
34+
returning speaker
35+
</>
36+
) : (
37+
<>
38+
<PlayIcon className="-mx-1 size-3" /> first time speaker
39+
</>
40+
)}
41+
</Tag>
42+
</div>
43+
)
44+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ScheduleSession } from "@/app/conf/2023/types"
2+
3+
export interface LongSessionCardProps
4+
extends React.HTMLAttributes<HTMLDivElement> {
5+
session: ScheduleSession
6+
}
7+
8+
export function LongSessionCard({ session, className }: LongSessionCardProps) {
9+
return <div>LongSessionCard</div>
10+
}

0 commit comments

Comments
 (0)