1
0
Fork 0

feat(dev/shared): Ported PrevNext component to new nav structure

This commit is contained in:
joostdecock 2023-07-14 09:23:37 +02:00
parent b89d0474ef
commit 0a8dd5f111
10 changed files with 145 additions and 133 deletions

View file

@ -304,3 +304,10 @@ export const hasRequiredMeasurements = (Design, measies = {}, DesignIsMeasuremen
return [missing.length === 0, missing]
}
/*
* This expects a object from the nav tree and will filter out the know 1-char keys
* and then check if there are any left. If there are, those are child-pages.
*/
export const pageHasChildren = (page) =>
Object.keys(page).filter((key) => !['t', 's', 'o', 'b', 'h'].includes(key)).length > 0