From 6bff2a1faeea2cc192c474e5d59daf53f383cd61 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Fri, 25 Dec 2020 00:54:39 +0100 Subject: [PATCH] no breadcrumbs on home --- components/breadcrumbs.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/breadcrumbs.tsx b/components/breadcrumbs.tsx index 8a7fa75..a74a9e8 100644 --- a/components/breadcrumbs.tsx +++ b/components/breadcrumbs.tsx @@ -7,12 +7,13 @@ export default function Breadcrumbs() { const { username, role } = useContext(UserContext) const router = useRouter() - const breadcrumbs = router.asPath.replace(/^\//, '').split('/') - - if (!breadcrumbs.length) { + const path = router.asPath + if (path.length === 0 || path === '/') { return null } + const breadcrumbs = path.replace(/^\//, '').split('/') + // TODO: translate routes // TODO: make entries linkable return (