From d3f95831aaee9bd263e5b74796a6f9a3c238c186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Mon, 14 Nov 2022 01:44:12 +0100 Subject: [PATCH] Implement layout --- website/components/layout/index.tsx | 9 --------- website/pages/[...listPathPage].tsx | 2 +- website/src/templates/index.js | 12 ++++-------- 3 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 website/components/layout/index.tsx diff --git a/website/components/layout/index.tsx b/website/components/layout/index.tsx deleted file mode 100644 index d8a27fecf..000000000 --- a/website/components/layout/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -const Layout = (args) => { - return ( - <> -
{args.children}
- - ) -} - -export default Layout diff --git a/website/pages/[...listPathPage].tsx b/website/pages/[...listPathPage].tsx index e5facc942..1ab7850d6 100644 --- a/website/pages/[...listPathPage].tsx +++ b/website/pages/[...listPathPage].tsx @@ -3,7 +3,7 @@ import { serialize } from 'next-mdx-remote/serialize' import fs from 'fs' import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote' import path from 'path' -import Layout from '../components/layout' +import Layout from '../src/templates' import remarkPlugins from '../plugins/index.mjs' import recordSection from '../meta/recordSections' diff --git a/website/src/templates/index.js b/website/src/templates/index.js index 1f0ccf1f5..52f234c30 100644 --- a/website/src/templates/index.js +++ b/website/src/templates/index.js @@ -95,8 +95,8 @@ class Layout extends React.Component { } render() { - const { pageContext, location, children } = this.props - const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = pageContext + const { location, children } = this.props + const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = this.props const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude }) const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section) @@ -122,13 +122,9 @@ class Layout extends React.Component { {isDocs ? ( - {content} + {children} ) : section === 'universe' ? ( - + ) : (
{children}