Skip to content

Commit 1e81e97

Browse files
committed
fix: speakers
1 parent 42f27db commit 1e81e97

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/pages/session/[id].astro

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
11
---
2+
import dayjs from "dayjs";
3+
import utc from 'dayjs/plugin/utc'
4+
import timezone from 'dayjs/plugin/timezone'
25
import { Picture } from 'astro:assets';
36
47
import { getSessionizeData } from '$sessionize/getSessionizeData'
5-
import type { Session, Speaker } from "$sessionize/types";
8+
import type { Session, Speaker, Room } from "$sessionize/types";
69
import Base from "$layouts/base.astro";
710
import LogoHorizontal from "$sprites/logoHorizontal.astro";
811
912
export interface Props {
1013
session: Session
1114
speakers: Speaker[]
15+
room: Room
1216
}
1317
18+
dayjs.extend(utc)
19+
dayjs.extend(timezone)
20+
1421
export const getStaticPaths = async () => {
15-
const { sessions, speakers } = await getSessionizeData()
22+
const { sessions, speakers, rooms } = await getSessionizeData()
1623
return sessions.map(session => ({
1724
params: {
1825
id: session.id
1926
},
2027
props: {
2128
session,
22-
speakers: session.speakers.map(speakerId => speakers.find(speaker => speaker.id === speakerId))
29+
speakers: session.speakers.map(speakerId => speakers.find(speaker => speaker.id === speakerId)),
30+
room: rooms.find(room => room.id === session.roomId),
2331
}
2432
}));
2533
}
2634
27-
const { session, speakers } = Astro.props
35+
const { session, speakers, room } = Astro.props
2836
---
2937

3038
<Base title=`${session.title} | JavaScript Bangkok 2.0.0`>
@@ -61,6 +69,9 @@ const { session, speakers } = Astro.props
6169
</div>
6270
<div class="max-w-xl pt-8 space-y-4">
6371
<h1 class="font-bold text-2xl">{session.title}</h1>
72+
<div class="flex">
73+
<p class="font-mono text-white bg-black rounded py-1 px-3 text-sm font-bold">{dayjs(session.startsAt).tz('Asia/Bangkok').format("(ddd) D MMMM YYYY, HH:mm")} @{room.name}</p>
74+
</div>
6475
<p>{session.description}</p>
6576
</div>
6677
</section>

0 commit comments

Comments
 (0)