mirror of
https://github.com/gosticks/web.git
synced 2026-10-05 14:16:57 +00:00
Add support for custom components in the sidebar
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user