aboutsummaryrefslogtreecommitdiffstats
path: root/.storybook/preview.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-15 18:35:16 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-15 18:49:49 +0100
commit0f936ec0e7606cb79434d94096b6e113a7ce78eb (patch)
tree465ec7f66ac9459be6a18ac046e10357814c7b92 /.storybook/preview.tsx
parent4e4d2eb25365be861e19f9756cf334ba2faa6911 (diff)
refactor(stories): migrate stories to CSF3 format
Diffstat (limited to '.storybook/preview.tsx')
-rw-r--r--.storybook/preview.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
index f36013c..47ea5a8 100644
--- a/.storybook/preview.tsx
+++ b/.storybook/preview.tsx
@@ -1,6 +1,6 @@
import type { Decorator, Preview } from '@storybook/react';
import { useDarkMode } from 'storybook-dark-mode';
-import { FC, ReactNode, useEffect } from 'react';
+import React, { FC, ReactNode, useEffect } from 'react';
import { IntlProvider } from 'react-intl';
import {
AckeeProvider,
@@ -9,10 +9,10 @@ import {
ThemeProvider,
} from '../src/utils/providers';
import '../src/styles/globals.scss';
-import { DocsContainer } from './overrides/docs-container';
import dark from './themes/dark';
import light from './themes/light';
import { useTheme } from '../src/utils/hooks';
+import { DocsContainer } from '@storybook/blocks';
type ThemeWrapperProps = {
children: ReactNode;
@@ -77,7 +77,13 @@ const preview: Preview = {
stylePreview: true,
},
docs: {
- container: DocsContainer,
+ container: ({ children, context }) => {
+ return (
+ <DocsContainer context={context} theme={useDarkMode() ? dark : light}>
+ {children}
+ </DocsContainer>
+ );
+ },
},
},
};