Skip to content

Commit 4104a8a

Browse files
authored
chore(docs): fix the order of stories in the playground (#2645)
* Change the story file name to include stories When we move to version 7+, this will be updated to mgt-component.js from mgt-component.stories.js Signed-off-by: Musale Martin <[email protected]> * Order options to start with stories files Signed-off-by: Musale Martin <[email protected]> * Update pages that the theme toggle should not appear on Signed-off-by: Musale Martin <[email protected]> --------- Signed-off-by: Musale Martin <[email protected]>
1 parent a6900c2 commit 4104a8a

File tree

13 files changed

+60
-75
lines changed

13 files changed

+60
-75
lines changed

.storybook/addons/codeEditorAddon/codeAddon.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ export const withCodeEditor = makeDecorator({
7070
skipIfNoParametersOrOptions: false,
7171
wrapper: (getStory, context, { options }) => {
7272
const forOptions = options ? options.disableThemeToggle : false;
73-
const forContext =
74-
context && (context.name === 'Custom CSS Properties' || context.title.toLowerCase().includes('templating'));
73+
const title =
74+
['Custom CSS Properties', 'Theme'].includes(context.name) || context.title.toLowerCase().includes('templating');
75+
const forContext = context && title;
7576
const disableThemeToggle = forOptions || forContext;
7677
let story = getStory(context);
7778

.storybook/preview.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ addParameters({
4747
inlineStories: false,
4848
page: noArgsDocsPage
4949
},
50-
version: versionInfo
50+
version: versionInfo,
51+
options: {
52+
storySort: {
53+
order: ['stories']
54+
}
55+
}
5156
});
5257

5358
const req = require.context('../stories', true, /\.(js|mdx)$/);
File renamed without changes.

0 commit comments

Comments
 (0)