Refactor settings to use stack to allow dark theme. Move theme to app reducer to allow persistence.
This commit is contained in:
@@ -6,6 +6,7 @@ const INITIAL_STATE = {
|
||||
documentUploadInProgress: null,
|
||||
documentUploadError: null,
|
||||
deleteAfterUpload: false,
|
||||
theme: "system",
|
||||
};
|
||||
|
||||
const appReducer = (state = INITIAL_STATE, action) => {
|
||||
@@ -43,6 +44,8 @@ const appReducer = (state = INITIAL_STATE, action) => {
|
||||
...state,
|
||||
deleteAfterUpload: !state.deleteAfterUpload,
|
||||
};
|
||||
case AppActionTypes.SET_THEME:
|
||||
return { ...state, theme: action.payload };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user