mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 21:03:19 +03:00
31 lines
798 B
JavaScript
31 lines
798 B
JavaScript
import React from 'react';
|
|
import { DocsContainer as BaseContainer } from '@storybook/addon-docs';
|
|
import { useDarkMode } from 'storybook-dark-mode';
|
|
import { themes } from '@storybook/theming';
|
|
|
|
export const DocsContainer = ({ children, context }) => {
|
|
const dark = useDarkMode();
|
|
|
|
return (
|
|
<BaseContainer
|
|
context={{
|
|
...context,
|
|
storyById: id => {
|
|
const storyContext = context.storyById(id);
|
|
return {
|
|
...storyContext,
|
|
parameters: {
|
|
...storyContext?.parameters,
|
|
docs: {
|
|
...storyContext?.parameters?.docs,
|
|
theme: dark ? themes.dark : themes.light,
|
|
},
|
|
},
|
|
};
|
|
},
|
|
}}
|
|
>
|
|
{children}
|
|
</BaseContainer>
|
|
);
|
|
};
|