Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: fix storybook fonts #988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion site/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CssBaseline from "@material-ui/core/CssBaseline"
import ThemeProvider from "@material-ui/styles/ThemeProvider"
import { withThemes } from "@react-theming/storybook-addon"
import { createMemoryHistory } from "history"
Expand All @@ -6,7 +7,14 @@ import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
import { dark, light } from "../src/theme"
import "../src/theme/global-fonts"

addDecorator(withThemes(ThemeProvider, [light, dark]))
const providerFn = ({ children, theme }) => (
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
)

addDecorator(withThemes(null, [light, dark], { providerFn }))

const history = createMemoryHistory()

Expand Down