import React, { Component } from "react";
import { Platform, StyleSheet, Text, View, SafeAreaView } from "react-native";
import { observer, inject } from "mobx-react/native";
import { observable } from "mobx";
import DrawerNavigationHeader from "../../components/Public/drawerNavigationHeader";
import OrderFlatList from "../../components/MyOrders/orderFlatList";
import ScrollableTabView from "react-native-scrollable-tab-view";
import AsyncStorageHelper from "../../config/asyncStorageHelper";
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
import Loader from "../../components/Public/loader";
import Login from "../Login/login";
import Log from "../../config/log"
import { width, height } from "../../config/screen";
import Header from '../../components/Public/signInUpHeader'
import theme from "../../config/colors";
import language from "../../config/language";
const log = new Log()
const asyncStorageHelper = new AsyncStorageHelper();
@inject(["menuStore"], ["userStore"])
@observer
export default class MyOrders extends Component {
constructor(props) {
super(props);
this.store = this.props.menuStore;
this.userStore = this.props.userStore;
}
static navigationOptions = {
drawerLabel: "My Orders",
swipeEnabled: false,
tabBarLabel: "My Order"
};
componentWillMount() {
// this.init();
}
init() {
if (this.userStore.logined == false) {
// this.props.navigation.navigate('Login')
} else {
var token = this.userStore.userData.data.token;
this.store.getOrder(this, token);
}
}
componentDidMount(){
log.firebaseClass('orders')
console.log('componentDidMount')
this.props.navigation.addListener('willFocus', (route) => {this.init()});
}
render() {
console.log(this.store.passOrder);
return (
);
}
}
const PassOrder = props => {
return (
);
};
const CurrentOrder = props => {
return (
{/*
Order details
Status
*/}
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "white",
...Platform.select({
android: {
marginTop: verticalScale(30)
}
})
},
flatViewContainer: {
height: "98%",
width: "100%",
alignItems: "center",
marginBottom: 40
},
textView: {
marginLeft: scale(15),
marginBottom: scale(5)
}
});