Remove outdated MDX handling

This commit is contained in:
Marcus Blättermann 2022-11-14 00:34:44 +01:00
parent e3d5169a01
commit d1ab5ddb5b
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D

View File

@ -69,13 +69,6 @@ class Layout extends React.Component {
} }
static propTypes = { static propTypes = {
data: PropTypes.shape({
mdx: PropTypes.shape({
code: PropTypes.shape({
body: PropTypes.string.isRequired,
}).isRequired,
}),
}).isRequired,
scope: PropTypes.object.isRequired, scope: PropTypes.object.isRequired,
pageContext: PropTypes.shape({ pageContext: PropTypes.shape({
title: PropTypes.string, title: PropTypes.string,
@ -102,18 +95,11 @@ class Layout extends React.Component {
} }
render() { render() {
const { data, pageContext, location, children } = this.props const { pageContext, location, children } = this.props
const { file, site = {} } = data || {}
const mdx = file ? file.childMdx : null
const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = pageContext const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = pageContext
const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme
const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude }) const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude })
const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section) const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section)
const content = !mdx ? null : (
<MDXProvider components={remarkComponents}>
<MDXRenderer scope={this.state.scope}>{mdx.code.body}</MDXRenderer>
</MDXProvider>
)
return ( return (
<> <>
@ -146,7 +132,6 @@ class Layout extends React.Component {
) : ( ) : (
<div> <div>
{children} {children}
{content}
<Footer wide /> <Footer wide />
</div> </div>
)} )}
@ -155,4 +140,4 @@ class Layout extends React.Component {
} }
} }
export default withMDXScope(Layout) export default Layout