Move theme setting to settings store

This commit is contained in:
Thomas Nordquist
2019-04-03 02:14:09 +02:00
parent 6f86a8d471
commit b9eb54dd20
5 changed files with 31 additions and 23 deletions

View File

@@ -34,12 +34,10 @@ export interface GlobalState {
showUpdateNotification?: boolean
showUpdateDetails: boolean
error?: string
theme: 'light' | 'dark'
}
const initialGlobalState: GlobalState = {
showUpdateDetails: false,
theme: 'dark',
}
const globalState: Reducer<GlobalState | undefined, CustomAction> = (state = initialGlobalState, action) => {
@@ -61,18 +59,6 @@ const globalState: Reducer<GlobalState | undefined, CustomAction> = (state = ini
error: action.error,
}
case ActionTypes.setDarkTheme:
return {
...state,
theme: 'dark',
}
case ActionTypes.setLightTheme:
return {
...state,
theme: 'light',
}
case ActionTypes.showUpdateDetails:
if (action.showUpdateDetails === undefined) {
return state