|
@@ -2,6 +2,11 @@ import React, { useEffect } from 'react';
|
|
|
import { useFonts } from 'expo-font';
|
|
|
import * as SplashScreen from 'expo-splash-screen';
|
|
|
|
|
|
+import GlobeIcon from './assets/icons/globe.svg';
|
|
|
+import PeoplesIcon from './assets/icons/peoples.svg';
|
|
|
+import ProfileIcon from './assets/icons/profile.svg';
|
|
|
+import MapIcon from './assets/icons/map.svg';
|
|
|
+
|
|
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
|
|
|
@@ -12,6 +17,11 @@ import ResetPasswordDeepScreen from './src/screens/ResetPasswordDeepScreen';
|
|
|
import JoinUsScreen from './src/screens/RegisterScreen/JoinUs';
|
|
|
import EditAccount from './src/screens/RegisterScreen/EditAccount';
|
|
|
|
|
|
+import TravelsScreen from './src/screens/InAppScreens/TravelsScreen';
|
|
|
+import ProfileScreen from './src/screens/InAppScreens/ProfileScreen';
|
|
|
+import MapScreen from './src/screens/InAppScreens/MapScreen';
|
|
|
+import TravellersScreen from './src/screens/InAppScreens/TravellersScreen';
|
|
|
+
|
|
|
import { NAVIGATION_PAGES } from './src/types';
|
|
|
import { storageGet } from './src/storage';
|
|
|
|
|
@@ -41,12 +51,13 @@ const Route = () => {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- const token = storageGet('token');
|
|
|
+ let token: string | null = '';
|
|
|
+ storageGet('token').then((data) => (token = data));
|
|
|
|
|
|
return (
|
|
|
<ScreenStack.Navigator
|
|
|
screenOptions={{ headerShown: false }}
|
|
|
- initialRouteName={NAVIGATION_PAGES.WELCOME}
|
|
|
+ initialRouteName={token ? NAVIGATION_PAGES.IN_APP : NAVIGATION_PAGES.WELCOME}
|
|
|
>
|
|
|
<ScreenStack.Screen name={NAVIGATION_PAGES.WELCOME} component={WelcomeScreen} />
|
|
|
<ScreenStack.Screen name={NAVIGATION_PAGES.LOGIN} component={LoginScreen} />
|
|
@@ -64,9 +75,34 @@ const Route = () => {
|
|
|
headerShown: false
|
|
|
})}
|
|
|
>
|
|
|
- <BottomTab.Screen name={NAVIGATION_PAGES.LOCATION_TAB} component={WelcomeScreen} />
|
|
|
- <BottomTab.Screen name={NAVIGATION_PAGES.TRAVELS_TAB} component={WelcomeScreen} />
|
|
|
- <BottomTab.Screen name={NAVIGATION_PAGES.PROFILE_TAB} component={WelcomeScreen} />
|
|
|
+ <BottomTab.Screen
|
|
|
+ options={{
|
|
|
+ tabBarIcon: ({ color }) => <MapIcon fill={color} />
|
|
|
+ }}
|
|
|
+ name={NAVIGATION_PAGES.MAP_TAB}
|
|
|
+ component={MapScreen}
|
|
|
+ />
|
|
|
+ <BottomTab.Screen
|
|
|
+ options={{
|
|
|
+ tabBarIcon: ({ color }) => <PeoplesIcon fill={color} />
|
|
|
+ }}
|
|
|
+ name={NAVIGATION_PAGES.TRAVELLERS_TAB}
|
|
|
+ component={TravellersScreen}
|
|
|
+ />
|
|
|
+ <BottomTab.Screen
|
|
|
+ options={{
|
|
|
+ tabBarIcon: ({ color }) => <GlobeIcon fill={color} />
|
|
|
+ }}
|
|
|
+ name={NAVIGATION_PAGES.TRAVELS_TAB}
|
|
|
+ component={TravelsScreen}
|
|
|
+ />
|
|
|
+ <BottomTab.Screen
|
|
|
+ options={{
|
|
|
+ tabBarIcon: ({ color }) => <ProfileIcon fill={color} />
|
|
|
+ }}
|
|
|
+ name={NAVIGATION_PAGES.PROFILE_TAB}
|
|
|
+ component={ProfileScreen}
|
|
|
+ />
|
|
|
</BottomTab.Navigator>
|
|
|
)}
|
|
|
</ScreenStack.Screen>
|