fix theme logic

This commit is contained in:
Yann Braga 2022-08-18 10:26:36 +02:00
parent f0547089b8
commit 829b806065

View File

@ -107,8 +107,8 @@ const ThemedSetRoot = () => {
export const decorators = [
(StoryFn, { globals, parameters, playFunction }) => {
const theme =
globals.theme || parameters.theme || (isChromatic() && !playFunction ? 'stacked' : 'light');
const defaultTheme = isChromatic() && !playFunction ? 'stacked' : 'light';
const theme = globals.theme || parameters.theme || defaultTheme;
switch (theme) {
case 'side-by-side': {
@ -157,7 +157,7 @@ export const decorators = [
<Symbols icons={['folder', 'component', 'document', 'bookmarkhollow']} />
<Global styles={createReset} />
<ThemedSetRoot />
{isChromatic() && playFunction && (
{!parameters.theme && isChromatic() && playFunction && (
<PlayFnNotice>
<span>Detected play function.</span>
<span>Rendering in a single theme</span>