farhantock
5 months ago
2 changed files with 0 additions and 75 deletions
@ -1,41 +0,0 @@ |
|||||||
|
|
||||||
export const SET_SHIPMENT_DATA = 'SET_SHIPMENT_DATA'; |
|
||||||
export const SET_SELECTED_DROP_POINT = 'SET_SELECTED_DROP_POINT'; |
|
||||||
export const SET_SELECTED_HISTORY = 'SET_SELECTED_HISTORY'; |
|
||||||
export const SET_SHOW_HISTORY_PICTURE = 'SET_SHOW_HISTORY_PICTURE'; |
|
||||||
export const SET_SELECTED_HISTORY_PICTURE = 'SET_SELECTED_HISTORY_PICTURE'; |
|
||||||
|
|
||||||
export const setShipmentData = obj => dispatch => { |
|
||||||
dispatch({ |
|
||||||
type: SET_SHIPMENT_DATA, |
|
||||||
payload: obj |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
export const setSelectedDropPoint = obj => dispatch => { |
|
||||||
dispatch({ |
|
||||||
type: SET_SELECTED_DROP_POINT, |
|
||||||
payload: obj |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
export const setSelectedHistory = obj => dispatch => { |
|
||||||
dispatch({ |
|
||||||
type: SET_SELECTED_HISTORY, |
|
||||||
payload: obj |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
export const setShowHistoryPicture = obj => dispatch => { |
|
||||||
dispatch({ |
|
||||||
type: SET_SHOW_HISTORY_PICTURE, |
|
||||||
payload: obj |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
export const setSelectedHistoryPicture = obj => dispatch => { |
|
||||||
dispatch({ |
|
||||||
type: SET_SELECTED_HISTORY_PICTURE, |
|
||||||
payload: obj |
|
||||||
}) |
|
||||||
} |
|
@ -1,34 +0,0 @@ |
|||||||
import { |
|
||||||
SET_SHIPMENT_DATA, |
|
||||||
SET_SELECTED_DROP_POINT, |
|
||||||
SET_SELECTED_HISTORY, |
|
||||||
SET_SHOW_HISTORY_PICTURE, |
|
||||||
SET_SELECTED_HISTORY_PICTURE |
|
||||||
} from "./actions"; |
|
||||||
|
|
||||||
const initialState = { |
|
||||||
shipmentData: null, |
|
||||||
selectedDropPoint: null, |
|
||||||
selectedHistory: null, |
|
||||||
showHistoryPicture: false, |
|
||||||
selectedHistoryPicture: null |
|
||||||
} |
|
||||||
|
|
||||||
function shipmentReducer(state = initialState, action) { |
|
||||||
switch (action.type) { |
|
||||||
case SET_SHIPMENT_DATA: |
|
||||||
return { ...state, shipmentData: action.payload } |
|
||||||
case SET_SELECTED_DROP_POINT: |
|
||||||
return { ...state, selectedDropPoint: action.payload } |
|
||||||
case SET_SELECTED_HISTORY: |
|
||||||
return { ...state, selectedHistory: action.payload } |
|
||||||
case SET_SHOW_HISTORY_PICTURE: |
|
||||||
return { ...state, showHistoryPicture: action.payload } |
|
||||||
case SET_SELECTED_HISTORY_PICTURE: |
|
||||||
return { ...state, selectedHistoryPicture: action.payload } |
|
||||||
default: |
|
||||||
return state; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
export default shipmentReducer; |
|
Loading…
Reference in new issue