@@ -10,6 +10,7 @@ import { StripesDecoration } from "../../_design-system/stripes-decoration"
10
10
import { SocialIcon , SocialIconType } from "../../_design-system/social-icon"
11
11
12
12
import styles from "./speaker-card.module.css"
13
+ import { returningSpeakers , speakerSessions } from "../_data"
13
14
14
15
export interface SpeakerCardProps extends React . HTMLAttributes < HTMLDivElement > {
15
16
tags ?: string [ ]
@@ -42,7 +43,7 @@ export function SpeakerCard({
42
43
< SpeakerLinks speaker = { speaker } className = "absolute right-6 top-6" />
43
44
) }
44
45
45
- < div className = "relative aspect-square shrink-0 overflow-hidden @[420px]:basis -[176px]" >
46
+ < div className = "relative aspect-square shrink-0 overflow-hidden @[420px]:size -[176px]" >
46
47
< div className = "absolute inset-0 z-[1] bg-sec-light mix-blend-multiply" />
47
48
{ speaker . avatar ? (
48
49
< Image
@@ -67,14 +68,15 @@ export function SpeakerCard({
67
68
< div className = "flex flex-1 flex-col gap-2" >
68
69
< div className = "flex flex-col gap-1" >
69
70
< h3 className = "typography-body-lg" > { speaker . name } </ h3 >
70
- < p className = "text-neu-800 typography-body-sm" >
71
+ < p className = "line-clamp-1 text-neu-800 typography-body-sm" >
71
72
{ [
72
73
speaker . position ,
73
74
speaker . company === "-" ? "" : speaker . company ,
74
75
]
75
76
. filter ( Boolean )
76
77
. join ( ", " ) }
77
78
</ p >
79
+ < SpeakerTags speaker = { speaker } className = "my-3" />
78
80
</ div >
79
81
{ speaker . about && (
80
82
< p className = "line-clamp-3 text-neu-800 typography-body-sm" >
@@ -150,3 +152,26 @@ function Stripes() {
150
152
</ div >
151
153
)
152
154
}
155
+
156
+ function SpeakerTags ( {
157
+ speaker,
158
+ className,
159
+ } : {
160
+ speaker : SchedSpeaker
161
+ className ?: string
162
+ } ) {
163
+ const eventType = speakerSessions . get ( speaker . username ) ?. [ 0 ] ?. event_type
164
+
165
+ return (
166
+ < div className = { clsx ( "flex basis-0 flex-wrap gap-2" , className ) } >
167
+ { eventType && (
168
+ < Tag color = { eventsColors [ eventType ] || "hsl(var(--color-sec-base))" } >
169
+ { eventType }
170
+ </ Tag >
171
+ ) }
172
+ { returningSpeakers . has ( speaker . name ) && (
173
+ < Tag color = "hsl(var(--color-neu-500))" > Returning speaker</ Tag >
174
+ ) }
175
+ </ div >
176
+ )
177
+ }
0 commit comments