1
0
Fork 0

fix(org): Left-behind commit for wide docs content on index page

This commit is contained in:
joostdecock 2024-03-24 09:43:55 +01:00
parent e3d3456dab
commit f0cfc5d0f1

View file

@ -2,6 +2,8 @@
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { loadMdxAsStaticProps } from 'shared/mdx/load.mjs'
import { nsMerge } from 'shared/utils.mjs'
// Hooks
import { useState } from 'react'
// Components
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.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)
const DocsHomePage = ({ page, locale, frontmatter, mdx, mdxSlug }) => (
const DocsHomePage = ({ page, locale, frontmatter, mdx, mdxSlug }) => {
const [wide, setWide] = useState(false)
return (
<PageWrapper
{...page}
locale={locale}
title={frontmatter.title}
intro={frontmatter.intro || frontmatter.lead}
layout={(props) => <DocsLayout {...props} {...{ slug: page.path.join('/'), frontmatter }} />}
layout={(props) => (
<DocsLayout {...props} {...{ slug: page.path.join('/'), frontmatter, wide, setWide }} />
)}
>
<MdxWrapper mdx={mdx} site="org" slug={mdxSlug} />
<MdxWrapper mdx={mdx} site="org" slug={mdxSlug} wide={wide} />
</PageWrapper>
)
)
}
export default DocsHomePage