Last active
January 28, 2021 04:54
-
-
Save jasonsturges/3d3338d95471a0a69b33c0bf4bea66b1 to your computer and use it in GitHub Desktop.
Storybook with React, Redux, and Material UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Meta } from '@storybook/addon-docs/blocks'; | |
<Meta title="Example/Introduction" /> | |
<style>{` | |
.subheading { | |
--mediumdark: '#999999'; | |
font-weight: 900; | |
font-size: 13px; | |
color: #999; | |
letter-spacing: 6px; | |
line-height: 24px; | |
text-transform: uppercase; | |
margin-bottom: 12px; | |
margin-top: 40px; | |
} | |
`}</style> | |
# My Heading | |
This is example _markdown_ text, but also supports html such as: | |
<div className="subheading">Getting Started</div> | |
To begin, execute `yarn storybook`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createProxyMiddleware } = require("http-proxy-middleware"); | |
module.exports = function (app) { | |
app.use( | |
createProxyMiddleware("/socket", | |
{ target: "ws://localhost:4002", ws: true })); | |
app.use( | |
"/photos", | |
createProxyMiddleware({ target: "http://localhost:3001", changeOrigin: true }) | |
); | |
app.use( | |
"/api", | |
createProxyMiddleware({ target: "http://localhost:3001", changeOrigin: true }) | |
); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { MemoryRouter } from "react-router"; | |
import { Provider } from "react-redux"; | |
import { ThemeProvider } from "@material-ui/styles"; | |
import store from "../src/store"; | |
import theme from "../src/theme"; | |
export const decorators = [ | |
Story => ( | |
<Provider store={store}> | |
<ThemeProvider theme={theme}> | |
<MemoryRouter> | |
<Story /> | |
</MemoryRouter> | |
</ThemeProvider> | |
</Provider> | |
) | |
]; | |
export const parameters = { | |
actions: { argTypesRegex: "^on[A-Z].*" } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment