File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
1
import DirectusImage from "./DirectusImage" ;
2
2
import { getTranslation , locale } from "@/locales" ;
3
3
import styles from "@/styles/IcbdActivityCard.module.scss" ;
4
- import { ICBDActivity } from "@/types/aliases" ;
4
+ import { ICBDActivity , ICBDSpeaker } from "@/types/aliases" ;
5
5
import { useRouter } from "next/router" ;
6
6
import Markdown from "react-markdown" ;
7
7
8
8
export default function IcbdActivityCard ( props : { activity : ICBDActivity } ) {
9
9
const router = useRouter ( ) ;
10
10
11
+ const hosts = props . activity . hosts as ICBDSpeaker [ ] ;
12
+
11
13
const translation = getTranslation ( props . activity , locale ( router ) ) ;
12
14
return (
13
15
< div className = { styles . content } >
@@ -23,6 +25,19 @@ export default function IcbdActivityCard(props: { activity: ICBDActivity }) {
23
25
< Markdown className = { styles . description } >
24
26
{ translation . description }
25
27
</ Markdown >
28
+ { hosts . length != 0 ? (
29
+ < p className = { styles . hosts } >
30
+ { "⦿ " +
31
+ hosts
32
+ . map ( ( s : ICBDSpeaker ) => {
33
+ let speaker = s . icbd_speakers_id ;
34
+ return `${ speaker . first_name } ${ speaker . last_name } ` ;
35
+ } )
36
+ . join ( " - " ) }
37
+ </ p >
38
+ ) : (
39
+ < > </ >
40
+ ) }
26
41
</ div >
27
42
) ;
28
43
}
Original file line number Diff line number Diff line change @@ -241,11 +241,11 @@ export const getServerSideProps: GetServerSideProps<{
241
241
readItems ( "icbd_activities" , {
242
242
fields : [
243
243
"id" ,
244
- "hosts" ,
245
244
"icon" ,
246
245
"timeslots" ,
247
246
"color" ,
248
247
{ translations : [ "*" ] } ,
248
+ "hosts.icbd_speakers_id.*" ,
249
249
] ,
250
250
} )
251
251
) ,
Original file line number Diff line number Diff line change 33
33
width : 100% ;
34
34
}
35
35
36
+ .hosts {
37
+ color : grey ;
38
+ }
39
+
36
40
@media (max-width : 1000px ) {
37
41
width : 65% ;
38
42
}
You can’t perform that action at this time.
0 commit comments