Skip to content

Commit f24bd9b

Browse files
committed
refactor: exclude mdx dark mode
1 parent 06645a5 commit f24bd9b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.storybook/preview.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ const preview: Preview = {
1717
docs: {
1818
toc: true,
1919
container: (props: DocsContainerProps<ReactRenderer>) => {
20-
const { getStoryContext, storyById } = props.context;
20+
try {
21+
const { getStoryContext, storyById } = props.context;
2122

22-
const globals = getStoryContext(storyById()).globals;
23-
const theme = globals.theme === "dark" ? themes.dark : themes.light;
24-
25-
return <DocsContainer {...props} theme={theme} />;
23+
const globals = getStoryContext(storyById()).globals;
24+
const theme = globals.theme === "dark" ? themes.dark : themes.light;
25+
return <DocsContainer {...props} theme={theme} />;
26+
} catch {
27+
return <DocsContainer {...props} />;
28+
}
2629
},
2730
},
2831
},

0 commit comments

Comments
 (0)