forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProductLanding.tsx
69 lines (59 loc) · 2.24 KB
/
ProductLanding.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { DefaultLayout } from 'components/DefaultLayout'
import { useProductLandingContext } from 'components/context/ProductLandingContext'
import { LandingHero } from 'components/landing/LandingHero'
import { FeaturedArticles } from 'components/landing/FeaturedArticles'
import { GuideCards } from 'components/landing/GuideCards'
import { SponsorsExamples } from 'components/landing/SponsorsExamples'
import { CommunityExamples } from 'components/landing/CommunityExamples'
import { CodeExamples } from 'components/landing/CodeExamples'
import { LandingSection } from 'components/landing/LandingSection'
import { useTranslation } from 'components/hooks/useTranslation'
import { ProductArticlesList } from 'components/landing/ProductArticlesList'
export const ProductLanding = () => {
const {
shortTitle,
guideCards,
productUserExamples,
productCommunityExamples,
productCodeExamples,
} = useProductLandingContext()
const { t } = useTranslation('product_landing')
return (
<DefaultLayout>
<LandingSection className="pt-3">
<LandingHero />
</LandingSection>
<LandingSection>
<FeaturedArticles />
</LandingSection>
{productCodeExamples.length > 0 && (
<LandingSection title={t('code_examples')} className="my-6">
<CodeExamples />
</LandingSection>
)}
{productCommunityExamples.length > 0 && (
<LandingSection title={t('communities_using_discussions')} className="my-6">
<CommunityExamples />
</LandingSection>
)}
{productUserExamples.length > 0 && (
<LandingSection title={t('sponsor_community')} className="my-6">
<SponsorsExamples />
</LandingSection>
)}
{/* {% if currentVersion contains 'enterprise-server' and currentProduct == 'admin' %}
{% include product-releases %}
{% endif %} */}
{guideCards.length > 0 && (
<div className="color-bg-tertiary py-6 my-8">
<LandingSection title={t('guides')} className="my-6">
<GuideCards />
</LandingSection>
</div>
)}
<LandingSection sectionLink="all-docs" title={`All ${shortTitle} Docs`}>
<ProductArticlesList />
</LandingSection>
</DefaultLayout>
)
}