Skip to content

Commit

Permalink
Use sentence case for sidebar (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhorsford authored Jun 11, 2024
1 parent 6bdb7a3 commit 657d3ca
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 657d3ca

Please sign in to comment.