1
1
import { Metadata } from "next"
2
- import { notFound } from "next/navigation"
3
2
import React from "react"
4
3
5
- import { speakers , speakerSessions } from "../../_data"
4
+ import { previousEditionSessions , speakers , speakerSessions } from "../../_data"
6
5
import { metadata as layoutMetadata } from "../../layout"
7
6
8
7
import { HERO_MARQUEE_ITEMS } from "../../utils"
9
8
import { BackLink } from "../../schedule/_components/back-link"
10
9
import { NavbarPlaceholder } from "../../components/navbar"
11
10
import { CtaCardSection } from "../../components/cta-card-section"
12
11
import clsx from "clsx"
13
- import { SchedSpeaker } from "@/app/conf/2023/types"
12
+ import { SchedSpeaker , ScheduleSession } from "@/app/conf/2023/types"
14
13
import { Button } from "@/app/conf/_design-system/button"
15
14
import { MarqueeRows } from "../../components/marquee-rows"
16
15
import { GET_TICKETS_LINK } from "../../links"
@@ -55,6 +54,9 @@ export default function SpeakerPage({ params }: SpeakerProps) {
55
54
throw new Error ( `Speaker "${ params . id } " not found for details page` )
56
55
}
57
56
57
+ const currentYearSessions = speakerSessions . get ( speaker . username ) || [ ]
58
+ const previousSessions = previousEditionSessions . get ( speaker . username ) || [ ]
59
+
58
60
return (
59
61
< >
60
62
< NavbarPlaceholder className = "top-0 bg-neu-50 before:bg-neu-50/40 dark:bg-neu-0 dark:before:bg-blk/30" />
@@ -81,19 +83,31 @@ export default function SpeakerPage({ params }: SpeakerProps) {
81
83
{ formatDescription ( speaker . about ) }
82
84
</ p >
83
85
84
- < Hr />
85
-
86
- < h3 className = "typography-h2 my-8 px-2 sm:px-3 lg:my-16" >
87
- 2025 Sessions
88
- </ h3 >
89
- < SpeakerSessions speaker = { speaker } className = "-mx-px -mb-px" />
90
-
91
- < Hr />
92
-
93
- < h3 className = "typography-h2 my-8 px-2 sm:px-3 lg:my-16" >
94
- Sessions from previous editions
95
- </ h3 >
96
- < SpeakerSessions speaker = { speaker } className = "-mx-px -mb-px" />
86
+ { currentYearSessions . length > 0 && (
87
+ < >
88
+ < Hr />
89
+ < h3 className = "typography-h2 my-8 px-2 sm:px-3 lg:my-16" >
90
+ 2025 Sessions
91
+ </ h3 >
92
+ < SpeakerSessions
93
+ sessions = { currentYearSessions }
94
+ className = "-mx-px -mb-px"
95
+ />
96
+ </ >
97
+ ) }
98
+
99
+ { previousSessions . length > 0 && (
100
+ < >
101
+ < Hr />
102
+ < h3 className = "typography-h2 my-8 px-2 sm:px-3 lg:my-16" >
103
+ Sessions from previous editions
104
+ </ h3 >
105
+ < SpeakerSessions
106
+ sessions = { previousSessions }
107
+ className = "-mx-px -mb-px"
108
+ />
109
+ </ >
110
+ ) }
97
111
</ div >
98
112
</ div >
99
113
</ div >
@@ -157,7 +171,7 @@ function SpeakerHeader({
157
171
alt = ""
158
172
width = { 464 }
159
173
height = { 464 }
160
- className = "aspect-square size-[464px] w-full object-cover saturate-[0.1] transition-transform"
174
+ className = "aspect-square size-[464px] object-cover saturate-[0.1] transition-transform max-lg:w-full "
161
175
/>
162
176
</ div >
163
177
) }
@@ -166,10 +180,10 @@ function SpeakerHeader({
166
180
}
167
181
168
182
function SpeakerSessions ( {
169
- speaker ,
183
+ sessions ,
170
184
className,
171
185
} : {
172
- speaker : SchedSpeaker
186
+ sessions : ScheduleSession [ ]
173
187
className ?: string
174
188
} ) {
175
189
return (
@@ -179,11 +193,9 @@ function SpeakerSessions({
179
193
className ,
180
194
) }
181
195
>
182
- { speakerSessions
183
- . get ( speaker . username )
184
- ?. map ( session => (
185
- < LongSessionCard key = { session . id } session = { session } year = "2025" />
186
- ) ) }
196
+ { sessions . map ( session => (
197
+ < LongSessionCard key = { session . id } session = { session } year = "2025" />
198
+ ) ) }
187
199
</ div >
188
200
)
189
201
}
0 commit comments