import 'react-native-gesture-handler'; import React, {useLayoutEffect} from 'react'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createStackNavigator } from '@react-navigation/stack'; import { DefaultTheme } from 'react-native-paper' import Map from '../screens/Map' import { MockProvider, useMockState } from '../contexts/MockContext'; import Icon from 'react-native-vector-icons/FontAwesome'; import Account from '../screens/Account'; import LandmarkForm from '../screens/LandmarkForm'; import { getFocusedRouteNameFromRoute } from '@react-navigation/native'; // unused method for displaying tabbar based on screen shown // const shouldTabBarDisplay = (route) => { // const routeName = getFocusedRouteNameFromRoute(route); // console.log(routeName) // if (routeName == "LandmarkForm") { // return false; // } // return true; // } const Tabs = createBottomTabNavigator(); const MapStack = createStackNavigator(); const AccountStack = createStackNavigator(); const theme = { ...DefaultTheme, colors: { primary: '#df3f3f', accent: 'white', }, } const MapStackNavigator = ({navigation, route}) => { const {dispatch, state} = useMockState(); // useLayoutEffect(() => { // const tabBarShouldDisplay = shouldTabBarDisplay(route); // if (state.tabBarVisible != tabBarShouldDisplay) { // dispatch({type: "CHANGE_TABBAR_VISIBILITY", payload: tabBarShouldDisplay}) // } // }, [navigation, route]); return( ) } const AccountStackNavigator = () => { return( ) } const TabsNavigator = ({route}) => { const {state} = useMockState(); return( (), }} /> (), }} /> ) } export default TabsNavigator;