@@ -11,6 +11,7 @@ import pageStyle from "@/styles/Page.module.scss";
11
11
import { ICBD , ICBDActivity , ICBDPhd , ICBDSpeaker } from "@/types/aliases" ;
12
12
import { readItems , readSingleton } from "@directus/sdk" ;
13
13
import { GetServerSideProps , InferGetServerSidePropsType } from "next" ;
14
+ import Link from "next/link" ;
14
15
import { useRouter } from "next/router" ;
15
16
import Markdown from "react-markdown" ;
16
17
@@ -147,14 +148,24 @@ export default function ICBDPage(
147
148
148
149
< div className = { style . alumni } >
149
150
< div className = { style . alumniList } >
150
- { props . speakers . map ( ( speaker : ICBDSpeaker ) => (
151
- < Card
152
- key = { speaker . id }
153
- img = { speaker . picture }
154
- title = { `${ speaker . first_name } ${ speaker . last_name } ` || "" }
155
- description = { speaker . company || "" }
156
- />
157
- ) ) }
151
+ { props . speakers . map ( ( speaker : ICBDSpeaker ) => {
152
+ const card = (
153
+ < Card
154
+ key = { speaker . id }
155
+ img = { speaker . picture }
156
+ title = { `${ speaker . first_name } ${ speaker . last_name } ` || "" }
157
+ description = { speaker . company || "" }
158
+ />
159
+ ) ;
160
+
161
+ return speaker . linkedin ? (
162
+ < Link key = { speaker . id } href = { speaker . linkedin } >
163
+ { card }
164
+ </ Link >
165
+ ) : (
166
+ card
167
+ ) ;
168
+ } ) }
158
169
</ div >
159
170
</ div >
160
171
</ div >
@@ -221,6 +232,7 @@ export const getServerSideProps: GetServerSideProps<{
221
232
"end_time" ,
222
233
"timetable" ,
223
234
{ partners_images : [ "*" ] } ,
235
+ //@ts -ignore
224
236
{
225
237
translations : [ "*" ] ,
226
238
} ,
@@ -229,7 +241,14 @@ export const getServerSideProps: GetServerSideProps<{
229
241
) ,
230
242
speakers : await directus ( ) . request (
231
243
readItems ( "icbd_speakers" , {
232
- fields : [ "id" , "picture" , "first_name" , "last_name" , "company" ] ,
244
+ fields : [
245
+ "id" ,
246
+ "picture" ,
247
+ "first_name" ,
248
+ "last_name" ,
249
+ "company" ,
250
+ "linkedin" ,
251
+ ] ,
233
252
} )
234
253
) ,
235
254
phds : await directus ( ) . request (
@@ -244,7 +263,9 @@ export const getServerSideProps: GetServerSideProps<{
244
263
"icon" ,
245
264
"timeslots" ,
246
265
"color" ,
266
+ //@ts -ignore
247
267
{ translations : [ "*" ] } ,
268
+ //@ts -ignore
248
269
"hosts.icbd_speakers_id.*" ,
249
270
] ,
250
271
} )
0 commit comments