Skip to content
10 changes: 7 additions & 3 deletions app/components/MyOrders/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { View, ScrollView, Text, Image } from 'react-native';

import { Container, Header, Tab, Tabs, TabHeading, Icon, List } from 'native-base';
import { List } from 'native-base';
import { Actions } from 'react-native-router-flux';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
Expand All @@ -14,7 +14,7 @@ import Button from '../../components/Button';
import styles from './style';
import strings from '../../localization';
import OrderList from '../../containers/OrderList';

import { getUpdateOrderStatus, getPaymentProof } from '../../containers/OrderDetail/selectors';

const icon = require('./../../../assets/images/icon.png');
const noTicket = require('./../../../assets/images/noticket.png');
Expand Down Expand Up @@ -53,6 +53,8 @@ const MyOrders = (props) => {
key={order.id}
order={order}
confirmPayment={this.confirmPayment}
statusProgress={props.orderStatus}
paymentProof={props.paymentProof}
onPress={() => {
Actions.orderDetail({
orderId: order.id,
Expand Down Expand Up @@ -83,7 +85,9 @@ MyOrders.propTypes = {
};

const mapStateToProps = createStructuredSelector({
orders: selectors.getOrders()
orders: selectors.getOrders(),
orderStatus: getUpdateOrderStatus(),
paymentProof: getPaymentProof()
});

export default connect(mapStateToProps, actions)(MyOrders);
16 changes: 0 additions & 16 deletions app/components/MyOrders/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ const styles = StyleSheet.create({
justifyContent: 'center',
backgroundColor: 'transparent'
},
tabs: {
},
tabHeading: {
flex: 1,
backgroundColor: '#FF6F00'
},
tabTitle: {
fontSize: 16,
fontFamily: 'Montserrat',
fontWeight: '500',
color: '#FFF'
},
tabBarSelectedItemStyle: {
borderBottomWidth: 2,
borderBottomColor: 'red'
}
});

export default styles;
12 changes: 11 additions & 1 deletion app/components/OrderItem/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import 'intl';
import 'intl/locale-data/jsonp/id';
import React, { Component } from 'react';
Expand Down Expand Up @@ -68,6 +69,11 @@ export default class OrderItem extends Component {
</Text>
);
}
return (
<Text note style={[ styles.statusText, { backgroundColor: 'blue', color: 'white' } ]}>
{this.state.status.toUpperCase()}
</Text>
);
}

ticketTypes = () => {
Expand Down Expand Up @@ -99,8 +105,12 @@ export default class OrderItem extends Component {
};

render() {
const { status } = this.state;
const { order } = this.props;
const { color, status } = this.state;
// console.log('landing here orderItem this.state', this.state);
// console.log('landing here this.props orderItem', this.props.order);
// console.log('landing here localeDateAddOneHour', localeDateAddOneHour(order.created_at));
// console.log('landing here moment()', Moment());
return (
<CardItem style={styles.container} button onPress={() => this.props.onPress()}>
<View style={styles.item}>
Expand Down
5 changes: 3 additions & 2 deletions app/components/OrderItem/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ const styles = StyleSheet.create({
borderColor: 'transparent',
elevation: 0
},
viewText1: {
viewText: {
flex: 0,
flexDirection: 'row',
margin: 20,
marginTop: 8
},
buttonSection: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
marginLeft: 10
},
statusText: {
fontWeight: 'bold',
Expand Down
7 changes: 6 additions & 1 deletion app/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ export const transactionStatus = (payment) => {
message: 'pending',
color: 'red'
};
} else if (payment.transaction_status === 'in progress') {
return {
message: 'in progress',
color: 'blue'
};
}
return {
message: payment.transaction_status,
Expand All @@ -126,4 +131,4 @@ export const transactionStatus = (payment) => {
message: 'not paid',
color: PRIMARYCOLOR
};
};
}