Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'focus-visible';
import 'docs-ui/index.js';

import {Fragment} from 'react';
import {DocsContainer, Meta} from '@storybook/addon-docs';
import {addDecorator, addParameters, DecoratorFn, Parameters} from '@storybook/react';
import Code from 'docs-ui/components/code';
Expand Down Expand Up @@ -47,12 +48,16 @@ const withThemeDocs: DecoratorFn = ({children, context}) => {
}

return (
<ThemeProvider theme={currentTheme}>
<GlobalStyles isDark={isDark} theme={currentTheme} />
<PreviewGlobalStyles theme={currentTheme} />
<DocsContainer context={context}>{children}</DocsContainer>
<TableOfContents />
</ThemeProvider>
<Fragment>
<DocsContainer context={context}>
<GlobalStyles isDark={isDark} theme={currentTheme} />
<PreviewGlobalStyles theme={currentTheme} />
<ThemeProvider theme={currentTheme}>{children}</ThemeProvider>
</DocsContainer>
<ThemeProvider theme={currentTheme}>
<TableOfContents />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that this is not part of DocsContainer? This is a bit awk, but not a big deal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be okay. DocsContainer is just a wrapper around the main content. There's another wrapper (#docs-root) surrounding both it and <TableOfContents />.

</ThemeProvider>
</Fragment>
);
};

Expand Down