Skip to content

Commit

Permalink
add proper icons
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Nov 10, 2023
1 parent 429947c commit 663edde
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 18 additions & 1 deletion frontend-v2/src/features/main/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ import ErrorIcon from '@mui/icons-material/Error';
import { Tooltip } from '@mui/material';
import { useCombinedModelListQuery, useProjectRetrieveQuery, useProtocolListQuery } from '../../app/backendApi';
import { Protocol } from "../../app/backendApi";
import DnsIcon from '@mui/icons-material/Dns';
import BiotechIcon from '@mui/icons-material/Biotech';
import FunctionsIcon from '@mui/icons-material/Functions';
import VaccinesIcon from '@mui/icons-material/Vaccines';
import SsidChartIcon from '@mui/icons-material/SsidChart';
import ContactSupportIcon from '@mui/icons-material/ContactSupport';
import TableViewIcon from '@mui/icons-material/TableView';

const drawerWidth = 240;

Expand Down Expand Up @@ -56,6 +63,16 @@ export default function Sidebar() {
</Tooltip>
)
}

let icons: { [key: string]: React.ReactNode } = {
[PageName.PROJECTS]: <DnsIcon />,
[PageName.DRUG]: <BiotechIcon />,
[PageName.MODEL]: <FunctionsIcon />,
[PageName.TRIAL_DESIGN]: <VaccinesIcon />,
[PageName.DATA]: <TableViewIcon />,
[PageName.SIMULATIONS]: <SsidChartIcon />,
[PageName.HELP]: <ContactSupportIcon />,
};

const handleDrawerToggle = () => {
setMobileOpen(!mobileOpen);
Expand Down Expand Up @@ -111,7 +128,7 @@ export default function Sidebar() {
<ListItem key={key} disablePadding selected={isPageSelected(key)}>
<ListItemButton onClick={handlePageClick(key)} disabled={isPageDisabled(key)} disableRipple={true}>
<ListItemIcon>
{value in errorComponents ? errorComponents[value] : index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
{value in errorComponents ? errorComponents[value] : icons[value]}
</ListItemIcon>
<ListItemText primary={value} />
</ListItemButton>
Expand Down
1 change: 0 additions & 1 deletion frontend-v2/src/hooks/useDirty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useDispatch } from "react-redux";
import { decrementDirtyCount, incrementDirtyCount } from "../features/main/mainSlice";
import { useEffect, useState } from "react";
import usePrevious from "./usePrevious";

function useDirty(isDirty: boolean) {
const dispatch = useDispatch();
Expand Down

0 comments on commit 663edde

Please sign in to comment.