From 94c0384a0a167ece135d0941252491948868a695 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 15 Apr 2024 11:06:08 -0400 Subject: [PATCH] Revert "Added new default side nav component for Dashboard" This reverts commit 002475d3893ba9bbed8e203cadac21632496df60. --- .../components/ReadySetCyber/RSCDashboard.tsx | 4 +-- .../ReadySetCyber/RSCDefaultSideNav.tsx | 27 ------------------- .../components/ReadySetCyber/RSCDetail.tsx | 2 +- .../components/ReadySetCyber/RSCSideNav.tsx | 18 +++++-------- 4 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx diff --git a/frontend/src/components/ReadySetCyber/RSCDashboard.tsx b/frontend/src/components/ReadySetCyber/RSCDashboard.tsx index 879b5c96..5b4ee638 100644 --- a/frontend/src/components/ReadySetCyber/RSCDashboard.tsx +++ b/frontend/src/components/ReadySetCyber/RSCDashboard.tsx @@ -3,7 +3,7 @@ import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Stack from '@mui/material/Stack'; import Divider from '@mui/material/Divider'; -import { RSCDefaultSideNav } from './RSCDefaultSideNav'; +import { RSCSideNav } from './RSCSideNav'; import { RSCResult } from './RSCResult'; import { useAuthContext } from 'context'; @@ -38,7 +38,7 @@ export const RSCDashboard: React.FC = () => { - + diff --git a/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx b/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx deleted file mode 100644 index 5c76bfa4..00000000 --- a/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -// import { useParams } from 'react-router-dom'; -import Box from '@mui/material/Box'; -import List from '@mui/material/List'; -import ListItem from '@mui/material/ListItem'; -import Divider from '@mui/material/Divider'; -// import { RSCNavItem } from './RSCNavItem'; -// import { dummyResults } from './dummyData'; - -export const RSCDefaultSideNav: React.FC = () => { - // const categories = - // dummyResults.find((result) => result.id === parseInt(id))?.categories || []; - - return ( -
- - - Welcome User - - Take Questionnaire Again - - Logout - - -
- ); -}; diff --git a/frontend/src/components/ReadySetCyber/RSCDetail.tsx b/frontend/src/components/ReadySetCyber/RSCDetail.tsx index f2324ee0..b68bbb6d 100644 --- a/frontend/src/components/ReadySetCyber/RSCDetail.tsx +++ b/frontend/src/components/ReadySetCyber/RSCDetail.tsx @@ -46,7 +46,7 @@ export const RSCDetail: React.FC = () => { - + diff --git a/frontend/src/components/ReadySetCyber/RSCSideNav.tsx b/frontend/src/components/ReadySetCyber/RSCSideNav.tsx index 1837cc47..e9a38c6f 100644 --- a/frontend/src/components/ReadySetCyber/RSCSideNav.tsx +++ b/frontend/src/components/ReadySetCyber/RSCSideNav.tsx @@ -5,26 +5,22 @@ import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import Divider from '@mui/material/Divider'; import { RSCNavItem } from './RSCNavItem'; +import { dummyResults } from './dummyData'; -interface Props { - categories: Categories[]; -} - -export interface Categories { - name: string; -} - -export const RSCSideNav: React.FC = ({ categories }) => { +export const RSCSideNav: React.FC = () => { const { id } = useParams<{ id: string }>(); + const categories = + dummyResults.find((result) => result.id === parseInt(id))?.categories || []; + return (
Welcome User - {categories.map((category, index) => ( - + {categories.map((category) => ( + ))} Take Questionnaire Again