Merge pull request #6635 from freesewing/fix-6594
Fix various small issues with the sitenav structure
This commit is contained in:
commit
e1d89ddb9f
3 changed files with 8 additions and 10 deletions
|
@ -26,9 +26,10 @@ const onActivePath = (slug, active) => (active ? active.slice(0, slug.length) ==
|
|||
* This is a recursive function, so it needs to be lean
|
||||
*/
|
||||
const RenderTree = ({ tree, recurse, depth = 1, level = 0, active = false }) => {
|
||||
const orderedTree = orderBy(tree, ['o', 't'], ['asc', 'asc']).filter(
|
||||
(item) => typeof item === 'object'
|
||||
)
|
||||
const orderedTree = orderBy(tree, ['o', 't'], ['asc', 'asc'])
|
||||
.filter((item) => typeof item === 'object')
|
||||
.filter((item) => !item.h)
|
||||
.filter((item) => !item._)
|
||||
|
||||
return (
|
||||
<ul className="w-full list">
|
||||
|
|
|
@ -198,15 +198,12 @@ export const extendSiteNav = async (siteNav, lang) => {
|
|||
h: 1,
|
||||
t: t('patrons:freeSewingPatrons'),
|
||||
join: {
|
||||
_: 1,
|
||||
s: 'join',
|
||||
h: 1,
|
||||
t: t('patrons:joinPatrons'),
|
||||
s: 'patrons/join',
|
||||
t: t('patrons:joinThePatrons'),
|
||||
},
|
||||
thanks: {
|
||||
_: 1,
|
||||
s: 'thanks',
|
||||
h: 1,
|
||||
t: t('patrons:thankYouVeryMuch'),
|
||||
},
|
||||
}
|
||||
|
@ -219,7 +216,7 @@ export const extendSiteNav = async (siteNav, lang) => {
|
|||
t: t('patrons:donate'),
|
||||
thanks: {
|
||||
_: 1,
|
||||
s: 'thanks',
|
||||
s: 'patrons/thanks',
|
||||
h: 1,
|
||||
t: t('patrons:thankYouVeryMuch'),
|
||||
},
|
||||
|
|
|
@ -339,7 +339,7 @@ export const hasRequiredMeasurements = (Design, measies = {}, DesignIsMeasuremen
|
|||
* 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
|
||||
Object.keys(page).filter((key) => !['t', 's', 'o', 'b', 'h', '_'].includes(key)).length > 0
|
||||
|
||||
/*
|
||||
* Returns the slug of the page above this one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue