no breadcrumbs on home

This commit is contained in:
Thomas Ruoff
2020-12-25 00:54:39 +01:00
parent bb5f94491f
commit 6bff2a1fae

View File

@@ -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 (