1
0
Fork 0

Merge pull request #6635 from freesewing/fix-6594

Fix various small issues with the sitenav structure
This commit is contained in:
Joost De Cock 2024-04-27 17:35:44 +02:00 committed by GitHub
commit e1d89ddb9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 10 deletions

View file

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

View file

@ -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'),
},

View file

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