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
|
* This is a recursive function, so it needs to be lean
|
||||||
*/
|
*/
|
||||||
const RenderTree = ({ tree, recurse, depth = 1, level = 0, active = false }) => {
|
const RenderTree = ({ tree, recurse, depth = 1, level = 0, active = false }) => {
|
||||||
const orderedTree = orderBy(tree, ['o', 't'], ['asc', 'asc']).filter(
|
const orderedTree = orderBy(tree, ['o', 't'], ['asc', 'asc'])
|
||||||
(item) => typeof item === 'object'
|
.filter((item) => typeof item === 'object')
|
||||||
)
|
.filter((item) => !item.h)
|
||||||
|
.filter((item) => !item._)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className="w-full list">
|
<ul className="w-full list">
|
||||||
|
|
|
@ -198,15 +198,12 @@ export const extendSiteNav = async (siteNav, lang) => {
|
||||||
h: 1,
|
h: 1,
|
||||||
t: t('patrons:freeSewingPatrons'),
|
t: t('patrons:freeSewingPatrons'),
|
||||||
join: {
|
join: {
|
||||||
_: 1,
|
s: 'patrons/join',
|
||||||
s: 'join',
|
t: t('patrons:joinThePatrons'),
|
||||||
h: 1,
|
|
||||||
t: t('patrons:joinPatrons'),
|
|
||||||
},
|
},
|
||||||
thanks: {
|
thanks: {
|
||||||
_: 1,
|
_: 1,
|
||||||
s: 'thanks',
|
s: 'thanks',
|
||||||
h: 1,
|
|
||||||
t: t('patrons:thankYouVeryMuch'),
|
t: t('patrons:thankYouVeryMuch'),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -219,7 +216,7 @@ export const extendSiteNav = async (siteNav, lang) => {
|
||||||
t: t('patrons:donate'),
|
t: t('patrons:donate'),
|
||||||
thanks: {
|
thanks: {
|
||||||
_: 1,
|
_: 1,
|
||||||
s: 'thanks',
|
s: 'patrons/thanks',
|
||||||
h: 1,
|
h: 1,
|
||||||
t: t('patrons:thankYouVeryMuch'),
|
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.
|
* and then check if there are any left. If there are, those are child-pages.
|
||||||
*/
|
*/
|
||||||
export const pageHasChildren = (page) =>
|
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
|
* Returns the slug of the page above this one
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue