-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
60 lines (54 loc) · 2.33 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React from 'react';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { Provider } from 'react-redux';
import { store } from './src/lib/store';
import InboxScreen from './src/screens/InboxScreen';
import MapScreen from './src/screens/MapScreen';
import MyTripsScreen from './src/screens/MyTripsScreen';
import ProfileScreen from './src/screens/ProfileScreen';
import PublishScreen from './src/screens/PublishScreen';
import SearchScreen from './src/screens/SearchScreen';
import SelectLocationScreen from './src/screens/SelectLocationScreen';
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function SearchStackScreen() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="SearchInsideStack" component={SearchScreen} />
<Stack.Screen name="SearchLocation" component={SelectLocationScreen} />
<Stack.Screen name="MapScreen" component={MapScreen} />
</Stack.Navigator>
);
}
export default () => (
<Provider store={store}>
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Search') {
iconName = focused ? 'ios-information-circle' : 'ios-information-circle-outline';
} else if (route.name === 'Publish') {
iconName = focused ? 'ios-list-circle' : 'ios-list';
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: 'tomato',
tabBarInactiveTintColor: 'gray',
headerShown: false,
})}
>
<Tab.Screen name="Search" component={SearchStackScreen} />
<Tab.Screen name="Publish" component={PublishScreen} />
<Tab.Screen name="My Trips" component={MyTripsScreen} />
<Tab.Screen name="Inbox" component={InboxScreen} />
<Tab.Screen name="Profile" component={ProfileScreen} />
</Tab.Navigator>
</NavigationContainer>
</Provider>
);