Skip to content

Commit 657d3ca

Browse files
Use sentence case for sidebar (#236)
1 parent 6bdb7a3 commit 657d3ca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.storybook/manager.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { addons } from '@storybook/manager-api';
22
import nhsTheme from './theme';
3+
import { startCase, upperFirst } from "lodash";
4+
5+
const sentenceCase = string => {
6+
if (typeof string !== 'string') return ''
7+
return upperFirst(startCase(string).toLowerCase())
8+
}
39

410
addons.setConfig({
5-
theme: nhsTheme,
11+
sidebar: {
12+
renderLabel: ({ name, type }) =>
13+
sentenceCase(name),
14+
},
15+
theme: nhsTheme
616
});

0 commit comments

Comments
 (0)