diff --git a/client/src/components/Sidebar/SidebarMenu.js b/client/src/components/Sidebar/SidebarMenu.js index 6b0639049..e0d885be8 100644 --- a/client/src/components/Sidebar/SidebarMenu.js +++ b/client/src/components/Sidebar/SidebarMenu.js @@ -1,6 +1,6 @@ import React from 'react'; -import {Menu, MenuDivider} from "@blueprintjs/core"; -import {useHistory, useLocation} from 'react-router-dom'; +import { Menu, MenuDivider } from '@blueprintjs/core'; +import { useHistory, useLocation } from 'react-router-dom'; import sidebarMenuList from 'config/sidebarMenu'; import Icon from 'components/Icon'; import MenuItem from 'components/MenuItem'; @@ -12,38 +12,45 @@ export default function SidebarMenu() { const menuItemsMapper = (list) => { return list.map((item, index) => { - const children = Array.isArray(item.children) ? menuItemsMapper(item.children) : null; - const isActive = (item.href && item.href === location.pathname) || - (item.children && item.children.some((c) => c.href === location.pathname)); + const children = Array.isArray(item.children) + ? menuItemsMapper(item.children) + : null; + const isActive = + (item.href && item.href === location.pathname) || + (item.children && + item.children.some((c) => c.href === location.pathname)); const handleItemClick = () => { - if (item.href) { history.push(item.href); } + if (item.href) { + history.push(item.href); + } }; - return ( - (item.divider) ? - : - } - text={item.text} - label={item.label} - disabled={item.disabled} - children={children} - dropdownType={item.dropdownType || 'collapse'} - caretIconSize={15} - onClick={handleItemClick} - callapseActive={!!isActive} - itemClassName={classNames({ - 'is-active': isActive, - 'has-icon': !children && item.icon, - })} /> + return item.spacer ? ( +
+ ) : item.divider ? ( + + ) : ( + } + text={item.text} + label={item.label} + disabled={item.disabled} + children={children} + dropdownType={item.dropdownType || 'collapse'} + caretIconSize={15} + onClick={handleItemClick} + callapseActive={!!isActive} + itemClassName={classNames({ + 'is-active': isActive, + 'has-icon': !children && item.icon, + })} + /> ); }); }; const items = menuItemsMapper(sidebarMenuList); - - return ({items}); -}; + + return {items}; +} diff --git a/client/src/config/sidebarMenu.js b/client/src/config/sidebarMenu.js index b5f3b14f4..7ae10e79e 100644 --- a/client/src/config/sidebarMenu.js +++ b/client/src/config/sidebarMenu.js @@ -35,7 +35,7 @@ export default [ ], }, { - divider: true, + spacer: true, }, { icon: 'balance-scale', diff --git a/client/src/containers/Accounting/ManualJournalActionsBar.js b/client/src/containers/Accounting/ManualJournalActionsBar.js index 43fc278b8..030f6e9da 100644 --- a/client/src/containers/Accounting/ManualJournalActionsBar.js +++ b/client/src/containers/Accounting/ManualJournalActionsBar.js @@ -85,7 +85,7 @@ function ManualJournalActionsBar({ >