import 'react-native-gesture-handler' import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' import { NavigationContainer } from '@react-navigation/native' import { enableScreens } from 'react-native-screens' import React from 'react' import { Feather } from '@expo/vector-icons' // @ts-ignore import Toast from 'react-native-toast-message' import ScreenLocal from 'src/screens/Local' import ScreenPublic from 'src/screens/Public' import ScreenNotifications from 'src/screens/Notifications' import ScreenMe from 'src/screens/Me' enableScreens() const Tab = createBottomTabNavigator() export const Index: React.FC = () => { return ( ({ tabBarIcon: ({ focused, color, size }) => { let name: string switch (route.name) { case 'Screen-Local': name = 'home' break case 'Screen-Public': name = 'globe' break case 'Screen-Post': name = 'plus' break case 'Screen-Notifications': name = 'bell' break case 'Screen-Me': name = focused ? 'smile' : 'meh' break default: name = 'alert-octagon' break } return } })} tabBarOptions={{ activeTintColor: 'black', inactiveTintColor: 'gray', showLabel: false }} > ({ tabPress: e => { e.preventDefault() const { length, [length - 1]: last } = navigation.dangerouslyGetState().history navigation.navigate(last.key.split(new RegExp(/(.*)-/))[1], { screen: 'Screen-Shared-Compose' }) } })} > {() => <>} Toast.setRef(ref)} /> ) }