1- import { GetServerSideProps } from 'next'
1+ import React from 'react'
2+ import type { GetServerSideProps } from 'next'
23
34import { MainContextT , MainContext , getMainContext } from 'components/context/MainContext'
45
5- import React from 'react'
66import { DefaultLayout } from 'components/DefaultLayout'
77import { useTranslation } from 'components/hooks/useTranslation'
88import { ArticleList } from 'components/landing/ArticleList'
99import { HomePageHero } from 'components/homepage/HomePageHero'
10+ import type { ProductGroupT } from 'components/homepage/ProductSelections'
1011import { ProductSelections } from 'components/homepage/ProductSelections'
1112
1213type FeaturedLink = {
@@ -19,13 +20,23 @@ type Props = {
1920 mainContext : MainContextT
2021 popularLinks : Array < FeaturedLink >
2122 gettingStartedLinks : Array < FeaturedLink >
23+ productGroups : Array < ProductGroupT >
2224}
2325
24- export default function MainHomePage ( { mainContext, gettingStartedLinks, popularLinks } : Props ) {
26+ export default function MainHomePage ( {
27+ mainContext,
28+ gettingStartedLinks,
29+ popularLinks,
30+ productGroups,
31+ } : Props ) {
2532 return (
2633 < MainContext . Provider value = { mainContext } >
2734 < DefaultLayout >
28- < HomePage gettingStartedLinks = { gettingStartedLinks } popularLinks = { popularLinks } />
35+ < HomePage
36+ gettingStartedLinks = { gettingStartedLinks }
37+ popularLinks = { popularLinks }
38+ productGroups = { productGroups }
39+ />
2940 </ DefaultLayout >
3041 </ MainContext . Provider >
3142 )
@@ -34,15 +45,16 @@ export default function MainHomePage({ mainContext, gettingStartedLinks, popular
3445type HomePageProps = {
3546 popularLinks : Array < FeaturedLink >
3647 gettingStartedLinks : Array < FeaturedLink >
48+ productGroups : Array < ProductGroupT >
3749}
3850function HomePage ( props : HomePageProps ) {
39- const { gettingStartedLinks, popularLinks } = props
51+ const { gettingStartedLinks, popularLinks, productGroups } = props
4052 const { t } = useTranslation ( [ 'toc' ] )
4153
4254 return (
4355 < div >
4456 < HomePageHero />
45- < ProductSelections />
57+ < ProductSelections productGroups = { productGroups } />
4658 < div className = "mt-6 px-3 px-md-6 container-xl" >
4759 < div className = "container-xl" >
4860 < div className = "gutter gutter-xl-spacious clearfix" >
@@ -67,6 +79,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
6779 return {
6880 props : {
6981 mainContext : await getMainContext ( req , res ) ,
82+ productGroups : req . context . productGroups ,
7083 gettingStartedLinks : req . context . featuredLinks . gettingStarted . map (
7184 ( { title, href, intro } : any ) => ( { title, href, intro } )
7285 ) ,
0 commit comments