StackNavigation.js 1.62 KB
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 * as ScreenName from './ScreenNames';

const Stack = createStackNavigator();

function MyStack(props) {
  return (
    <Stack.Navigator
      headerMode={'none'}
      initialRouteName={ScreenName.TABNAVIGATOR}>
      <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.METHODPAY} component={MethodPay} />
      <Stack.Screen
        name={ScreenName.SERVICECUSTOMER}
        component={ServiceCustomer}
      />
      <Stack.Screen name={ScreenName.SETTING} component={Setting} />
    </Stack.Navigator>
  );
}

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