Add system default as dark theme preference option

This commit is contained in:
Peizhi Zheng
2021-01-13 13:58:10 -08:00
committed by GitHub
parent e7cfbc6bf7
commit b3beef97df
6 changed files with 74 additions and 55 deletions

View File

@@ -131,7 +131,7 @@ const useStyles = (theme: Theme) =>
function mapStateToProps(state: AppState) {
return {
snackbar: state.snackbar,
isDarkTheme: state.settings.isDarkTheme,
themePreference: state.settings.themePreference,
};
}
@@ -146,7 +146,7 @@ function SlideUpTransition(props: TransitionProps) {
}
function App(props: ConnectedProps<typeof connector>) {
const theme = makeTheme(props.isDarkTheme);
const theme = makeTheme(props.themePreference);
const classes = useStyles(theme)();
const [open, setOpen] = useState(true);
const toggleDrawer = () => setOpen(!open);