StoryBook: Fully support themes in pop-up components

This commit is contained in:
Ken Powers 2020-02-06 14:28:01 -05:00 committed by GitHub
parent 6a9d8b86d8
commit 0fc178d887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 11 deletions

View file

@ -5,6 +5,7 @@ import classnames from 'classnames';
import * as styles from './styles.scss';
import messages from '../_locales/en/messages.json';
import { I18n } from '../sticker-creator/util/i18n';
import { ThemedProvider } from '../ts/components/PopperRootContext';
addDecorator(withKnobs);
@ -14,9 +15,13 @@ addDecorator((storyFn /* , context */) => {
return (
<div className={styles.container}>
<div className={styles.panel}>{contents}</div>
<div className={classnames(styles.darkTheme, styles.panel, 'dark-theme')}>
{contents}
</div>
<ThemedProvider themes={['dark']}>
<div
className={classnames(styles.darkTheme, styles.panel, 'dark-theme')}
>
{contents}
</div>
</ThemedProvider>
</div>
);
});