diff options
Diffstat (limited to 'modern/src/store')
-rw-r--r-- | modern/src/store/index.js | 3 | ||||
-rw-r--r-- | modern/src/store/ui.js | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/modern/src/store/index.js b/modern/src/store/index.js index 6e2bb20..ebd3f43 100644 --- a/modern/src/store/index.js +++ b/modern/src/store/index.js @@ -7,6 +7,7 @@ import { geofencesReducer as geofences } from './geofences'; import { groupsReducer as groups } from './groups'; import { driversReducer as drivers } from './drivers'; import { maintenancesReducer as maintenances } from './maintenances'; +import { uiReducer as ui } from './ui'; const reducer = combineReducers({ session, @@ -16,6 +17,7 @@ const reducer = combineReducers({ groups, drivers, maintenances, + ui }); export { sessionActions } from './session'; @@ -25,5 +27,6 @@ export { geofencesActions } from './geofences'; export { groupsActions } from './groups'; export { driversActions } from './drivers'; export { maintenancesActions } from './maintenances'; +export { uiActions } from './ui'; export default configureStore({ reducer }); diff --git a/modern/src/store/ui.js b/modern/src/store/ui.js new file mode 100644 index 0000000..0783492 --- /dev/null +++ b/modern/src/store/ui.js @@ -0,0 +1,16 @@ +import { createSlice } from '@reduxjs/toolkit'; + +const { reducer, actions } = createSlice({ + name: 'ui', + initialState: { + collapsed: true + }, + reducers: { + setCollapsed(state, action) { + state.collapsed = action.payload; + }, + }, +}); + +export { actions as uiActions }; +export { reducer as uiReducer }; |