Skip to content

Commit

Permalink
Use sentence case for sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhorsford committed Jun 11, 2024
1 parent 41d858c commit 603cfbf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { addons } from '@storybook/manager-api';
import nhsTheme from './theme';
import { startCase, upperFirst } from "lodash";

const sentenceCase = string => {
if (typeof string !== 'string') return ''
return upperFirst(startCase(string).toLowerCase())
}

addons.setConfig({
theme: nhsTheme,
sidebar: {
renderLabel: ({ name, type }) =>
sentenceCase(name),
},
theme: nhsTheme
});

0 comments on commit 603cfbf

Please sign in to comment.