Initial commit
This commit is contained in:
11
.storybook/main.js
Normal file
11
.storybook/main.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
stories: ['../**/*.story.mdx', '../**/*.story.@(js|jsx|ts|tsx)'],
|
||||
addons: [
|
||||
'storybook-dark-mode',
|
||||
{
|
||||
name: 'storybook-addon-turbo-build',
|
||||
options: { optimizationLevel: 2 },
|
||||
},
|
||||
],
|
||||
framework: '@storybook/react',
|
||||
};
|
||||
22
.storybook/preview.tsx
Normal file
22
.storybook/preview.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useDarkMode } from 'storybook-dark-mode';
|
||||
import { MantineProvider, ColorSchemeProvider } from '@mantine/core';
|
||||
import { NotificationsProvider } from '@mantine/notifications';
|
||||
|
||||
export const parameters = { layout: 'fullscreen' };
|
||||
|
||||
function ThemeWrapper(props: { children: React.ReactNode }) {
|
||||
const a = 2;
|
||||
return (
|
||||
<ColorSchemeProvider colorScheme="light" toggleColorScheme={() => {}}>
|
||||
<MantineProvider
|
||||
theme={{ colorScheme: useDarkMode() ? 'dark' : 'light' }}
|
||||
withGlobalStyles
|
||||
withNormalizeCSS
|
||||
>
|
||||
<NotificationsProvider>{props.children}</NotificationsProvider>
|
||||
</MantineProvider>
|
||||
</ColorSchemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export const decorators = [(renderStory: Function) => <ThemeWrapper>{renderStory()}</ThemeWrapper>];
|
||||
Reference in New Issue
Block a user