mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
back to simpler
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user