From c8dedb21f3943feb71146361686cf64c42fe3327 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 29 Dec 2020 22:43:35 +0100 Subject: [PATCH] back to simpler --- components/navigation.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/navigation.tsx b/components/navigation.tsx index cb2eb32..d3d028a 100644 --- a/components/navigation.tsx +++ b/components/navigation.tsx @@ -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 (
<> -

- - Home - -

- {'>'}

- - {pathLabel} - + {pathLabel}

{role === USER_ROLE.ADMIN && (