From 97bd418ced951b291c465fb3e341a3266fa4726f Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Wed, 16 Jan 2019 22:16:48 -0800 Subject: [PATCH] Add support for custom components in the sidebar Signed-off-by: Mcat12 --- src/components/common/Sidebar.js | 5 +++++ src/containers/Full.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/components/common/Sidebar.js b/src/components/common/Sidebar.js index 99b64aa..ca793bd 100644 --- a/src/components/common/Sidebar.js +++ b/src/components/common/Sidebar.js @@ -54,6 +54,11 @@ export const navList = (items, props) => // Some items (login page) should only be shown when logged in or logged out, not both if (item.authStrict && item.auth !== api.loggedIn) return null; + // Check if it's a custom component + if (item.customComponent !== undefined) { + return ; + } + // At this point it's ok to show the item return item.children ? navDropdown(item, index, props) diff --git a/src/containers/Full.js b/src/containers/Full.js index b0f011a..e006309 100644 --- a/src/containers/Full.js +++ b/src/containers/Full.js @@ -41,6 +41,10 @@ export default props => ( * @param routeData the route data (see routes.js) */ const createRoute = routeData => { + if (routeData.fakeRoute === true) { + return; + } + if (routeData.children) { return routeData.children.map(createRoute); }