Skip to content
Snippets Groups Projects
Commit a60ce90f authored by Espen Boman Fosseide's avatar Espen Boman Fosseide :dart:
Browse files

fix: simplify settingspage

parent f030b5cd
No related branches found
No related tags found
No related merge requests found
......@@ -14,13 +14,10 @@ type SettingsPageProps = {
export default function SettingsPage(props: SettingsPageProps) {
function changeTheme(event: ChangeEvent<HTMLInputElement>, value: string) {
localStorage.setItem('theme', value);
if (Object.prototype.hasOwnProperty.call(themes, value)) {
const theme = value as keyof typeof themes;
props.setTheme(themes[theme]);
props.setThemeName(theme);
}
}
return (
<Popup title="Settings" open={props.open} onClose={props.onClose} maxWidth="sm">
<ThemeRadioGroup onChange={changeTheme} themeName={props.themeName} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment