Commit f813a651 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

add detail reward redux

parent c635aeab
...@@ -31,7 +31,6 @@ class RewardDetail extends React.Component { ...@@ -31,7 +31,6 @@ class RewardDetail extends React.Component {
this.detailReward() this.detailReward()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.detailReward() this.detailReward()
}); });
} }
...@@ -62,7 +61,7 @@ class RewardDetail extends React.Component { ...@@ -62,7 +61,7 @@ class RewardDetail extends React.Component {
expire: expire_date, expire: expire_date,
code: res.data.reward.verification_number, code: res.data.reward.verification_number,
used: res.data.reward.used, used: res.data.reward.used,
value: res.data.reward.reward.value, value: res.data.reward.reward,
cur_time: cur_time, cur_time: cur_time,
exp_time: exp_time exp_time: exp_time
...@@ -80,7 +79,7 @@ class RewardDetail extends React.Component { ...@@ -80,7 +79,7 @@ class RewardDetail extends React.Component {
useVoucher() { useVoucher() {
let voucherProps = { let voucherProps = {
value_voucher: this.state.value, value_voucher: this.state.value,
voucher: this.state.code voucher: this.state.value
} }
this.props.setVoucher(voucherProps); this.props.setVoucher(voucherProps);
...@@ -98,16 +97,15 @@ class RewardDetail extends React.Component { ...@@ -98,16 +97,15 @@ class RewardDetail extends React.Component {
<View style={styles.container}> <View style={styles.container}>
<ScrollView> <ScrollView>
<View style={styles.body}> <View style={styles.body}>
<Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} /> <Image style={{ height: 250, flex: 1 }} source={this.state.image ? { uri: this.state.image } : null} />
<View style={styles.content_code_expire}>
<View style={styles.voucher_code}> <View style={styles.voucher_code}>
<Text style={styles.text_voucher}>Voucher Code : </Text> <Text style={styles.text_voucher}>Voucher Code : </Text>
<Text style={styles.text_c_voucher}>{this.state.code}</Text> <Text style={styles.text_c_voucher}>{this.state.code}</Text>
</View> </View>
<View style={styles.expire_time}> <View style={styles.expire_time}>
<Text style={styles.text_expire}>Expire Time : </Text> <Text style={styles.text_expire}>Expire Time : </Text>
<Text style={styles.text_c_expire}>{this.state.expire}</Text> <Text style={styles.text_c_expire}>{this.state.expire}</Text>
</View>
</View> </View>
<View style={styles.content}> <View style={styles.content}>
{this.state.cur_time >= this.state.exp_time ? (<Button {this.state.cur_time >= this.state.exp_time ? (<Button
...@@ -159,23 +157,29 @@ const styles = StyleSheet.create({ ...@@ -159,23 +157,29 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
}, },
content_code_expire: { // content_code_expire: {
top: -140, // top: -140,
flex: 1, // flex: 1,
backgroundColor: 'green', // backgroundColor: 'green',
marginRight: 30, // marginRight: 30,
marginLeft: 30, // marginLeft: 30,
}, // },
voucher_code: { voucher_code: {
top: -140,
height: 70, height: 70,
marginLeft:20,
marginRight:20,
backgroundColor: '#01919c', backgroundColor: '#01919c',
flex: 1, flex: 1,
}, },
expire_time: { expire_time: {
top: -140,
flex: 1, flex: 1,
marginLeft:20,
marginRight:20,
height: 70, height: 70,
backgroundColor: 'black', backgroundColor: 'black',
}, },
...@@ -211,7 +215,7 @@ const styles = StyleSheet.create({ ...@@ -211,7 +215,7 @@ const styles = StyleSheet.create({
}, },
content: { content: {
top: -140,
flex: 1, flex: 1,
}, },
button: { button: {
......
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