diff --git a/src/components/ResourceBreadcrumb/index.tsx b/src/components/ResourceBreadcrumb/index.tsx index d9d3b0b..5637a8f 100644 --- a/src/components/ResourceBreadcrumb/index.tsx +++ b/src/components/ResourceBreadcrumb/index.tsx @@ -1,3 +1,4 @@ +import pipe from "ramda/es/pipe" import React from "react" import ChevronUp from "../../icons/chevron-up.svg" @@ -16,8 +17,19 @@ function capitalize(str: string): string { .join(" ") } +function dashToSpace(str: string): string { + return str.replace("-", " ") +} + +function humanize(str: string): string { + return pipe( + dashToSpace, + capitalize + )(str) +} + function Link({ item }: { item: IFileOrFolder }) { - return {capitalize(item.title)} + return {humanize(item.title)} } function flatten([