import React, {Fragment, useRef, useEffect, useState} from 'react';
import {SafeAreaView} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';

import TabNavigator from './TabNavigation';
import Login from '../Screens/Login/Login';

import AccountVerificaiton from '../Screens/AccountVerification/AccountVerification';
import Feedback from '../Screens/Feedback/Feedback';
import MethodPay from '../Screens/MethodPay/MethodPay';
import ServiceCustomer from '../Screens/ServiceCustomer/ServiceCustomer';
import Setting from '../Screens/Setting/Setting';

import BonusTeam from '../Screens/Menu/BonusTeam/BonusTeam';
import MyGroup from '../Screens/Menu/MyGroup/MyGroup';
import Payments from '../Screens/Menu/Payments/Payments';
import Rose from '../Screens/Menu/Rose/Rose';
import UserInfor from '../Screens/Menu/UserInfor/UserInfor';

import Withdraw from '../Screens/Action/Withdraw/Withdraw';
import Transfer from '../Screens/Action/Transfer/Transfer';
import Deposit from '../Screens/Action/Deposit/Deposit';
import History from '../Screens/Action/History/History';
import Authen from '../Screens/Authen/Authen';
import ForgotPassWord from '../Screens/Authen/ForgotPassword';

import * as ScreenName from './ScreenNames';

const Stack = createStackNavigator();

function MyStack(props) {
  return (
    <Stack.Navigator
      screenOptions={{
        headerStatusBarHeight: 0,
      }}
      headerMode={'none'}
      initialRouteName={ScreenName.AUTHEN}>
      <Stack.Screen name={ScreenName.LOGINSCREEN} component={Login} />
      <Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} />
      <Stack.Screen
        name={ScreenName.AccountVerification}
        component={AccountVerificaiton}
      />
      <Stack.Screen name={ScreenName.FEEDBACK} component={Feedback} />
      <Stack.Screen name={ScreenName.AUTHEN} component={Authen} />
      <Stack.Screen name={ScreenName.METHODPAY} component={MethodPay} />
      <Stack.Screen
        name={ScreenName.SERVICECUSTOMER}
        component={ServiceCustomer}
      />
      <Stack.Screen name={ScreenName.BONUSTEAM} component={BonusTeam} />
      <Stack.Screen name={ScreenName.MYGROUP} component={MyGroup} />
      <Stack.Screen name={ScreenName.PAYMENTS} component={Payments} />
      <Stack.Screen name={ScreenName.ROSE} component={Rose} />
      <Stack.Screen name={ScreenName.USERINFOR} component={UserInfor} />
      <Stack.Screen name={ScreenName.SETTING} component={Setting} />

      <Stack.Screen name={ScreenName.WITHDRAW} component={Withdraw} />
      <Stack.Screen name={ScreenName.DEPOSIT} component={Deposit} />
      <Stack.Screen name={ScreenName.TRANSFER} component={Transfer} />
      <Stack.Screen name={ScreenName.HISTORY} component={History} />
      <Stack.Screen
        name={ScreenName.FORGOTPASSWORD}
        component={ForgotPassWord}
      />
    </Stack.Navigator>
  );
}

export default function App() {
  return (
    <Fragment>
      <NavigationContainer independent={true}>
        <MyStack />
      </NavigationContainer>
    </Fragment>
  );
}
