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