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

perubahan design 1

parent f813a651
...@@ -96,9 +96,8 @@ class RewardDetail extends React.Component { ...@@ -96,9 +96,8 @@ class RewardDetail extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView> <ScrollView>
<View style={styles.body}> <View style={styles.images}>
<Image style={{ height: 250, flex: 1 }} source={this.state.image ? { uri: this.state.image } : null} /> <Image style={{ height: 250 }} source={this.state.image ? { uri: this.state.image } : null} />
<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>
...@@ -107,40 +106,37 @@ class RewardDetail extends React.Component { ...@@ -107,40 +106,37 @@ class RewardDetail extends React.Component {
<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 style={styles.content}>
{this.state.cur_time >= this.state.exp_time ? (<Button </View>
style={{ margin: 5 }} <View style={styles.content}>
title="EXPIRED" {this.state.cur_time >= this.state.exp_time ? (<Button
onPress={() => console.log('inin')} style={{ margin: 5 }}
buttonStyle={{ height: 50, backgroundColor: 'red' }} title="EXPIRED"
/>) onPress={() => console.log('inin')}
: this.state.used == 0 ? ( buttonStyle={{ height: 50, backgroundColor: 'red' }}
/>)
: this.state.used == 0 ? (
<Button
style={{ margin: 5 }}
title="USE VOUCHER"
onPress={() => this.useVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
) : (
<Button <Button
style={{ margin: 5 }} style={{ margin: 5 }}
title="USE VOUCHER" title="USED"
onPress={() => this.useVoucher()} onPress={() => this.useDVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }} buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/> />
) : ( )}
<Button
style={{ margin: 5 }}
title="USED"
onPress={() => this.useDVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
)}
<View>
<Text style={{ textAlign: 'center', fontSize: 15, top: 5, fontWeight: 'bold' }}>{this.state.title}</Text>
</View>
<View style={{ margin: 10 }}>
<HTML html={this.state.content} />
</View>
</View>
<View style={styles.content}>
<View style={{ margin: 10 }}>
<HTML html={this.state.content} />
</View> </View>
</View> </View>
</ScrollView> </ScrollView>
</View> </View>
) )
...@@ -155,31 +151,25 @@ const styles = StyleSheet.create({ ...@@ -155,31 +151,25 @@ const styles = StyleSheet.create({
}, },
body: { body: {
flex: 1, flex: 1,
backgroundColor: 'red'
}, },
// content_code_expire: {
// top: -140,
// flex: 1,
// backgroundColor: 'green',
// marginRight: 30,
// marginLeft: 30,
// },
voucher_code: { voucher_code: {
top: -140,
height: 70, height: 70,
marginLeft:20, marginLeft: 20,
marginRight:20, marginRight: 20,
backgroundColor: '#01919c', backgroundColor: '#01919c',
flex: 1, flex: 1,
marginTop:-140
}, },
expire_time: { expire_time: {
top: -140,
flex: 1, flex: 1,
marginLeft:20, marginLeft: 20,
marginRight:20, marginRight: 20,
height: 70, height: 70,
backgroundColor: 'black', backgroundColor: 'black',
}, },
...@@ -224,6 +214,9 @@ const styles = StyleSheet.create({ ...@@ -224,6 +214,9 @@ const styles = StyleSheet.create({
backgroundColor: '#2ead28', backgroundColor: '#2ead28',
borderRadius: 5, borderRadius: 5,
}, },
images: {
flex: 1,
}
}) })
...@@ -253,5 +246,3 @@ const mapStateToProps = (state) => { ...@@ -253,5 +246,3 @@ const mapStateToProps = (state) => {
} }
export default connect(mapStateToProps, mapDispatchToProps)(RewardDetail); export default connect(mapStateToProps, mapDispatchToProps)(RewardDetail);
{/* */ }
\ 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