Move theme setting to settings store
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user