Commit 28c2ce01 authored by Trisno's avatar Trisno

tampil 'no data' di trans history

parent 73aeb818
...@@ -69,6 +69,7 @@ class OrderHistory extends React.Component { ...@@ -69,6 +69,7 @@ class OrderHistory extends React.Component {
</View> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) : {this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) :
this.state.order_list.length ? (
this.state.order_list.map((item, key) => ( this.state.order_list.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}>
<View style={{ marginTop: 5 }} key={key}> <View style={{ marginTop: 5 }} key={key}>
...@@ -83,8 +84,8 @@ class OrderHistory extends React.Component { ...@@ -83,8 +84,8 @@ class OrderHistory extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ justifyContent: 'center', marginVertical: 5, marginLeft:20, borderLeftWidth: 1, borderColor: 'grey' }}> <View style={{ justifyContent: 'center', marginVertical: 5, marginLeft: 20, borderLeftWidth: 1, borderColor: 'grey' }}>
<View style={{margin:30}}> <View style={{ margin: 30 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#c9af6d', fontSize: 12, margin: 2 }}>{item.trans_status_display}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#c9af6d', fontSize: 12, margin: 2 }}>{item.trans_status_display}</Text>
</View> </View>
</View> </View>
...@@ -92,6 +93,11 @@ class OrderHistory extends React.Component { ...@@ -92,6 +93,11 @@ class OrderHistory extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
)) ))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>No Order History</Text>
</View>
)
} }
</ScrollView> </ScrollView>
</View> </View>
......
...@@ -39,10 +39,11 @@ class TransactionHistory extends React.Component { ...@@ -39,10 +39,11 @@ class TransactionHistory extends React.Component {
<View style={styles.container}> <View style={styles.container}>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.history_list.length ? (
this.state.history_list.map((item) => ( this.state.history_list.map((item) => (
item.transactions.map((i, k) => ( item.transactions.map((i, k) => (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Transaction Detail', {idTrans:i.id})}> <TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Transaction Detail', { idTrans: i.id })}>
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, flexDirection: 'row' }}>
<View style={{ justifyContent: 'center', margin: 10 }}> <View style={{ justifyContent: 'center', margin: 10 }}>
...@@ -55,8 +56,8 @@ class TransactionHistory extends React.Component { ...@@ -55,8 +56,8 @@ class TransactionHistory extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ justifyContent: 'center', marginVertical: 5, marginLeft:20, borderLeftWidth: 1, borderColor: 'grey' }}> <View style={{ justifyContent: 'center', marginVertical: 5, marginLeft: 20, borderLeftWidth: 1, borderColor: 'grey' }}>
<View style={{margin:30}}> <View style={{ margin: 30 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#c9af6d', fontSize: 12, margin: 2 }}>{i.trans_status_display}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#c9af6d', fontSize: 12, margin: 2 }}>{i.trans_status_display}</Text>
</View> </View>
</View> </View>
...@@ -65,6 +66,11 @@ class TransactionHistory extends React.Component { ...@@ -65,6 +66,11 @@ class TransactionHistory extends React.Component {
</TouchableOpacity> </TouchableOpacity>
)) ))
)) ))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>No Transaction History</Text>
</View>
)
} }
</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