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' import store from 'src/stacks/common/store' import { Provider } from 'react-redux' import Toast from 'react-native-toast-message' import { StatusBar } from 'expo-status-bar' import Local from 'src/stacks/Local' import Public from 'src/stacks/Public' import PostRoot from 'src/stacks/PostRoot' import Notifications from 'src/stacks/Notifications' import Me from 'src/stacks/Me' enableScreens() const Tab = createBottomTabNavigator() export const Index: React.FC = () => { return ( ({ tabBarIcon: ({ focused, color, size }) => { let name: string switch (route.name) { case 'Local': name = 'home' break case 'Public': name = 'globe' break case 'PostRoot': name = 'plus' break case 'Notifications': name = 'bell' break case '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: 'PostToot' }) } })} /> Toast.setRef(ref)} /> ) }