@@ -12,17 +12,18 @@ import { replaceUrlWithLink } from 'src/modules/util/text'
12
12
import { fetchSessionize } from 'src/modules/sessionize/fetch-sessionize'
13
13
import {
14
14
formatSpeakerName ,
15
- getGoogleCalendarEventCreationLink ,
16
15
getRoom ,
17
16
getSession ,
18
17
getSessionLevel ,
19
18
getSessionType ,
19
+ getSlideUrl ,
20
20
getSpeaker ,
21
21
getTwitterUserName
22
22
} from 'src/modules/sessionize/utils'
23
23
import Head from 'next/head'
24
- import { GoogleCalendarButton , TweetButton } from 'src/components/molecules'
25
- import { PageHeading } from 'src/components/atoms'
24
+ import { TweetButton , YouTubeEmbedFrame } from 'src/components/molecules'
25
+ import { Button , PageHeading } from 'src/components/atoms'
26
+ import { useTranslation } from 'react-i18next'
26
27
27
28
type Props = {
28
29
title : string
@@ -31,7 +32,8 @@ type Props = {
31
32
description : string
32
33
sessionType : string | null
33
34
sessionLevel : string | null
34
- googleCalendarEventCreationLink : string
35
+ recordingUrl : string | null
36
+ slideUrl : string | null
35
37
speaker : {
36
38
fullName : string
37
39
profilePicture : string
@@ -97,14 +99,14 @@ export const getStaticProps: GetStaticProps<Props> = async ({ params }) => {
97
99
roomId,
98
100
categoryItems,
99
101
speakers : speakerIds ,
100
- startsAt ,
101
- endsAt
102
+ questionAnswers ,
103
+ recordingUrl
102
104
} = getSession ( sessions , sessionId )
103
105
104
106
const { name : roomName } = getRoom ( rooms , roomId )
105
107
const sessionLevel = getSessionLevel ( categories , categoryItems )
106
108
const sessionType = getSessionType ( categories , categoryItems )
107
- const googleCalendarEventCreationLink = getGoogleCalendarEventCreationLink ( startsAt , endsAt , title , description )
109
+ const slideUrl = getSlideUrl ( questionAnswers )
108
110
const { firstName, lastName, profilePicture, bio, tagLine, links } = getSpeaker ( speakers , speakerIds [ 0 ] )
109
111
const fullName = formatSpeakerName ( firstName , lastName )
110
112
const twitterUserName = getTwitterUserName ( links )
@@ -117,7 +119,8 @@ export const getStaticProps: GetStaticProps<Props> = async ({ params }) => {
117
119
description,
118
120
sessionLevel,
119
121
sessionType,
120
- googleCalendarEventCreationLink,
122
+ recordingUrl,
123
+ slideUrl,
121
124
speaker : { fullName, profilePicture, bio, tagLine, twitterUserName }
122
125
}
123
126
}
@@ -130,9 +133,11 @@ const Page: NextPage<InferGetStaticPropsType<typeof getStaticProps>> = ({
130
133
description,
131
134
sessionLevel,
132
135
sessionType,
133
- googleCalendarEventCreationLink,
136
+ recordingUrl,
137
+ slideUrl,
134
138
speaker : { fullName, profilePicture, bio, tagLine, twitterUserName }
135
139
} ) => {
140
+ const { t } = useTranslation ( )
136
141
return (
137
142
< Layout >
138
143
< Head >
@@ -150,6 +155,18 @@ const Page: NextPage<InferGetStaticPropsType<typeof getStaticProps>> = ({
150
155
>
151
156
< PageHeading textAlign = "left" > { title } </ PageHeading >
152
157
158
+ { /* Archive */ }
159
+ { ( recordingUrl || slideUrl ) && (
160
+ < Box sx = { { display : 'flex' , flexDirection : 'column' , gap : '24px' , alignItems : 'center' , mb : '40px' } } >
161
+ { recordingUrl && < YouTubeEmbedFrame recordingUrl = { recordingUrl } /> }
162
+ { slideUrl && (
163
+ < a href = { slideUrl } target = "_blank" >
164
+ < Button text = { t ( 'see_slide' ) } />
165
+ </ a >
166
+ ) }
167
+ </ Box >
168
+ ) }
169
+
153
170
{ /* Session's info */ }
154
171
< Box sx = { { display : 'flex' , flexDirection : 'column' , gap : '16px' , mb : '32px' } } >
155
172
< Box sx = { { display : 'flex' , gap : '8px' , alignItems : 'center' } } >
@@ -209,8 +226,7 @@ const Page: NextPage<InferGetStaticPropsType<typeof getStaticProps>> = ({
209
226
</ Box >
210
227
211
228
{ /* Share */ }
212
- < Box sx = { { display : 'flex' , gap : '16px' , justifyContent : 'flex-end' , mb : '64px' } } >
213
- < GoogleCalendarButton googleCalendarEventCreationLink = { googleCalendarEventCreationLink } />
229
+ < Box sx = { { display : 'flex' , justifyContent : 'flex-end' , mb : '64px' } } >
214
230
< TweetButton sessionId = { sessionId } title = { title } roomName = { roomName } />
215
231
</ Box >
216
232
0 commit comments