+
);
-}
+});
diff --git a/client/src/components/Dashboard/PrivatePages.js b/client/src/components/Dashboard/PrivatePages.js
index 0d0b5d06c..f49b356b7 100644
--- a/client/src/components/Dashboard/PrivatePages.js
+++ b/client/src/components/Dashboard/PrivatePages.js
@@ -17,16 +17,16 @@ export default function DashboardPrivatePages() {
return (
-
+ {/*
-
+ */}
-
+ {/* */}
-
+ {/* */}
diff --git a/client/src/components/Dashboard/PrivatePagesProvider.js b/client/src/components/Dashboard/PrivatePagesProvider.js
index 34db3a813..1e67ce2bc 100644
--- a/client/src/components/Dashboard/PrivatePagesProvider.js
+++ b/client/src/components/Dashboard/PrivatePagesProvider.js
@@ -7,10 +7,10 @@ import { useCurrentOrganization } from '../../hooks/query/organization';
*/
export function PrivatePagesProvider({ children }) {
// Fetches the current user's organization.
- const { isLoading } = useCurrentOrganization();
+ // const { isLoading } = useCurrentOrganization();
return (
-
+
{children}
)
diff --git a/client/src/components/Sidebar/Sidebar.js b/client/src/components/Sidebar/Sidebar.js
index 0cad24831..4dc1bc19a 100644
--- a/client/src/components/Sidebar/Sidebar.js
+++ b/client/src/components/Sidebar/Sidebar.js
@@ -1,12 +1,12 @@
import React from 'react';
-import { Menu, MenuItem } from '@blueprintjs/core';
import SidebarContainer from 'components/Sidebar/SidebarContainer';
import SidebarHead from 'components/Sidebar/SidebarHead';
import SidebarMenu from 'components/Sidebar/SidebarMenu';
+import SidebarOverlay from 'components/SidebarOverlay';
import 'style/containers/Dashboard/Sidebar.scss';
-export default function Sidebar() {
+export default function Sidebar({ dashboardContentRef }) {
return (
@@ -14,10 +14,8 @@ export default function Sidebar() {
-
-
+
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/client/src/components/Sidebar/SidebarMenu.js b/client/src/components/Sidebar/SidebarMenu.js
index 31275978c..8b665903c 100644
--- a/client/src/components/Sidebar/SidebarMenu.js
+++ b/client/src/components/Sidebar/SidebarMenu.js
@@ -6,11 +6,15 @@ import Icon from 'components/Icon';
import MenuItem from 'components/MenuItem';
import { MenuItemLabel } from 'components';
import classNames from 'classnames';
+import SidebarOverlay from 'components/SidebarOverlay';
export default function SidebarMenu() {
const history = useHistory();
const location = useLocation();
+ const [isOpen, setIsOpen] = React.useState(false);
+ const [currentItem, setCurrentItem] = React.useState(null);
+
const menuItemsMapper = (list) => {
return list.map((item, index) => {
const children = Array.isArray(item.children)
@@ -18,33 +22,41 @@ export default function SidebarMenu() {
: null;
const matchPath = (pathname, path) => {
- return item.matchExact ? pathname === path : pathname.indexOf(path) !== -1;
+ return item.matchExact
+ ? pathname === path
+ : pathname.indexOf(path) !== -1;
};
- const isActive = (item.children) ?
- item.children.some((c) => matchPath(location.pathname, c.href)) :
- (item.href && matchPath(location.pathname, item.href));
+ const isActive = item.children
+ ? item.children.some((c) => matchPath(location.pathname, c.href))
+ : item.href && matchPath(location.pathname, item.href);
const handleItemClick = () => {
if (item.href) {
history.push(item.href);
}
+ setIsOpen(true);
+ setCurrentItem(item);
};
- const maybeRenderLabel = (item) => item.newTabHref ? (
- }
- onClick={(event) => {
- history.push(item.newTabHref);
- event.stopPropagation();
- }}
- />
- ) : null;
+ const maybeRenderLabel = (item) =>
+ item.newTabHref ? (
+ }
+ onClick={(event) => {
+ history.push(item.newTabHref);
+ event.stopPropagation();
+ }}
+ />
+ ) : null;
return item.spacer ? (
-
+
) : item.divider ? (
) : item.label ? (
@@ -72,5 +84,14 @@ export default function SidebarMenu() {
};
const items = menuItemsMapper(sidebarMenuList);
- return ;
+ return (
+
+
{' '}
+
+
+
+ );
}
diff --git a/client/src/components/SidebarOverlay/SidebarOverlayContainer.tsx b/client/src/components/SidebarOverlay/SidebarOverlayContainer.tsx
new file mode 100644
index 000000000..0122127e1
--- /dev/null
+++ b/client/src/components/SidebarOverlay/SidebarOverlayContainer.tsx
@@ -0,0 +1,19 @@
+import React from 'react';
+import { Scrollbar } from 'react-scrollbars-custom';
+
+interface ISidebarOverlayContainerProps {
+ children: JSX.Element | JSX.Element[],
+}
+
+/**
+ * Sidebar overlay container.
+ */
+export default function SidebarOverlayContainer({ children }: ISidebarOverlayContainerProps) {
+ return (
+
+ );
+}
diff --git a/client/src/components/SidebarOverlay/index.tsx b/client/src/components/SidebarOverlay/index.tsx
new file mode 100644
index 000000000..e5759fc1c
--- /dev/null
+++ b/client/src/components/SidebarOverlay/index.tsx
@@ -0,0 +1,90 @@
+import React from 'react';
+import { Overlay } from '@blueprintjs/core';
+import { Link } from 'react-router-dom';
+import SidebarOverlayContainer from './SidebarOverlayContainer';
+
+interface ISidebarOverlayItem {
+ text: string;
+ href: string;
+ divider?: boolean;
+ label?: boolean
+}
+
+interface ISidebarOverlayProps {
+ isOpen: boolean;
+ items: ISidebarOverlayItem[];
+ overlayProps: any;
+ overlayContainerRef: any;
+}
+
+interface ISidebarOverlayItemProps {
+ text: string;
+ href: string;
+}
+
+interface ISidebarOverlayItemDivider {
+ divider: boolean;
+}
+/**
+ * Sidebar overlay item.
+ */
+function SidebarOverlayItem({ text, href }: ISidebarOverlayItemProps) {
+ return (
+
+ {text}
+
+ );
+}
+
+interface ISidebarOverlayItemLabel {
+ text: string;
+}
+
+function SidebarOverlayLabel({ text }: ISidebarOverlayItemLabel) {
+ return {text}
;
+}
+
+function SidebarOverlayDivider() {
+ return ;
+}
+
+/**
+ * Sidebar overlay component.
+ */
+export default function SidebarOverlay({
+ isOpen = false,
+ items,
+}: ISidebarOverlayProps) {
+ //
+ if (!isOpen) {
+ return '';
+ }
+
+ const handleOverlayClose = () => {
+
+ };
+
+ return (
+
+
+
+
+ {items.map((item) =>
+ item.divider ? (
+
+ ) : item.label ? (
+
+ ) : (
+
+ ),
+ )}
+
+
+
+
+ );
+}
diff --git a/client/src/config/sidebarMenu.js b/client/src/config/sidebarMenu.js
index d5ff66556..02fa39ce6 100644
--- a/client/src/config/sidebarMenu.js
+++ b/client/src/config/sidebarMenu.js
@@ -137,6 +137,7 @@ export default [
text: ,
href: '/financial-reports',
matchExact: true,
+ label: true
},
{
divider: true,
diff --git a/client/src/style/App.scss b/client/src/style/App.scss
index 9426135d6..a014aa95d 100644
--- a/client/src/style/App.scss
+++ b/client/src/style/App.scss
@@ -47,11 +47,13 @@ body.hide-scrollbar .Pane2 {
}
.bp3-fill {
+
.bp3-popover-wrapper,
.bp3-popover-target {
display: block;
width: 100%;
}
+
.bp3-button {
width: 100%;
justify-content: start;
@@ -61,6 +63,7 @@ body.hide-scrollbar .Pane2 {
.bp3-datepicker-caption .bp3-html-select::after {
margin-right: 6px;
}
+
.bp3-select-popover .bp3-menu {
max-height: 300px;
max-width: 400px;
@@ -100,27 +103,21 @@ body.hide-scrollbar .Pane2 {
background-color: rgba(0, 10, 30, 0.7);
}
-.ReactVirtualized__Collection {
-}
+.ReactVirtualized__Collection {}
-.ReactVirtualized__Collection__innerScrollContainer {
-}
+.ReactVirtualized__Collection__innerScrollContainer {}
/* Grid default theme */
-.ReactVirtualized__Grid {
-}
+.ReactVirtualized__Grid {}
-.ReactVirtualized__Grid__innerScrollContainer {
-}
+.ReactVirtualized__Grid__innerScrollContainer {}
/* Table default theme */
-.ReactVirtualized__Table {
-}
+.ReactVirtualized__Table {}
-.ReactVirtualized__Table__Grid {
-}
+.ReactVirtualized__Table__Grid {}
.ReactVirtualized__Table__headerRow {
font-weight: 700;
@@ -129,6 +126,7 @@ body.hide-scrollbar .Pane2 {
flex-direction: row;
align-items: center;
}
+
.ReactVirtualized__Table__row {
display: flex;
flex-direction: row;
@@ -148,6 +146,7 @@ body.hide-scrollbar .Pane2 {
margin-right: 10px;
min-width: 0px;
}
+
.ReactVirtualized__Table__rowColumn {
text-overflow: ellipsis;
white-space: nowrap;
@@ -157,6 +156,7 @@ body.hide-scrollbar .Pane2 {
.ReactVirtualized__Table__rowColumn:first-of-type {
margin-left: 10px;
}
+
.ReactVirtualized__Table__sortableHeaderColumn {
cursor: pointer;
}
@@ -165,32 +165,115 @@ body.hide-scrollbar .Pane2 {
display: flex;
align-items: center;
}
+
.ReactVirtualized__Table__sortableHeaderIcon {
flex: 0 0 24px;
height: 1em;
width: 1em;
fill: currentColor;
}
-.ReactVirtualized__Grid, .ReactVirtualized__List { direction: inherit !important; }
-/* List default theme */
+.ReactVirtualized__Grid,
.ReactVirtualized__List {
+ direction: inherit !important;
}
+/* List default theme */
-.bp3-drawer{
+.ReactVirtualized__List {}
+
+
+.bp3-drawer {
box-shadow: 0 0 0;
}
// RTL Icons.
html[dir="rtl"] {
- .bp3-icon-caret-right{
+ .bp3-icon-caret-right {
transform: scaleX(-1);
}
}
html[lang^="ar"] {
- body{
+ body {
letter-spacing: -0.01rem;
}
+}
+
+
+.sidebar-overlay {
+ background: #fff;
+ height: 100%;
+ width: 300px;
+
+ &__scroll-wrapper {
+ height: 100%
+ }
+
+ .ScrollbarsCustom-Track {
+
+ &.ScrollbarsCustom-TrackY,
+ &.ScrollbarsCustom-TrackX {
+ background: rgba(0, 0, 0, 0);
+ }
+ }
+
+ .ScrollbarsCustom-Thumb {
+
+ &.ScrollbarsCustom-ThumbX,
+ &.ScrollbarsCustom-ThumbY {
+ background: rgba(0, 0, 0, 0);
+ }
+ }
+
+ .ScrollbarsCustom-Content {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ }
+
+ &:hover {
+ .ScrollbarsCustom-Thumb {
+
+ &.ScrollbarsCustom-ThumbX,
+ &.ScrollbarsCustom-ThumbY {
+ background: rgba(255, 255, 255, 0.25);
+ }
+ }
+ }
+
+ &__menu {
+ margin: 20px 0;
+ }
+
+ &__item {
+ font-size: 15px;
+ color: #032259;
+
+ a {
+ color: inherit;
+ display: block;
+ padding: 9px 22px;
+ text-decoration: none;
+
+ &:hover,
+ &:focus{
+ background: #f3f3f3;
+ }
+ }
+ }
+
+ &__divider {
+ height: 1px;
+ margin: 4px 0;
+ background: #ebebeb;
+ }
+
+ &__label{
+ text-transform: uppercase;
+ font-size: 12px;
+ padding: 4px 20px;
+ letter-spacing: 0.8px;
+ color: #707a85;
+ }
}
\ No newline at end of file
diff --git a/client/src/style/containers/Dashboard/Sidebar.scss b/client/src/style/containers/Dashboard/Sidebar.scss
index 66ba237a3..392a31d0e 100644
--- a/client/src/style/containers/Dashboard/Sidebar.scss
+++ b/client/src/style/containers/Dashboard/Sidebar.scss
@@ -6,6 +6,7 @@
color: $sidebar-text-color;
height: 100%;
z-index: $sidebar-zindex;
+ position: relative;
.ScrollbarsCustom-Track {
@@ -347,5 +348,11 @@
margin-left: 12px;
font-weight: 600;
}
+
+ &__divider{
+ margin: 4px 0;
+ height: 1px;
+ background: #ebebeb;
+ }
}
}
diff --git a/client/src/style/variables.scss b/client/src/style/variables.scss
index 02561ebe9..38f267d88 100644
--- a/client/src/style/variables.scss
+++ b/client/src/style/variables.scss
@@ -15,7 +15,7 @@ $menu-item-color-active: $light-gray3;
$breadcrumbs-collapsed-icon: url("data:image/svg+xml,");
-$sidebar-zindex: 15;
+$sidebar-zindex: 21;
$pt-font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont,
Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue,
Icons16, sans-serif;