Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
chore: migrate docz config to v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasconstantino committed Mar 21, 2019
1 parent f814a52 commit ab228b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
5 changes: 4 additions & 1 deletion config/babel/babel.next.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const { resolve } = require('path')

module.exports = () => ({
presets: ['next/babel', resolve(__dirname, './babel.common.js')],
presets: [
['next/babel', { 'transform-runtime': { useESModules: false } }],
resolve(__dirname, './babel.common.js')
],
plugins: [
['styled-components', { ssr: true, displayName: true, preprocess: false }]
]
Expand Down
1 change: 0 additions & 1 deletion docs/concepts/composition.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Composition
route: /concepts/composition
order: -4
---

# Composition
Expand Down
15 changes: 7 additions & 8 deletions docs/docz/Provider.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react'
import { node } from 'prop-types'
import { ThemeConfig } from 'docz'
import { useConfig } from 'docz'
import { ThemeProvider } from 'styled-components'

const Provider = ({ children }) => (
<ThemeConfig>
{ ({ themeConfig }) => (
<ThemeProvider theme={ themeConfig }>{ children }</ThemeProvider>
) }
</ThemeConfig>
)
const Provider = ({ children }) => {
const { themeConfig } = useConfig()

return <ThemeProvider theme={ themeConfig }>{ children }</ThemeProvider>
}

Provider.propTypes = {
children: node.isRequired
Expand Down
3 changes: 2 additions & 1 deletion doczrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'Menus'
],
wrapper: 'docs/docz/Provider',
dest: 'build/docs',
src: './docs',
dest: './build/docs',
modifyBundlerConfig
}

0 comments on commit ab228b0

Please sign in to comment.