Skip to content

Commit 1fe6a75

Browse files
JesmoDevJesper Møller Jensen
andauthored
docs(storybook): added story store v7 (#290)
Co-authored-by: Jesper Møller Jensen <[email protected]>
1 parent 373f0d3 commit 1fe6a75

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
'../storyhelpers/storybook-readme/preset.js',
1010
],
1111
framework: '@storybook/web-components',
12+
features: { storyStoreV7: true },
1213
core: { builder: '@storybook/builder-vite' },
1314
staticDirs: ['./images'],
1415

.storybook/preview.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ import { setCustomElements } from '@storybook/web-components';
55

66
import customElements from '../custom-elements.json';
77

8-
const sort = (a, b) => {
9-
if (a[1].name === 'Overview') {
10-
return 0;
11-
}
12-
if (b[1].name === 'Overview') {
13-
return 1;
14-
}
15-
return a[0] > b[0];
16-
};
17-
188
export const parameters = {
199
layout: 'padded',
2010
actions: { argTypesRegex: '^on[A-Z].*' },
@@ -29,7 +19,16 @@ export const parameters = {
2919
},
3020
options: {
3121
method: 'alphabetical',
32-
storySort: sort,
22+
storySort: (a, b) => {
23+
//NOTE: This has to be an inline function for some reason
24+
if (a.title === 'Overview') {
25+
return 0;
26+
}
27+
if (b.title === 'Overview') {
28+
return 1;
29+
}
30+
return a.title > b.title;
31+
},
3332
},
3433
};
3534

0 commit comments

Comments
 (0)