From e6ac33588f7d92556687c9bc3c38abb1b65868a7 Mon Sep 17 00:00:00 2001 From: Scott Nath Date: Wed, 11 Oct 2023 11:09:08 -0400 Subject: [PATCH] :bug: easier mode disable --- .storybook/modes.js | 7 +++++++ src/github/user/user.stories.js | 9 +++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.storybook/modes.js b/.storybook/modes.js index 01d4ab7..090af8b 100644 --- a/.storybook/modes.js +++ b/.storybook/modes.js @@ -9,12 +9,16 @@ import { primerThemes } from './primer-preview'; const defaultThemes = ['light', 'dark']; export const defaultModes = {}; +export const defaultModesDisabled = {}; export const githubModes = {}; for (const key of Object.keys(customViewports)) { defaultModes[key] = { viewport: key, }; + defaultModesDisabled[key] = { + disabled: true, + }; githubModes[key] = { viewport: key, }; @@ -23,6 +27,9 @@ for (const key of Object.keys(customViewports)) { viewport: key, theme: theme, }; + defaultModesDisabled[`${theme} ${key}`] = { + disabled: true, + }; }; for (const theme of primerThemes) { githubModes[`primer ${theme.value} ${key}`] = { diff --git a/src/github/user/user.stories.js b/src/github/user/user.stories.js index a2058c9..259e39b 100644 --- a/src/github/user/user.stories.js +++ b/src/github/user/user.stories.js @@ -4,6 +4,7 @@ import { parseFetchedUser } from './content'; import { parseFetchedRepo } from '../repository/content.js'; import { getElements, ensureElements } from './user.shared-spec'; import { primerThemes } from '../../../.storybook/primer-preview.js'; +import { defaultModesDisabled } from '../../../.storybook/modes.js'; import '.'; @@ -193,9 +194,7 @@ export const Themes = { parameters: { chromatic: { modes: { - containerMin1: { disable: true }, - containerMin2: { disable: true }, - containerMin3: { disable: true }, + ...defaultModesDisabled } }, }, @@ -209,9 +208,7 @@ export const ThemesWithOverrides = { parameters: { chromatic: { modes: { - containerMin1: { disable: true }, - containerMin2: { disable: true }, - containerMin3: { disable: true }, + ...defaultModesDisabled } }, },