fix(org): Left-behind commit for wide docs content on index page
This commit is contained in:
parent
e3d3456dab
commit
f0cfc5d0f1
1 changed files with 19 additions and 11 deletions
|
@ -2,6 +2,8 @@
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { loadMdxAsStaticProps } from 'shared/mdx/load.mjs'
|
import { loadMdxAsStaticProps } from 'shared/mdx/load.mjs'
|
||||||
import { nsMerge } from 'shared/utils.mjs'
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
|
// Hooks
|
||||||
|
import { useState } from 'react'
|
||||||
// Components
|
// Components
|
||||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
||||||
|
@ -9,17 +11,23 @@ import { DocsLayout, ns as layoutNs } from 'site/components/layouts/docs.mjs'
|
||||||
|
|
||||||
export const ns = nsMerge('docs', pageNs, layoutNs)
|
export const ns = nsMerge('docs', pageNs, layoutNs)
|
||||||
|
|
||||||
const DocsHomePage = ({ page, locale, frontmatter, mdx, mdxSlug }) => (
|
const DocsHomePage = ({ page, locale, frontmatter, mdx, mdxSlug }) => {
|
||||||
<PageWrapper
|
const [wide, setWide] = useState(false)
|
||||||
{...page}
|
|
||||||
locale={locale}
|
return (
|
||||||
title={frontmatter.title}
|
<PageWrapper
|
||||||
intro={frontmatter.intro || frontmatter.lead}
|
{...page}
|
||||||
layout={(props) => <DocsLayout {...props} {...{ slug: page.path.join('/'), frontmatter }} />}
|
locale={locale}
|
||||||
>
|
title={frontmatter.title}
|
||||||
<MdxWrapper mdx={mdx} site="org" slug={mdxSlug} />
|
intro={frontmatter.intro || frontmatter.lead}
|
||||||
</PageWrapper>
|
layout={(props) => (
|
||||||
)
|
<DocsLayout {...props} {...{ slug: page.path.join('/'), frontmatter, wide, setWide }} />
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<MdxWrapper mdx={mdx} site="org" slug={mdxSlug} wide={wide} />
|
||||||
|
</PageWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default DocsHomePage
|
export default DocsHomePage
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue