From 971a46cadd17369c1f39dc92c20b86a00f0ce5f0 Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 12 Sep 2023 12:17:02 -0700 Subject: [PATCH] Add module count to navigation bar --- console/client/src/App.test.tsx | 2 + console/client/src/layout/Layout.tsx | 4 +- console/client/src/layout/Navigation.tsx | 64 +++++------------------- 3 files changed, 17 insertions(+), 53 deletions(-) diff --git a/console/client/src/App.test.tsx b/console/client/src/App.test.tsx index cd9ec8ecad..5a9159a90d 100644 --- a/console/client/src/App.test.tsx +++ b/console/client/src/App.test.tsx @@ -5,6 +5,8 @@ import { App } from './App' describe('App', () => { it('renders the app', () => { + window.history.pushState({}, 'Modules', '/modules') + render( diff --git a/console/client/src/layout/Layout.tsx b/console/client/src/layout/Layout.tsx index 9a59866e61..ec31c9eab8 100644 --- a/console/client/src/layout/Layout.tsx +++ b/console/client/src/layout/Layout.tsx @@ -1,10 +1,11 @@ import { Outlet } from 'react-router-dom' import { Navigation } from './Navigation' +import { Notification } from './Notification' import { SidePanel } from './SidePanel' export const Layout = () => { return ( -
+
@@ -14,6 +15,7 @@ export const Layout = () => {
+
) } diff --git a/console/client/src/layout/Navigation.tsx b/console/client/src/layout/Navigation.tsx index 0b2623ed0b..54ab8c345b 100644 --- a/console/client/src/layout/Navigation.tsx +++ b/console/client/src/layout/Navigation.tsx @@ -1,6 +1,8 @@ import { Schema, Timeline, ViewModuleSharp } from '@mui/icons-material' +import { useContext } from 'react' import { Link, NavLink } from 'react-router-dom' import { DarkModeSwitch } from '../components/DarkModeSwitch' +import { modulesContext } from '../providers/modules-provider' import { classNames } from '../utils' const navigation = [ @@ -10,6 +12,8 @@ const navigation = [ ] export const Navigation = () => { + const modules = useContext(modulesContext) + return (