From b0d53e4fadff13a443bf5444f8c9d37dd02e5fe6 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Mon, 1 Jun 2020 18:22:29 +0200 Subject: [PATCH] - Re-shape dashboard icons in 16 and 24 grid. --- client/src/components/Sidebar/SidebarMenu.js | 67 +++---- client/src/config/sidebarMenu.js | 2 +- .../Accounting/ManualJournalActionsBar.js | 10 +- .../Accounting/ManualJournalsDataTable.js | 2 +- .../containers/Accounts/AccountsActionsBar.js | 24 +-- .../containers/Accounts/AccountsDataTable.js | 2 +- .../ExchangeRates/ExchangeRateActionsBar.js | 33 ++-- .../ExchangeRates/ExchangeRateTable.js | 2 +- .../BalanceSheet/BalanceSheetActionsBar.js | 9 +- .../FinancialStatementDateRange.js | 6 +- .../GeneralLedger/GeneralLedgerActionsBar.js | 9 +- .../Journal/JournalActionsBar.js | 8 +- .../ProfitLossSheet/ProfitLossActionsBar.js | 6 +- .../TrialBalanceActionsBar.js | 6 +- .../containers/Items/ItemCategoriesList.js | 44 ++--- .../containers/Items/ItemCategoriesTable.js | 164 ++++++++++-------- .../src/containers/Items/ItemsActionsBar.js | 46 ++--- .../Items/ItemsCategoryActionsBar.js | 2 +- client/src/containers/Items/ItemsDataTable.js | 6 +- client/src/static/json/icons.js | 85 ++++++--- client/src/style/components/data-table.scss | 4 + client/src/style/pages/accounts-chart.scss | 2 +- client/src/style/pages/dashboard.scss | 4 +- .../src/style/pages/financial-statements.scss | 4 +- client/src/style/views/Sidebar.scss | 16 +- 25 files changed, 311 insertions(+), 252 deletions(-) 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({ >