mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
feat(resources): remove dashes in breadcrumbs
This commit is contained in:
@@ -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 <SC.StyledLink to={item.path}>{capitalize(item.title)}</SC.StyledLink>
|
||||
return <SC.StyledLink to={item.path}>{humanize(item.title)}</SC.StyledLink>
|
||||
}
|
||||
|
||||
function flatten([
|
||||
|
||||
Reference in New Issue
Block a user