Skip to content

Commit

Permalink
Revert "Added new default side nav component for Dashboard"
Browse files Browse the repository at this point in the history
This reverts commit 002475d.
  • Loading branch information
hawkishpolicy committed Apr 15, 2024
1 parent fe52a45 commit 94c0384
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 41 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/ReadySetCyber/RSCDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -38,7 +38,7 @@ export const RSCDashboard: React.FC = () => {
<Box sx={{ flexGrow: 1, padding: 2 }}>
<Grid container spacing={2}>
<Grid item xs={4}>
<RSCDefaultSideNav />
<RSCSideNav />
</Grid>
<Grid item xs={12} sm={8}>
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}>
Expand Down
27 changes: 0 additions & 27 deletions frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/ReadySetCyber/RSCDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const RSCDetail: React.FC = () => {
<Box sx={{ flexGrow: 1, padding: 2 }}>
<Grid container spacing={2}>
<Grid item xs={4}>
<RSCSideNav categories={categories} />
<RSCSideNav />
</Grid>
<Grid item xs={12} sm={8}>
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}>
Expand Down
18 changes: 7 additions & 11 deletions frontend/src/components/ReadySetCyber/RSCSideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props> = ({ categories }) => {
export const RSCSideNav: React.FC = () => {
const { id } = useParams<{ id: string }>();

const categories =
dummyResults.find((result) => result.id === parseInt(id))?.categories || [];

return (
<div>
<Box sx={{ width: '100%', maxWidth: 360, bgcolor: 'background.paper' }}>
<List>
<ListItem>Welcome User</ListItem>
<Divider component="li" />
{categories.map((category, index) => (
<RSCNavItem key={index} name={category.name} />
{categories.map((category) => (
<RSCNavItem key={category.id} name={category.name} />
))}
<ListItem>Take Questionnaire Again</ListItem>
<Divider component="li" />
Expand Down

0 comments on commit 94c0384

Please sign in to comment.