refactor src folder structure
This commit is contained in:
parent
0bfb70af8b
commit
d0e26e2882
30 changed files with 94 additions and 134 deletions
48
src/store/dataStore.tsx
Normal file
48
src/store/dataStore.tsx
Normal file
|
@ -0,0 +1,48 @@
|
|||
// dataStore.js
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const dataStore = createSlice( {
|
||||
name: 'data',
|
||||
initialState: {
|
||||
session: {
|
||||
token: '',
|
||||
name: '',
|
||||
device: '',
|
||||
language: 'nl',
|
||||
address: {
|
||||
id: 0,
|
||||
zipcode: '',
|
||||
houseNumber: '',
|
||||
street: '',
|
||||
city: '',
|
||||
},
|
||||
coordinates: {
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
},
|
||||
notifications: {
|
||||
dayBefore: 'off',
|
||||
sameDay: 'off',
|
||||
},
|
||||
},
|
||||
reloadCalendar: true,
|
||||
viewCategory: null,
|
||||
},
|
||||
reducers: {
|
||||
setSession: (state, action) => {
|
||||
state.session = action.payload;
|
||||
},
|
||||
setReloadCalendar: (state, action) => {
|
||||
state.reloadCalendar = action.payload;
|
||||
},
|
||||
setViewCategory: (state, action) => {
|
||||
state.viewCategory = action.payload;
|
||||
},
|
||||
},
|
||||
} );
|
||||
|
||||
export const { setSession } = dataStore.actions;
|
||||
export const { setReloadCalendar } = dataStore.actions;
|
||||
export const { setViewCategory } = dataStore.actions;
|
||||
|
||||
export default dataStore.reducer;
|
Loading…
Add table
Add a link
Reference in a new issue