Add config option to set default theme
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user