Skip to content

Commit

Permalink
fix(gatsby-theme-docz): fix mdx components theming from config
Browse files Browse the repository at this point in the history
Replaces MDXProvider with ThemeProvider

Allows customization of all mdx components from themeConfig

#1309

https://theme-ui.com/mdx-components
https://theme-ui.com/theme-spec
  • Loading branch information
rakannimer committed Dec 11, 2019
1 parent 4802531 commit 3a9bdb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions core/gatsby-theme-docz/src/base/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ const Route = ({ children, entry, ...defaultProps }) => {
const props = { ...defaultProps, doc: entry }
if (!entry) return <NotFound />
return (
<MDXProvider components={components}>
<Wrapper doc={entry}>
<Layout {...props}>{children}</Layout>
</Wrapper>
</MDXProvider>
<Wrapper doc={entry}>
<Layout {...props}>{children}</Layout>
</Wrapper>
)
}

Expand Down
2 changes: 1 addition & 1 deletion core/gatsby-theme-docz/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import components from '~components'
const Theme = ({ children }) => {
const config = useConfig()
return (
<ThemeProvider theme={config.themeConfig}>
<ThemeProvider theme={config.themeConfig} components={components}>
<ComponentsProvider components={components}>
<Styled.root>{children}</Styled.root>
</ComponentsProvider>
Expand Down

0 comments on commit 3a9bdb7

Please sign in to comment.