import React from 'react'; import { CommonActions, NavigationContainer as NavigationContainerBase, } from '@react-navigation/native'; import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { BottomNavigation, Portal, useTheme } from 'react-native-paper'; import { Home, Tags, Settings, AddMeme, AddTag } from './screens'; import { horizontalScale } from './styles'; import { FloatingActionButton } from './components'; import { darkNavigationTheme, lightNavigationTheme } from './theme'; const TabNavigator = () => { const TabNavigatorBase = createBottomTabNavigator(); const [fabVisible, setFabVisible] = React.useState(true); return ( <> ( { const event = navigation.emit({ type: 'tabPress', target: route.key, canPreventDefault: true, }); if (event.defaultPrevented) { preventDefault(); } else { navigation.dispatch({ ...CommonActions.navigate(route.name, route.params), target: state.key, }); } route.name === 'Settings' ? setFabVisible(false) : setFabVisible(true); }} renderIcon={({ route, focused, color }) => { const { options } = descriptors[route.key]; if (options.tabBarIcon) { return options.tabBarIcon({ focused, color, size: horizontalScale(20), }); } }} getLabelText={({ route }) => { const { options } = descriptors[route.key]; return options.title ?? route.name; }} /> )}> ( ), }} /> ( ), }} /> ( ), }} /> ); }; const NavigationContainer = () => { const StackNavigatorBase = createNativeStackNavigator(); const theme = useTheme(); return ( ); }; export default NavigationContainer;