-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* @mui/material@^5.14.13 * Created a default set of light and dark MUI themes * Added polyfills for requestAnimationFrame and requestIdleCallback * Added a simple docker-compose.yaml to create a Postgres instance. * Added Storybook
- Loading branch information
1 parent
96368a6
commit ac16c02
Showing
86 changed files
with
28,622 additions
and
9,249 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Decorator } from "@storybook/react"; | ||
import { Card, CardContent } from "@mui/material"; | ||
|
||
export const withCard: Decorator = (Story) => { | ||
return ( | ||
<Card> | ||
<CardContent> | ||
<Story /> | ||
</CardContent> | ||
</Card> | ||
); | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
staticDirs: ["../public"], //👈 Configures the static asset folder in Storybook | ||
}; | ||
export default config; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script> | ||
window.global = window; | ||
</script> | ||
<style> | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
.sb-main-fullscreen #storybook-root { | ||
height: 100%; | ||
} | ||
</style> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Imported here for storybook. These must be imported in your own project's index file | ||
import type { Decorator, Preview, StoryFn } from "@storybook/react"; | ||
import { HelmetProvider } from "react-helmet-async"; | ||
import { MemoryRouter } from "react-router-dom"; | ||
import { ApolloProvider } from "@apollo/client"; | ||
import { apolloClient } from "../src/services/apollo"; | ||
import { CssBaseline, ThemeProvider } from "@mui/material"; | ||
import NetflixDark from "../src/themes/NetflixDark"; | ||
import NetflixLight from "../src/themes/NetflixLight"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout | ||
// layout: "fullscreen", // TODO not having any effect.. | ||
backgrounds: { | ||
default: "NetflixDark", | ||
values: [ | ||
{ | ||
name: "NetflixLight", | ||
value: NetflixLight.palette.background.default, | ||
}, | ||
{ | ||
name: "NetflixDark", | ||
value: NetflixDark.palette.background.default, | ||
}, | ||
], | ||
}, | ||
actions: { argTypesRegex: "^on.*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
export default preview; | ||
|
||
const withTheme: Decorator = (Story, context) => { | ||
const theme = | ||
context.globals.backgrounds?.value === | ||
NetflixDark.palette.background.default | ||
? NetflixDark | ||
: NetflixLight; | ||
|
||
return ( | ||
<> | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline enableColorScheme /> | ||
<Story /> | ||
</ThemeProvider> | ||
</> | ||
); | ||
}; | ||
|
||
export const decorators: Decorator[] = [ | ||
(Story: StoryFn) => ( | ||
<MemoryRouter> | ||
<ApolloProvider client={apolloClient}> | ||
<HelmetProvider> | ||
<Story /> | ||
</HelmetProvider> | ||
</ApolloProvider> | ||
</MemoryRouter> | ||
), | ||
withTheme, | ||
]; |
Oops, something went wrong.