diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index e377039..0f4514f 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -17,16 +17,18 @@ const SidebarMenu = ({menuItems = [], children}) => { const elements = []; for (const menuItem of menuItems) { const { label, items: subItems = [], ...rest } = menuItem; + let subElements = null; - if (subItems.length) subElements = subItems.map(({ label, to, relative }) => { + if (subItems.length) subElements = subItems.map(({ label, to, relative = true }) => { if(relative) to = `${menuItem.to}${to}`; return {label}; }); - elements.push(
+ + elements.push(
{label} -
+ {subElements &&
{subElements} -
+
}
); }