Commit d339cb78 authored by Trisno's avatar Trisno

display all trans history

parent 074fe596
...@@ -88,27 +88,44 @@ class TransactionHistory extends React.Component { ...@@ -88,27 +88,44 @@ class TransactionHistory extends React.Component {
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('Order Detail', { idTrans: i.id })}> i.type == 2 ? (
<View style={{ marginTop: 5 }} key={k}> <TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text> <View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text>
</View> </View>
</TouchableOpacity> </View>
</View> </View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}> </View>
<View> </TouchableOpacity>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text> ) : (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text>
</View>
</View> </View>
</View> </View>
</View> </View>
</View> )
</TouchableOpacity>
)) ))
)) ))
) : ( ) : (
......
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