Commit 776f6aed authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

set redux reddem

parent 95cec135
...@@ -39,7 +39,8 @@ const ActionType = { ...@@ -39,7 +39,8 @@ const ActionType = {
CHANGE_TO_CHART:'CHANGE_TO_CHART', CHANGE_TO_CHART:'CHANGE_TO_CHART',
SET_VOUCHER:'SET_VOUCHER', SET_VOUCHER:'SET_VOUCHER',
SET_EDIT_NOTE:'SET_EDIT_NOTE', SET_EDIT_NOTE:'SET_EDIT_NOTE',
SET_HOME_ADDRESS:'SET_HOME_ADDRESS' SET_HOME_ADDRESS:'SET_HOME_ADDRESS',
SET_REEDEM :'SET_REEDEM'
} }
export default ActionType; export default ActionType;
\ No newline at end of file
...@@ -84,7 +84,12 @@ const globalState = { ...@@ -84,7 +84,12 @@ const globalState = {
voucher: [], voucher: [],
value_voucher: '', value_voucher: '',
home_address:'', home_address:'',
outlet_detailadress: '' outlet_detailadress: '',
in_payment: false,
redeem_code :'',
balance_redeem :'',
point_redeem:''
} }
...@@ -280,6 +285,16 @@ const rootReducer = (state = globalState, action) => { ...@@ -280,6 +285,16 @@ const rootReducer = (state = globalState, action) => {
} }
} }
case ActionType.SET_REEDEM: {
return {
...state,
in_payment: action.data.in_payment,
redeem_code :action.data.redeem_code,
balance_redeem : action.data.balance_redeem,
point_redeem:action.data.point_redeem
}
}
case ActionType.SET_CHANGE_SHOP: { case ActionType.SET_CHANGE_SHOP: {
return { return {
...state ...state
......
...@@ -8,6 +8,7 @@ import { Entypo, Ionicons, MaterialCommunityIcons, MaterialIcons, AntDesign, Fon ...@@ -8,6 +8,7 @@ import { Entypo, Ionicons, MaterialCommunityIcons, MaterialIcons, AntDesign, Fon
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import PinRequest from './PinRequest' import PinRequest from './PinRequest'
import ActionType from '../redux/globalActionType';
class UseBalance extends React.Component { class UseBalance extends React.Component {
...@@ -504,4 +505,18 @@ const mapStateToProps = (state) => { ...@@ -504,4 +505,18 @@ const mapStateToProps = (state) => {
} }
} }
export default connect(mapStateToProps)(UseBalance); const mapDispatchToProps = (dispacth) => {
return {
setRedeem: (redeemProps) => dispacth({
type: ActionType.SET_REEDEM,
data: {
in_payment: redeemProps.in_payment,
redeem_code:redeemPropsa.redeem_code,
balance_redeem: redeemProps.balance_redeem,
point_redeem: redeemProps.point_redeem
}
}),
}
}
export default connect(mapStateToProps,mapDispatchToProps)(UseBalance);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment