Add config option to set default theme

This commit is contained in:
Deluan
2021-04-18 13:51:00 -04:00
parent b6f525bda5
commit f63a912341
6 changed files with 36 additions and 4 deletions
+11 -1
View File
@@ -1,7 +1,17 @@
import { CHANGE_THEME } from '../actions'
import config from '../config'
import themes from '../themes'
const defaultTheme = () => {
return (
Object.keys(themes).find(
(t) => themes[t].themeName === config.defaultTheme
) || 'DarkTheme'
)
}
export const themeReducer = (
previousState = 'DarkTheme',
previousState = defaultTheme(),
{ type, payload }
) => {
if (type === CHANGE_THEME) {