Add support for custom components in the sidebar

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2019-01-16 22:16:48 -08:00
parent e7242fa61f
commit 97bd418ced
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -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 <item.customComponent key={index} />;
}
// At this point it's ok to show the item
return item.children
? navDropdown(item, index, props)
+4
View File
@@ -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);
}