diff --git a/CoVAR-app/src/adminTools/components/userList.tsx b/CoVAR-app/src/adminTools/components/userList.tsx index 3093f08..4a1cdbf 100644 --- a/CoVAR-app/src/adminTools/components/userList.tsx +++ b/CoVAR-app/src/adminTools/components/userList.tsx @@ -297,46 +297,53 @@ const UserList = () => { sx={{ height: 600, flex: '1 auto', - '& .MuiDataGrid-root': { - bgcolor: '#52796F', - color: '#CAD2C5', - borderColor: '#52796F', - }, - '& .MuiDataGrid-columnHeader': { - backgroundColor: '#2F3E46', - color: '#CAD2C5', - }, + fontWeight: 500, + borderColor: 'text.primary', '& .MuiDataGrid-columnHeaderTitle': { - color: '#CAD2C5', + color: 'text.primary', }, '& .MuiDataGrid-columnSeparator': { - color: '#52796F', + color: 'text.primary', }, '& .MuiDataGrid-cell': { - color: '#CAD2C5', - borderColor: '#52796F', + color: 'text.primary', + borderColor: 'text.primary', }, '& .MuiDataGrid-footerContainer': { - backgroundColor: '#2F3E46', - color: '#CAD2C5', + backgroundColor: 'background.paper', + color: 'text.primary', }, '& .MuiTablePagination-root': { - color: '#CAD2C5', + color: 'text.primary', }, '& .MuiSvgIcon-root': { - color: '#CAD2C5', + color: 'text.primary', }, '& .MuiDataGrid-toolbarContainer button': { - color: '#CAD2C5', + color: 'text.primary', }, '& .MuiDataGrid-topContainer, & .MuiDataGrid-container--top': { - backgroundColor: '#52796F', + backgroundColor: 'primary.main', }, '& .MuiDataGrid-overlay': { - backgroundColor: '#1F282E', - color: '#CAD2C5', + backgroundColor: 'background.default', + color: 'text.primary', + }, + '& .MuiDataGrid-filler': { + backgroundColor: 'background.paper', + color: 'text.primary', + }, + '& .MuiDataGrid-scrollbarFiller': { + backgroundColor: 'background.paper', + }, + '& .MuiDataGrid-scrollbarFiller--header': { + backgroundColor: 'background.paper', + }, + '& .MuiDataGrid-columnHeader': { + backgroundColor: 'background.paper', + color: 'text.primary', }, - }} + }} /> { @@ -15,7 +14,6 @@ const Evaluate: React.FC = () => { }; const handleSubmitFile = () => { - // Handle file submit console.log('File submitted:', selectedFile); }; @@ -23,7 +21,7 @@ const Evaluate: React.FC = () => { return ( - + Upload a Vulnerability Assessment { {selectedFile && ( <> - + Selected File: {selectedFile.name} - + - Change Organisation Name + Change Organisation Name setOrganisationName(e.target.value)} - sx={{ - '& .MuiOutlinedInput-root': { - '& fieldset': { - borderColor: '#CAD2C5', - }, - '&:hover fieldset': { - borderColor: '#CAD2C5', - }, - '&.Mui-focused fieldset': { - borderColor: '#52796F', - }, - }, - }} + sx={textFieldStyles} /> -
-
+ +
+
+ + + Disband Organisation + setConfirmOrganisationName(e.target.value)} + sx={textFieldStyles} + /> +

+

diff --git a/CoVAR-app/src/sidebar/sidebar.tsx b/CoVAR-app/src/sidebar/sidebar.tsx index 1d94c29..5ec2e56 100644 --- a/CoVAR-app/src/sidebar/sidebar.tsx +++ b/CoVAR-app/src/sidebar/sidebar.tsx @@ -1,6 +1,6 @@ -import React, { useContext} from 'react'; +import React, { useContext } from 'react'; import { Link, useLocation, useNavigate } from 'react-router-dom'; -import { Box, List, ListItem, ListItemText, ListItemIcon, Typography, Button } from '@mui/material'; +import { Box, List, ListItem, ListItemText, ListItemIcon, Typography, Button, useTheme } from '@mui/material'; import DashboardIcon from '@mui/icons-material/Dashboard'; import AssessmentIcon from '@mui/icons-material/Assessment'; import AccountCircleIcon from '@mui/icons-material/AccountCircle'; @@ -9,19 +9,25 @@ import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings'; import ExitToAppIcon from '@mui/icons-material/ExitToApp'; import LockIcon from '@mui/icons-material/Lock'; import GroupsIcon from '@mui/icons-material/Groups'; -import { sidebarStyles, sidebarItemStyles, iconStyles, logoStyles, logoutButtonStyles } from '../styles/sidebarStyle'; +import { + sidebarStyles, + sidebarItemStyles, + iconStyles, + logoStyles, + logoutButtonStyles +} from '../styles/sidebarStyle'; import { doSignOut } from '../firebase/auth'; import useUserRole from './components/userRole'; import { ThemeContext } from '../styles/customThemeProvider'; const Sidebar: React.FC = () => { const userRole = useUserRole(); - const isAdmin = userRole === 'admin'; const isVA = userRole === 'VA'; const navigate = useNavigate(); const location = useLocation(); + const theme = useTheme(); const signOut = async () => { try { @@ -41,48 +47,128 @@ const Sidebar: React.FC = () => { ); }; + const isActive = (path: string) => location.pathname === path; + return ( - CoVAR + CoVAR - - - + + + {(isAdmin || isVA) && ( - - - + + + )} - - - + + + - - - + + + - - - + + + {isAdmin && ( - - - + + + diff --git a/CoVAR-app/src/styles/customThemeProvider.tsx b/CoVAR-app/src/styles/customThemeProvider.tsx index 0498538..27171ee 100644 --- a/CoVAR-app/src/styles/customThemeProvider.tsx +++ b/CoVAR-app/src/styles/customThemeProvider.tsx @@ -1,6 +1,6 @@ import React, { createContext, useState, useMemo, ReactNode } from 'react'; import { ThemeProvider } from '@mui/material/styles'; -import { lightTheme, darkTheme } from './themes'; // Adjust the import path as necessary +import { lightTheme, darkTheme } from './themes'; const ThemeContext = createContext({ toggleTheme: () => {} }); diff --git a/CoVAR-app/src/styles/dashboardStyle.tsx b/CoVAR-app/src/styles/dashboardStyle.tsx index c3e0664..6cadcca 100644 --- a/CoVAR-app/src/styles/dashboardStyle.tsx +++ b/CoVAR-app/src/styles/dashboardStyle.tsx @@ -2,7 +2,7 @@ import { SxProps, Theme } from '@mui/material/styles'; export const chartContainerStyles: SxProps = (theme) => ({ padding: theme.spacing(2), - backgroundColor: theme.palette.background.default, + backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, display: 'flex', flexDirection: 'column', @@ -26,7 +26,7 @@ export const chartContainerStyles: SxProps = (theme) => ({ // Updated listContainerStyles to use theme export const listContainerStyles: SxProps = (theme) => ({ padding: theme.spacing(2), - backgroundColor: theme.palette.background.default, + backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, height: '100%', }); diff --git a/CoVAR-app/src/styles/evaluateStyle.tsx b/CoVAR-app/src/styles/evaluateStyle.tsx index 09062b4..81ea58b 100644 --- a/CoVAR-app/src/styles/evaluateStyle.tsx +++ b/CoVAR-app/src/styles/evaluateStyle.tsx @@ -1,31 +1,24 @@ import { SxProps, Theme } from '@mui/material/styles'; -export const evaluateContainerStyles: SxProps = (theme) => ({ - display: 'flex', - height: '100vh', - backgroundColor: theme.palette.background.default, // Use theme's background color -}); - export const uploadBoxStyles: SxProps = (theme) => ({ flexGrow: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - backgroundColor: theme.palette.background.paper, // Use theme's paper background color - padding: theme.spacing(3), // Use theme's spacing + backgroundColor: theme.palette.background.paper, + padding: theme.spacing(3), }); export const uploadButtonStyles: SxProps = (theme) => ({ marginTop: theme.spacing(3), marginBottom: theme.spacing(2), - backgroundColor: theme.palette.primary.main, // Use theme's primary color - color: theme.palette.primary.contrastText, // Use theme's primary contrast text color + color: theme.palette.primary.contrastText, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '10px 20px', '&:hover': { - backgroundColor: theme.palette.primary.dark, // Use theme's dark primary color + backgroundColor: theme.palette.primary.dark, }, }); diff --git a/CoVAR-app/src/styles/organisationStyle.tsx b/CoVAR-app/src/styles/organisationStyle.tsx index a26a305..209fd90 100644 --- a/CoVAR-app/src/styles/organisationStyle.tsx +++ b/CoVAR-app/src/styles/organisationStyle.tsx @@ -1,55 +1,54 @@ -import { SxProps } from '@mui/material/styles'; +import { SxProps, Theme } from '@mui/system'; -export const mainContentStyles: SxProps = { +export const mainContentStyles: SxProps = { flexGrow: 1, - backgroundColor: '#1F282E', - padding: 3, - color: '#CAD2C5', + backgroundColor: (theme) => theme.palette.background.default, + padding: (theme) => theme.spacing(3), + color: (theme) => theme.palette.text.primary, display: 'flex', flexDirection: 'column', alignItems: 'center', - overflow : 'hidden', + overflow: 'hidden', }; -export const cardStyles: SxProps = { +export const cardStyles: SxProps = { width: 450, height: 220, - backgroundColor: '#2F3E46', - color: '#CAD2C5', - padding: 2, + backgroundColor: (theme) => theme.palette.background.paper, + color: (theme) => theme.palette.text.secondary, + padding: (theme) => theme.spacing(2), }; -export const headingBoxStyles: SxProps = { - backgroundColor: '#2D3E44', +export const headingBoxStyles: SxProps = { width: '98%', display: 'flex', justifyContent: 'center', alignItems: 'center', - padding: 2, - marginBottom: 2, + padding: (theme) => theme.spacing(2), + marginBottom: (theme) => theme.spacing(2), }; -export const textFieldStyles: SxProps = { - color: '#CAD2C5', - '& .MuiOutlinedInput-root': { - '& fieldset': { - borderColor: '#CAD2C5', - }, - '&:hover fieldset': { - borderColor: '#CAD2C5', - }, - '&.Mui-focused fieldset': { - borderColor: '#52796F', - }, - }, +export const textFieldStyles: SxProps = { + // '& .MuiOutlinedInput-root': { + // '& fieldset': { + // borderColor: (theme) => theme.palette.text.secondary, + // }, + // '&:hover fieldset': { + // borderColor: (theme) => theme.palette.text.primary, + // }, + // '&.Mui-focused fieldset': { + // borderColor: (theme) => theme.palette.primary.main, + // }, + // }, }; -export const buttonStyles: SxProps = { - mt: 3, - mb: 2, - backgroundColor: 'primary.main', - color: 'white', - '&:hover': { - backgroundColor: 'primary.dark', - }, +export const buttonStyles: SxProps = { + mt: 3, + mb: 2, + backgroundColor: (theme) => theme.palette.primary.main, + color: (theme) => theme.palette.primary.contrastText, + '&:hover': { + backgroundColor: (theme) => theme.palette.primary.dark, + }, + width: '100%', }; diff --git a/CoVAR-app/src/styles/sidebarStyle.tsx b/CoVAR-app/src/styles/sidebarStyle.tsx index 52919de..d254ae2 100644 --- a/CoVAR-app/src/styles/sidebarStyle.tsx +++ b/CoVAR-app/src/styles/sidebarStyle.tsx @@ -22,11 +22,12 @@ export const mainContentStyles: SxProps = (theme) => ({ export const sidebarItemStyles: SxProps = (theme) => ({ width: '100%', - color: theme.palette.text.primary, // Ensure text color is primary + color: theme.palette.text.primary, + borderRadius: theme.shape.borderRadius, '&:hover': { backgroundColor: theme.palette.action.hover, + }, - borderRadius: theme.shape.borderRadius, }); export const iconStyles: SxProps = (theme) => ({ @@ -43,7 +44,7 @@ export const logoutButtonStyles: SxProps = (theme) => ({ marginBottom: theme.spacing(2), width: '90%', backgroundColor: theme.palette.primary.main, - color: theme.palette.primary.contrastText, // Use contrast text color + color: theme.palette.primary.contrastText, '&:hover': { backgroundColor: theme.palette.primary.dark, }, @@ -67,4 +68,4 @@ export const GoogleButton = styled(Button)(({ theme }) => ({ '& svg': { marginRight: theme.spacing(1), }, -})); +})); \ No newline at end of file diff --git a/CoVAR-app/src/styles/themes.tsx b/CoVAR-app/src/styles/themes.tsx index 78fff6d..32a3625 100644 --- a/CoVAR-app/src/styles/themes.tsx +++ b/CoVAR-app/src/styles/themes.tsx @@ -5,19 +5,22 @@ const lightTheme = createTheme({ palette: { mode: 'light', primary: { - main: '#84A98C', - dark: '#52796F', + main: '#52796F', + dark: '#3d5b53', + }, + secondary: { + main: '#52796F', }, background: { - default: '#F0F4F8', - paper: '#FFFFFF', + default: '#CED4DA', + paper: '#F8F9FA', }, text: { - primary: '#1F282E', - secondary: '#52796F', + primary: '#212529', + secondary: '#343A40', }, action: { - hover: '#E0E0E0', + hover: '#DEDEDE', }, }, typography: { @@ -70,9 +73,12 @@ const darkTheme = createTheme({ main: '#52796F', dark: '#405d51', }, + secondary: { + main: '#52796F', + }, background: { default: '#1F282E', - paper: '#1F282E', + paper: '#2D3E44', }, text: { primary: '#CAD2C5', @@ -96,28 +102,28 @@ const darkTheme = createTheme({ MuiInputBase: { styleOverrides: { input: { - color: '#CAD2C5', + color: '#', }, }, }, MuiFormLabel: { styleOverrides: { root: { - color: '#CAD2C5', + color: '#', }, }, }, MuiButton: { styleOverrides: { root: { - borderRadius: 4, // ensuring button border radius matches the theme + borderRadius: 4, }, }, }, MuiPaper: { styleOverrides: { root: { - padding: 8, // ensure all papers have consistent padding + padding: 8, }, }, },