@@ -3,6 +3,7 @@ import Decoration from "@/assets/decoration.svg";
3
3
import PreviewImage from "@/assets/galleryPreview.png" ;
4
4
import AssociationDescription from "@/components/AssociationDescription" ;
5
5
import Button from "@/components/Button" ;
6
+ import ChannelsList from "@/components/ChannelsList" ;
6
7
import DirectusImage from "@/components/DirectusImage" ;
7
8
import Gallery from "@/components/Gallery" ;
8
9
import MembersList from "@/components/MembersList" ;
@@ -16,11 +17,7 @@ import {
16
17
getDirectusImageUrl ,
17
18
populateLayoutProps ,
18
19
} from "@/directus" ;
19
- import {
20
- getTranslation ,
21
- queryTranslations ,
22
- useTranslationTable ,
23
- } from "@/locales" ;
20
+ import { getTranslation , useTranslationTable } from "@/locales" ;
24
21
import styles from "@/styles/Homepage.module.scss" ;
25
22
import {
26
23
Association ,
@@ -77,6 +74,8 @@ export default function Home(
77
74
78
75
< PartnersList id = "partners" partners = { props . partners } background = { true } />
79
76
77
+ < ChannelsList channels = { props . association . channels } />
78
+
80
79
< div className = { styles . associationDesciption } >
81
80
< div className = { styles . center } >
82
81
< AssociationDescription
@@ -111,11 +110,24 @@ export const getServerSideProps: GetServerSideProps<
111
110
gallery : any [ ] ;
112
111
} & LayoutProps
113
112
> = populateLayoutProps ( async ( _ ) => {
113
+ var association = await directus ( ) . request (
114
+ readSingleton ( "association" , {
115
+ fields : [
116
+ "*" ,
117
+ // @ts -expect-error
118
+ { translations : [ "*" ] } ,
119
+ // @ts -expect-error
120
+ { channels : [ "*" , { directus_files_id : [ "*" ] } ] } ,
121
+ ] ,
122
+ } )
123
+ ) ;
124
+
125
+ // @ts -expect-error
126
+ association . channels = association . channels . map ( ( c ) => c . directus_files_id ) ;
127
+
114
128
return {
115
129
props : {
116
- association : await directus ( ) . request (
117
- readSingleton ( "association" , queryTranslations as any )
118
- ) ,
130
+ association,
119
131
partners : ( await directus ( )
120
132
. request (
121
133
readItems ( "association_partners" , {
0 commit comments