diff --git a/web/src/components/core/Assignment/AssignmentCard.jsx b/web/src/components/core/Assignment/AssignmentCard.jsx index f067a4788..cf8c03117 100644 --- a/web/src/components/core/Assignment/AssignmentCard.jsx +++ b/web/src/components/core/Assignment/AssignmentCard.jsx @@ -224,7 +224,7 @@ export default function AssignmentCard({assignment, editableFields, updateField, diff --git a/web/src/components/shared/Navigation/Ad/Ad.styles.jsx b/web/src/components/shared/Navigation/Ad/Ad.styles.jsx index 9662d9d80..74a482513 100644 --- a/web/src/components/shared/Navigation/Ad/Ad.styles.jsx +++ b/web/src/components/shared/Navigation/Ad/Ad.styles.jsx @@ -42,7 +42,6 @@ export const useStyles = makeStyles((theme) => ({ githubButton: { width: '100%', marginTop: theme.spacing(2), - backgroundColor: theme.palette.primary.main, borderRadius: '2px', }, })); diff --git a/web/src/pages/core/public/Profile/Profile.jsx b/web/src/pages/core/public/Profile/Profile.jsx index 467b595ab..abb086e32 100644 --- a/web/src/pages/core/public/Profile/Profile.jsx +++ b/web/src/pages/core/public/Profile/Profile.jsx @@ -6,6 +6,8 @@ import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; import GitHub from '@mui/icons-material/GitHub'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import Switch from '@mui/material/Switch'; import {useStyles} from './Profile.styles'; import standardStatusHandler from '../../../../utils/standardStatusHandler'; @@ -34,6 +36,15 @@ const Profile = () => { setUserGroup(user.is_superuser ? 'superuser' : user.is_admin ? 'admin' : 'student'); }, [user]); + const handleToggle = (key) => { + axios.get(`/api/public/profile/toggle-email-notifications/${key}`).then((response) => { + const data = standardStatusHandler(response, enqueueSnackbar); + if (data?.user) { + setUser(data.user); + } + }).catch(standardErrorHandler(enqueueSnackbar)); + }; + if (!user) { return null; } @@ -82,6 +93,7 @@ const Profile = () => { + {[ + {key: 'deadline_email_enabled', title: 'Deadline Notifications'}, + {key: 'release_email_enabled', title: 'Release Notifications '}, + ].map((({key, title}) => ( + + + + {title} + + handleToggle(key)} + name={title} + /> + } + /> + + + )))} ); }; diff --git a/web/src/pages/core/public/Profile/Profile.styles.jsx b/web/src/pages/core/public/Profile/Profile.styles.jsx index 29804aec3..fbb0a18be 100644 --- a/web/src/pages/core/public/Profile/Profile.styles.jsx +++ b/web/src/pages/core/public/Profile/Profile.styles.jsx @@ -16,9 +16,10 @@ export const useStyles = makeStyles((theme) => ({ }, githubText: { fontSize: '16px', + minWidth: '200px', }, saveButton: { - backgroundColor: theme.palette.primary.main, + // backgroundColor: theme.palette.primary.main, borderRadius: theme.spacing(.5), }, bioContainer: { diff --git a/web/src/theme/Theme.jsx b/web/src/theme/Theme.jsx index 8d850abff..1944de58c 100644 --- a/web/src/theme/Theme.jsx +++ b/web/src/theme/Theme.jsx @@ -22,6 +22,12 @@ let theme = createTheme({ primary: { main: '#5686F5', }, + secondary: { + main: 'rgb(255, 152, 0)', + }, + error: { + main: 'rgb(244, 67, 54)', + }, dark: { black: '#0d1117', blue: {