Skip to content

Commit

Permalink
hide custom page from Nav (keystonejs#1906)
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamsi authored and timleslie committed Nov 8, 2019
1 parent 36db002 commit 15e8d58
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-pans-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

option to hide custom pages from Nav
22 changes: 12 additions & 10 deletions packages/app-admin-ui/client/components/Nav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,19 @@ function PrimaryNavItems({
};
let pageNavItems =
pages && pages.length
? pages.map(node =>
renderChildren(
node,
authListKey,
mouseIsOverNav,
getListByKey,
adminPath,
0,
onRenderIndexPage
? pages
.filter(node => node.addToNav !== false)
.map(node =>
renderChildren(
node,
authListKey,
mouseIsOverNav,
getListByKey,
adminPath,
0,
onRenderIndexPage
)
)
)
: listKeys.map(key =>
renderChildren(
key,
Expand Down

0 comments on commit 15e8d58

Please sign in to comment.