import React, {Fragment, useRef, useEffect, useState} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import Home from '../screens/home';
import NotificationDetail from '../screens/notification/detail';
import TabNavigator from './TabNavigation';
import * as ScreenName from './ScreenNames';
import NotificationAdd from '../screens/notification/add';

const Stack = createStackNavigator();

function MyStack(props) {
  return (
    <Stack.Navigator
      screenOptions={{
        headerStatusBarHeight: 0,
      }}
      headerMode={'none'}
      initialRouteName={ScreenName.TABNAVIGATOR}>
      <Stack.Screen name={ScreenName.HOMESCREEN} component={Home} />
      <Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} />
      <Stack.Screen name={ScreenName.DETAILNOTIFICATION} component={NotificationDetail} />
      <Stack.Screen name={ScreenName.ADDNOTIFICATION} component={NotificationAdd} />
    </Stack.Navigator>
  );
}

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