diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-22 19:56:12 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-22 19:56:12 +0800 |
commit | 46b7fecafe283e814e2088373ec857747e4cf314 (patch) | |
tree | d9cbf5cf571231470b568ece2f051557e2b9e08b /packages/react-shared/src/components/nested_sidebar_menu.tsx | |
parent | e1341bc6d957d70a386c858cbdb64af5f284fd07 (diff) | |
download | dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar.gz dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar.bz2 dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar.lz dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar.xz dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.tar.zst dexon-sol-tools-46b7fecafe283e814e2088373ec857747e4cf314.zip |
Create helper function for converting dashes names for display
Diffstat (limited to 'packages/react-shared/src/components/nested_sidebar_menu.tsx')
-rw-r--r-- | packages/react-shared/src/components/nested_sidebar_menu.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx index d81bd3c3d..f49d6fcf7 100644 --- a/packages/react-shared/src/components/nested_sidebar_menu.tsx +++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx @@ -45,7 +45,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N }; public render() { const navigation = _.map(this.props.topLevelMenu, (menuItems: string[], sectionName: string) => { - const finalSectionName = sectionName.replace(/-/g, ' '); + const finalSectionName = utils.convertDashesToSpaces(sectionName); if (this.props.shouldDisplaySectionHeaders) { const id = utils.getIdFromName(sectionName); return ( @@ -85,7 +85,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N : styles.menuItemWithoutHeaders; const menuItemInnerDivStyles = this.props.shouldDisplaySectionHeaders ? styles.menuItemInnerDivWithHeaders : {}; const menuItems = _.map(menuItemNames, menuItemName => { - const finalMenuItemName = menuItemName.replace(/-/g, ' '); + const finalMenuItemName = utils.convertDashesToSpaces(menuItemName); const id = utils.getIdFromName(menuItemName); return ( <div key={menuItemName}> |