initial docker setup
This commit is contained in:
16
frontend/src/reducers/dashboard/dashboardReducers.js
Normal file
16
frontend/src/reducers/dashboard/dashboardReducers.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import {RECIEVE_GADGETS} from '../../constants/dashboardConstants';
|
||||
|
||||
const moduleReducers = {};
|
||||
|
||||
moduleReducers[RECIEVE_GADGETS] = (state, action) => {
|
||||
return Object.assign({}, state, {
|
||||
gadgets: action.gadgets
|
||||
});
|
||||
};
|
||||
|
||||
const dashboardReducer = (state = {}, action) => {
|
||||
|
||||
return moduleReducers[action.type] ? moduleReducers[action.type](state, action) : state;
|
||||
};
|
||||
|
||||
export default dashboardReducer;
|
||||
23
frontend/src/reducers/dashboard/nextActionsReducers.js
Normal file
23
frontend/src/reducers/dashboard/nextActionsReducers.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';
|
||||
|
||||
const moduleReducers = {};
|
||||
|
||||
moduleReducers[REQUEST_NEXT_ACTIONS] = (state, action) => {
|
||||
return Object.assign({}, state, {
|
||||
isLoading: action.isLoading
|
||||
});
|
||||
};
|
||||
|
||||
moduleReducers[RECIEVE_NEXT_ACTIONS] = (state, action) => {
|
||||
return Object.assign({}, state, {
|
||||
nextActions: action.nextActions,
|
||||
isLoading: action.isLoading
|
||||
});
|
||||
};
|
||||
|
||||
const nextActionsReducer = (state = {}, action) => {
|
||||
|
||||
return moduleReducers[action.type] ? moduleReducers[action.type](state, action) : state;
|
||||
};
|
||||
|
||||
export default nextActionsReducer;
|
||||
26
frontend/src/reducers/dashboard/ordersCentralReducer.js
Normal file
26
frontend/src/reducers/dashboard/ordersCentralReducer.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
REQUEST_ORDERS,
|
||||
RECEIVE_ORDERS
|
||||
} from '../../constants/dashboardConstants';
|
||||
|
||||
const moduleReducers = {};
|
||||
|
||||
moduleReducers[REQUEST_ORDERS] = (state, action) => {
|
||||
return Object.assign({}, state, {
|
||||
isLoading: action.isLoading
|
||||
});
|
||||
};
|
||||
|
||||
moduleReducers[RECEIVE_ORDERS] = (state, action) => {
|
||||
return Object.assign({}, state, {
|
||||
orders: action.orders,
|
||||
isLoading: action.isLoading
|
||||
});
|
||||
};
|
||||
|
||||
const ordersCentralReducer = (state = {}, action) => {
|
||||
|
||||
return moduleReducers[action.type] ? moduleReducers[action.type](state, action) : state;
|
||||
};
|
||||
|
||||
export default ordersCentralReducer;
|
||||
Reference in New Issue
Block a user