@@ -7,13 +7,11 @@ import { Anchor } from "../../_design-system/anchor"
7
7
import { Tag } from "../../_design-system/tag"
8
8
import { SchedSpeaker } from "../../2023/types"
9
9
import { StripesDecoration } from "../../_design-system/stripes-decoration"
10
- import { SocialIcon , SocialIconType } from "../../_design-system/social-icon"
11
10
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 "
14
13
15
14
import styles from "./speaker-card.module.css"
16
- import { returningSpeakers , speakerSessions } from "../_data"
17
15
18
16
export interface SpeakerCardProps extends React . HTMLAttributes < HTMLDivElement > {
19
17
tags ?: string [ ]
@@ -43,7 +41,10 @@ export function SpeakerCard({
43
41
>
44
42
< div className = "flex h-full flex-col gap-4 p-4 @[420px]:flex-row md:gap-6 md:p-6" >
45
43
{ 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
+ />
47
48
) }
48
49
49
50
< div className = "relative aspect-square shrink-0 overflow-hidden @[420px]:size-[176px]" >
@@ -107,41 +108,6 @@ export function SpeakerCard({
107
108
)
108
109
}
109
110
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
-
145
111
function Stripes ( ) {
146
112
return (
147
113
< div
@@ -155,38 +121,3 @@ function Stripes() {
155
121
</ div >
156
122
)
157
123
}
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
- }
0 commit comments