Commit 6755d13a authored by Trisno's avatar Trisno

tampilkan 'No E-Voucher Available' ketika tidak ada voucher

parent ff3f6147
...@@ -116,7 +116,7 @@ class RewardSelect extends React.Component { ...@@ -116,7 +116,7 @@ class RewardSelect extends React.Component {
)) ))
) : ( ) : (
<View style={{justifyContent:'center', alignItems:'center', height:100}}> <View style={{justifyContent:'center', alignItems:'center', height:100}}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>No data</Text> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View> </View>
) )
} }
......
...@@ -32,9 +32,9 @@ class RewardsList extends React.Component { ...@@ -32,9 +32,9 @@ class RewardsList extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => {
let data = res.data.rewards let data = res.data.rewards
// console.log(data) // console.log(data)
data.map((item,key) => { data.map((item, key) => {
// console.log(item.expire_time) // console.log(item.expire_time)
item.expire_time = moment(item.expire_time).format("DD MMMM YYYY") item.expire_time = moment(item.expire_time).format("DD MMMM YYYY")
}) })
// console.log(data) // console.log(data)
this.setState({ this.setState({
...@@ -55,35 +55,41 @@ class RewardsList extends React.Component { ...@@ -55,35 +55,41 @@ class RewardsList extends React.Component {
</View> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.length ? (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}> this.state.rewardsList.map((item, key) => (
<View style={{ alignItems: 'center' }}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<Card style={{ padding: 5, margin: 10 }}> <View style={{ alignItems: 'center' }}>
<View> <Card style={{ padding: 5, margin: 10 }}>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text> <Image source={{ uri: item.reward.title_image }}
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text> resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View> </View>
<View> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</Text> <View>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.expire_time}</Text> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>Expired</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.expire_time}</Text>
</View>
</View> </View>
</View> </Card>
</Card> </View>
</TouchableOpacity>
))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View> </View>
</TouchableOpacity> )
))
} }
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{height:15}}/> <View style={{ height: 15 }} />
</ScrollView> </ScrollView>
</View> </View>
) )
......
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