Skip to content

Commit

Permalink
feat: hide unfinished components (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Feb 23, 2022
1 parent 7303b8a commit a89df67
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SideBarLink = (props) => {
class: { 'sidebar-link-item': true, active },
href: link
}, [
status && h('span', {
(status && import.meta.env.DEV) && h('span', {
class: 'sidebar-link-status',
style: `background-color: ${dotColor}`
}),
Expand All @@ -71,7 +71,8 @@ function resolveLink(base, path) {
function createChildren(active, children, headers, depth = 1) {
if (children && children.length > 0) {
return h('ul', { class: 'sidebar-links' }, children.map((c) => {
return h(SideBarLink, { item: c, depth });
const showSidebarItem = import.meta.env.DEV || (import.meta.env.PROD && c.status === '100%');
return showSidebarItem && h(SideBarLink, { item: c, depth });
}));
}
return active && headers
Expand Down

0 comments on commit a89df67

Please sign in to comment.