back to simpler

This commit is contained in:
Thomas Ruoff
2020-12-29 22:43:35 +01:00
parent f26e995edb
commit c8dedb21f3

View File

@@ -16,9 +16,7 @@ const pathNameLabelMap = {
}
function getPathNameMap(route: string) {
const name = pathNameLabelMap[route]
return name || route
return pathNameLabelMap[route]
}
export default function Navigation() {
@@ -31,21 +29,16 @@ export default function Navigation() {
}
const pathLabel = getPathNameMap(pathname)
const path = router.asPath
if (!pathLabel && role !== USER_ROLE.ADMIN) {
return null
}
return (
<div className="flex flex-row items-center px-3 py-1 text-white text-base bg-blue-400 rounded-b-sm">
<>
<h2 className="mr-1">
<Link href="/">
<a className="font-extrabold">Home</a>
</Link>
</h2>
{'>'}
<h2 className="mx-1">
<Link href={path}>
<a className="font-extrabold">{pathLabel}</a>
</Link>
<span className="font-extrabold">{pathLabel}</span>
</h2>
{role === USER_ROLE.ADMIN && (
<Link href="/admin">