/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';

import {
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
  TouchableOpacity,
} from 'react-native';
import SafeAreaView from 'react-native-safe-area-view';
import { Provider, inject, observer } from 'mobx-react';
import { observable, makeObservable } from 'mobx'
import Store from './src/stores/index';
import { NavigationContainer, useFocusEffect } from '@react-navigation/native';
import { createStackNavigator, HeaderBackButton } from '@react-navigation/stack';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import {
  Header,
  LearnMoreLinks,
  Colors,
  DebugInstructions,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import SplashScreen from './src/pages/splash/splashScreen';
import Main from './src/pages/main/main';
import Login from './src/pages/login/login'
import Select from './src/pages/select/select'
import SuitStyle from './src/pages/suitStyle/suitStyle'
import Confirm from './src/pages/suitStyle/confirm'
import ConfirmSuit from './src/pages/suitStyle/confirmSuit'
import InputClientData from './src/pages/inputClientData/inputClientData'
import OrderRecord from './src/pages/orderRecord/orderRecord'
import Order from './src/pages/order/order'
import Invoice from './src/pages/invoice/invoice'
const Stack = createStackNavigator();

const Router = inject("appStore")(observer(class Router extends React.Component {
  constructor(props) {
    super(props);
    this.store = props.appStore;
  }

  render() {
    return (
      <SafeAreaView style={{ flex: 1, backgroundColor: 'white' }}>
        <Stack.Navigator initialRouteName="SplashScreen">
          {!this.store.splash ? (
            <>
              <Stack.Screen
                name="SplashScreen"
                component={SplashScreen}
                options={{ headerShown: false }}
              />
            </>
          ) : (
              <>
                <Stack.Screen
                  name="Login"
                  component={Login}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="Main"
                  component={Main}
                  options={{ headerShown: false, gestureEnabled: false }}

                />
                <Stack.Screen
                  name="Select"
                  component={Select}
                  options={{ headerShown: false, gestureEnabled: false }}
                />
                <Stack.Screen
                  name="SuitStyle"
                  component={SuitStyle}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="Confirm"
                  component={Confirm}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="InputClientData"
                  component={InputClientData}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="OrderRecord"
                  component={OrderRecord}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="Order"
                  component={Order}
                  options={{ headerShown: false, gestureEnabled: false }}
                />
                <Stack.Screen
                  name="ConfirmSuit"
                  component={ConfirmSuit}
                  options={{ headerShown: false }}
                />
                <Stack.Screen
                  name="Invoice"
                  component={Invoice}
                  options={{ headerShown: false }}
                />
              </>
            )}
        </Stack.Navigator>
      </SafeAreaView>
    );
  }
}))



export default Router;
