1
0
Fork 0

chore: Fix icon view for nav

This commit is contained in:
Joost De Cock 2023-03-26 08:49:21 +02:00
parent 4697fbd999
commit 1745469bb0
5 changed files with 20 additions and 14 deletions

View file

@ -37,13 +37,14 @@ const createSections = () => {
export const loadNavigation = (path = []) => {
// Creat crumbs array
const crumbs = createCrumbs(path)
const sections = createSections()
return {
path,
slug: path.join('/'),
crumbs,
sections: createSections(),
nav: path.length > 1 ? get(pbn.en, path[0]) : pbn.en[path[0]],
title: crumbs.slice(-1)[0].t,
sections,
nav: path.length > 1 ? get(pbn.en, path[0]) : path.length === 0 ? sections : pbn.en[path[0]],
title: crumbs.length > 0 ? crumbs.slice(-1)[0].t : '',
}
}