From 18b6168cd13aa78e19d77c6f6cd40c98fd8a6e44 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sat, 20 Feb 2021 02:57:52 +0330 Subject: [PATCH] theme select in settings --- webUI/react/src/App.tsx | 8 ++++---- webUI/react/src/components/NavBar.tsx | 8 +++++--- webUI/react/src/screens/Settings.tsx | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/webUI/react/src/App.tsx b/webUI/react/src/App.tsx index 0a1e011a..b0ac65c1 100644 --- a/webUI/react/src/App.tsx +++ b/webUI/react/src/App.tsx @@ -58,9 +58,7 @@ export default function App() { - - - + @@ -91,7 +89,9 @@ export default function App() { - + + + ) => { setAnchorEl(event.currentTarget); @@ -80,7 +82,7 @@ export default function NavBar() { > - - + */} diff --git a/webUI/react/src/screens/Settings.tsx b/webUI/react/src/screens/Settings.tsx index 78462c10..a5f44b63 100644 --- a/webUI/react/src/screens/Settings.tsx +++ b/webUI/react/src/screens/Settings.tsx @@ -8,7 +8,10 @@ import ListItem, { ListItemProps } from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import InboxIcon from '@material-ui/icons/Inbox'; +import Brightness6Icon from '@material-ui/icons/Brightness6'; +import { ListItemSecondaryAction, Switch } from '@material-ui/core'; import NavBarTitle from '../context/NavbarTitle'; +import DarkTheme from '../context/DarkTheme'; function ListItemLink(props: ListItemProps<'a', { button?: true }>) { // eslint-disable-next-line react/jsx-props-no-spreading @@ -18,6 +21,7 @@ function ListItemLink(props: ListItemProps<'a', { button?: true }>) { export default function Settings() { const { setTitle } = useContext(NavBarTitle); setTitle('Settings'); + const { darkTheme, setDarkTheme } = useContext(DarkTheme); return (
@@ -28,6 +32,19 @@ export default function Settings() { + + + + + + + setDarkTheme(!darkTheme)} + /> + +
);