Skip to content

Commit 85b4c02

Browse files
committed
storybook previews to use same CSS/fonts as the rest of app
1 parent 0a6d086 commit 85b4c02

File tree

4 files changed

+48
-12
lines changed

4 files changed

+48
-12
lines changed

.storybook/main.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module.exports = {
2-
"stories": [
3-
"../src/**/*.stories.mdx",
4-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5-
],
6-
"addons": [
7-
"@storybook/addon-links",
8-
"@storybook/addon-essentials",
9-
"@storybook/preset-create-react-app"
10-
]
11-
}
2+
"stories": [
3+
"../src/**/*.stories.mdx",
4+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
],
6+
"addons": [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
9+
"@storybook/preset-create-react-app",
10+
"storybook-addon-material-ui"
11+
]
12+
}
13+

.storybook/preview-head.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<title>BLAH BLAH</title>
2+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
3+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,700&display=swap" />
4+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
5+
<link
6+
rel="stylesheet"
7+
href="https://unpkg.com/[email protected]/dist/leaflet.css"
8+
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
9+
crossorigin=""
10+
/>
11+
<script
12+
src="https://unpkg.com/[email protected]/dist/leaflet.js"
13+
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
14+
crossorigin=""
15+
></script>

.storybook/preview.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
import React from 'react';
2+
3+
import {ThemeProvider} from '@material-ui/core/styles'
4+
import {roomsTheme} from '../src/utils/themes/index'
5+
6+
import '../src/index.css'
7+
8+
export const decorators = [
9+
(story) => (
10+
<ThemeProvider theme={roomsTheme}>
11+
{story()}
12+
</ThemeProvider>
13+
),
14+
];
115

216
export const parameters = {
3-
actions: { argTypesRegex: "^on[A-Z].*" },
4-
}
17+
actions: {argTypesRegex: "^on[A-Z].*"},
18+
}

src/utils/themes/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import {createMuiTheme} from "@material-ui/core/styles";
2+
import {baseMuiThemeObj} from "./base";
3+
14
export {
25
baseMuiThemeObj,
36
} from './base'
@@ -9,3 +12,5 @@ export {
912
export {
1013
dropDownThemeObj,
1114
} from './drop_down'
15+
16+
export const roomsTheme = createMuiTheme(baseMuiThemeObj)

0 commit comments

Comments
 (0)