Commit b13773e9 authored by Trisno's avatar Trisno

update reward select

parent e443f3d5
...@@ -25,8 +25,10 @@ class RewardSelect extends React.Component { ...@@ -25,8 +25,10 @@ class RewardSelect extends React.Component {
this._unsubscribe() this._unsubscribe()
} }
handleSelect(){ handleSelect(item){
console.log(item)
console.log(this.props.voucher)
console.log(this.props.value_voucher)
} }
getRewardsList() { getRewardsList() {
...@@ -60,7 +62,7 @@ class RewardSelect extends React.Component { ...@@ -60,7 +62,7 @@ class RewardSelect extends React.Component {
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.handleSelect()}> <TouchableOpacity key={key} onPress={() => this.handleSelect(item)}>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 10 }}> <Card style={{ padding: 5, margin: 10 }}>
<View> <View>
...@@ -118,8 +120,26 @@ const mapStateToProps = (state) => { ...@@ -118,8 +120,26 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
value_voucher: state.value_voucher,
voucher: state.voucher,
}
}
const mapDispatchToProps = (dispacth) => {
return {
setVoucher: (voucherProps) => dispacth({
type: ActionType.SET_VOUCHER,
data: {
voucher: voucherProps.voucher,
value_voucher: voucherProps.value_voucher,
} }
}),
}
} }
export default connect(mapStateToProps)(RewardSelect);
\ No newline at end of file export default connect(mapStateToProps,mapDispatchToProps)(RewardSelect);
\ No newline at end of file
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