1
0
mirror of synced 2025-12-22 19:34:15 -05:00
Files
docs/components/sublanding/ProductSubLanding.tsx
Mike Surowiec e26a3446a7 SubLanding page filter (#19918)
* sub-landing: implement filtering in react, other cleanup
2021-06-15 18:16:24 +00:00

42 lines
1.4 KiB
TypeScript

import { DefaultLayout } from 'components/DefaultLayout'
import { useProductSubLandingContext } from 'components/context/ProductSubLandingContext'
import React from 'react'
import { LandingSection } from 'components/landing/LandingSection'
import { SubLandingHero } from 'components/sublanding/SubLandingHero'
import { LearningTracks } from 'components/sublanding/LearningTracks'
import { ArticleCards } from 'components/sublanding/ArticleCards'
import { useTranslation } from 'components/hooks/useTranslation'
export const ProductSubLanding = () => {
const { title, learningTracks, includeGuides } = useProductSubLandingContext()
const { t } = useTranslation('sub_landing')
return (
<DefaultLayout>
<LandingSection className="pt-3">
<SubLandingHero />
</LandingSection>
{learningTracks && learningTracks.length > 0 && (
<LandingSection
title={`${title} learning paths`}
className="border-top py-6"
sectionLink="learning-paths"
description={t('learning_paths_desc')}
>
<LearningTracks />
</LandingSection>
)}
{includeGuides && (
<LandingSection
title={`All ${title} guides`}
className="border-top py-6 color-border-primary"
sectionLink="all-guides"
>
<ArticleCards />
</LandingSection>
)}
</DefaultLayout>
)
}