fix(shared): Apply sitenav filters to ReadMore MDX component
A while ago, I rewrote the sitenav component to *just* use the ReadMore MDX component to generate the navigation tree. However, sitenav have certain keys that you can set to control the visibility of hte item to the user, and those filters were not added to the ReadMore component, thus showing navigation items that should have been hidden.
This commit is contained in:
parent
248a52d360
commit
5ce91673b7
1 changed files with 4 additions and 3 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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue