File tree Expand file tree Collapse file tree 5 files changed +22
-14
lines changed Expand file tree Collapse file tree 5 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
import { SessionList } from "@/app/conf/_components/schedule/session-list"
3
3
import { schedule , speakers } from "@/app/conf/2023/_data"
4
+ import { eventsColors } from '../utils'
5
+ import { filterCategories2023 } from '../../_components/schedule/filter-categories'
4
6
5
7
export const metadata : Metadata = {
6
8
title : "Sessions" ,
@@ -11,6 +13,9 @@ export default function SessionsPage() {
11
13
< div className = "bg-[#f4f6f8]" >
12
14
< div className = "container conf-block" >
13
15
< SessionList
16
+ year = '2023'
17
+ eventsColors = { eventsColors }
18
+ filterCategories = { filterCategories2023 }
14
19
// @ts -expect-error -- fixme
15
20
scheduleData = { schedule
16
21
. filter ( schedule => schedule . speakers )
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { speakers, schedule } from "@/app/conf/2023/_data"
12
12
import { ChevronLeftIcon } from "@/icons"
13
13
import NextLink from "next/link"
14
14
import { eventsColors } from "../../utils"
15
+ import { filterCategories2023 } from '@/app/conf/_components/schedule/filter-categories'
15
16
16
17
type SpeakerProps = { params : { id : string } }
17
18
@@ -47,7 +48,7 @@ export default function SpeakerPage({ params }: SpeakerProps) {
47
48
. map ( s => ( {
48
49
...s ,
49
50
speakers : s . speakers ! . map ( s =>
50
- speakers . find ( speaker => speaker . username === s . username ) ,
51
+ speakers . find ( speaker => speaker . username === s . username ) ! ,
51
52
) ,
52
53
} ) )
53
54
@@ -105,8 +106,8 @@ export default function SpeakerPage({ params }: SpeakerProps) {
105
106
/>
106
107
</ div >
107
108
< h1 className = "conf-heading mb-10" > Sessions</ h1 >
108
- { /* @ts -expect-error */ }
109
109
< SessionList
110
+ filterCategories = { filterCategories2023 }
110
111
eventsColors = { eventsColors }
111
112
year = "2023"
112
113
showFilter = { false }
Original file line number Diff line number Diff line change 1
1
import { notFound } from "next/navigation"
2
2
import { Metadata } from "next"
3
- import { findBestMatch } from "string-similarity"
4
3
import clsx from "clsx"
5
4
import { Avatar } from "../../../_components/speakers/avatar"
6
5
import { BackLink } from "../../../_components/schedule/back-link"
@@ -37,12 +36,11 @@ type SessionProps = { params: { id: string } }
37
36
export function generateMetadata ( { params } : SessionProps ) : Metadata {
38
37
const event = schedule . find ( s => s . id === params . id ) !
39
38
40
- console . log ( "EVENTTT" , event )
41
39
const keywords = [
42
40
event . event_type ,
43
41
event . audience ,
44
42
event . event_subtype ,
45
- ...event . speakers ! . map ( s => s . name ) ,
43
+ ...( event . speakers || [ ] ) . map ( s => s . name ) ,
46
44
] . filter ( Boolean )
47
45
48
46
return {
@@ -56,7 +54,7 @@ export function generateMetadata({ params }: SessionProps): Metadata {
56
54
}
57
55
58
56
export function generateStaticParams ( ) {
59
- return schedule . filter ( s => s . speakers ) . map ( s => ( { id : s . id } ) )
57
+ return schedule . filter ( s => s . id ) . map ( s => ( { id : s . id } ) )
60
58
}
61
59
62
60
const Tag = ( {
@@ -83,7 +81,7 @@ export default function SessionPage({ params }: SessionProps) {
83
81
notFound ( )
84
82
}
85
83
// @ts -expect-error -- fixme
86
- event . speakers = event . speakers ! . map ( speaker =>
84
+ event . speakers = ( event . speakers || [ ] ) . map ( speaker =>
87
85
speakers . find ( s => s . username === speaker . username ) ,
88
86
)
89
87
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ import { filterCategories2024 } from '@/app/conf/_components/schedule/filter-cat
17
17
type SpeakerProps = { params : { id : string } }
18
18
19
19
export function generateMetadata ( { params } : SpeakerProps ) : Metadata {
20
- const speaker = speakers . find ( s => s . username === params . id ) !
20
+ const decodedId = decodeURIComponent ( params . id ) ;
21
+ const speaker = speakers . find ( s => s . username === decodedId ) !
21
22
22
23
const keywords = [ speaker . name , speaker . company , speaker . position ] . filter (
23
24
Boolean ,
@@ -34,17 +35,15 @@ export function generateMetadata({ params }: SpeakerProps): Metadata {
34
35
}
35
36
36
37
export function generateStaticParams ( ) {
37
- return speakers . map ( s => ( { id : s . username } ) )
38
+ return speakers . map ( s => ( { id : s . username } ) ) ;
38
39
}
39
40
40
41
export default function SpeakerPage ( { params } : SpeakerProps ) {
41
- const speaker = speakers . find ( s => s . username === params . id )
42
- if ( ! speaker ) {
43
- notFound ( )
44
- }
42
+ const decodedId = decodeURIComponent ( params . id ) ;
43
+ const speaker = speakers . find ( s => s . username === decodedId ) !
45
44
46
45
const s = schedule
47
- . filter ( s => s . speakers && s . speakers . some ( s => s . username === params . id ) )
46
+ . filter ( s => s . speakers && s . speakers . some ( s => s . username === decodedId ) )
48
47
. map ( s => ( {
49
48
...s ,
50
49
speakers : s . speakers ! . map ( s =>
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { SessionList } from "./schedule/session-list"
3
3
import { Button } from "./button"
4
4
import leeImage from "../2023/gallery/images/3.jpg"
5
5
import { schedule , speakers } from "@/app/conf/2023/_data"
6
+ import { eventsColors } from '../2023/utils'
7
+ import { filterCategories2023 } from './schedule/filter-categories'
6
8
7
9
function shuffle < T extends any [ ] > ( array : T ) : T {
8
10
let currentIndex = array . length
@@ -53,6 +55,9 @@ export async function Thanks() {
53
55
</ div >
54
56
</ div >
55
57
< SessionList
58
+ year = '2023'
59
+ filterCategories = { filterCategories2023 }
60
+ eventsColors = { eventsColors }
56
61
showFilter = { false }
57
62
// @ts -expect-error -- fixme
58
63
scheduleData = { shuffle ( filteredSessions )
You can’t perform that action at this time.
0 commit comments