Display camelCase names all-caps properly

This commit is contained in:
Fabio Berger
2018-08-03 18:28:56 +02:00
parent 36d615318d
commit a728247d6c
3 changed files with 24 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd
const { sectionName, markdownContent, headerSize, githubLink } = this.props as PropsWithDefaults;
const id = utils.getIdFromName(sectionName);
const finalSectionName = utils.convertDashesToSpaces(sectionName);
const finalSectionName = utils.convertCamelCaseToSpaces(sectionName);
return (
<div
className="md-px1 sm-px2 overflow-hidden"

View File

@@ -45,7 +45,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
};
public render(): React.ReactNode {
const navigation = _.map(this.props.topLevelMenu, (menuItems: string[], sectionName: string) => {
const finalSectionName = utils.convertDashesToSpaces(sectionName);
const finalSectionName = utils.convertCamelCaseToSpaces(sectionName);
if (this.props.shouldDisplaySectionHeaders) {
// tslint:disable-next-line:no-unused-variable
const id = utils.getIdFromName(sectionName);