diff --git a/client/src/components/App.js b/client/src/components/App.js index f851f4234..655023182 100644 --- a/client/src/components/App.js +++ b/client/src/components/App.js @@ -48,7 +48,7 @@ function App({ locale }) {
- + {/* */} diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js index 879fb77e3..a78a6f322 100644 --- a/client/src/components/Dashboard/Dashboard.js +++ b/client/src/components/Dashboard/Dashboard.js @@ -17,6 +17,8 @@ import DrawersContainer from 'components/DrawersContainer'; * Dashboard page. */ export default function Dashboard() { + const dashboardContentRef = React.createRef(); + return ( @@ -29,8 +31,8 @@ export default function Dashboard() { - - + + diff --git a/client/src/components/Dashboard/DashboardContent.js b/client/src/components/Dashboard/DashboardContent.js index 506469501..a783f1af3 100644 --- a/client/src/components/Dashboard/DashboardContent.js +++ b/client/src/components/Dashboard/DashboardContent.js @@ -5,14 +5,14 @@ import DashboardContentRoute from 'components/Dashboard/DashboardContentRoute'; import DashboardFooter from 'components/Dashboard/DashboardFooter'; import DashboardErrorBoundary from './DashboardErrorBoundary'; -export default function () { +export default React.forwardRef(({}, ref) => { return ( -
+
); -} +}); 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 ? ( -