浏览代码

feat: new assets | new screens | route changes

Oleksandr Honcharov 1 年之前
父节点
当前提交
3b71384775

+ 41 - 5
Route.tsx

@@ -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>

文件差异内容过多而无法显示
+ 1 - 0
assets/icons/globe.svg


+ 4 - 0
assets/icons/map.svg

@@ -0,0 +1,4 @@
+<svg width="22" height="26" viewBox="0 0 22 26" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 6.29167C8.42267 6.29167 6.33333 8.381 6.33333 10.9583C6.33333 13.5357 8.42267 15.625 11 15.625C13.5773 15.625 15.6667 13.5357 15.6667 10.9583C15.6667 8.381 13.5773 6.29167 11 6.29167ZM8.66667 10.9583C8.66667 9.66967 9.71134 8.625 11 8.625C12.2887 8.625 13.3333 9.66967 13.3333 10.9583C13.3333 12.247 12.2887 13.2917 11 13.2917C9.71134 13.2917 8.66667 12.247 8.66667 10.9583Z" />
+<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 11.25C21.5 17.6667 13.3333 25.8333 11 25.8333C8.66667 25.8333 0.5 17.6667 0.5 11.25C0.5 5.45101 5.20101 0.75 11 0.75C16.799 0.75 21.5 5.45101 21.5 11.25ZM19.1667 11.25C19.1667 13.6239 17.5632 16.7354 15.3212 19.4678C14.2442 20.7804 13.1214 21.8797 12.1767 22.6276C11.702 23.0034 11.3134 23.2577 11.0315 23.4066L11 23.423L10.9685 23.4066C10.6866 23.2577 10.298 23.0034 9.82331 22.6276C8.8786 21.8797 7.75581 20.7804 6.67884 19.4678C4.43684 16.7354 2.83333 13.6239 2.83333 11.25C2.83333 6.73967 6.48967 3.08333 11 3.08333C15.5103 3.08333 19.1667 6.73967 19.1667 11.25Z" fill="#0F3F4F"/>
+</svg>

+ 6 - 0
assets/icons/peoples.svg

@@ -0,0 +1,6 @@
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.64491 1.54857C5.53402 1.54857 3.83543 3.25521 3.83543 5.35805C3.83543 7.40528 5.43467 9.06634 7.4538 9.15602C7.57625 9.1475 7.70561 9.14708 7.82765 9.15593C9.84479 9.0653 11.445 7.40534 11.4544 5.35647C11.4535 3.25549 9.74609 1.54857 7.64491 1.54857ZM2.28687 5.35805C2.28687 2.40223 4.6765 0 7.64491 0C10.6019 0 13.003 2.40109 13.003 5.35805L13.003 5.36127C12.9909 8.25234 10.7121 10.6087 7.83611 10.7053C7.80172 10.7065 7.76729 10.7054 7.73305 10.7019C7.68327 10.697 7.60887 10.6963 7.53951 10.7026C7.50756 10.7055 7.47546 10.7064 7.4434 10.7053C4.56801 10.6087 2.28687 8.25219 2.28687 5.35805Z" />
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5203 2.83898C14.5203 2.41136 14.8669 2.0647 15.2945 2.0647C17.7264 2.0647 19.6822 4.03363 19.6822 6.45231C19.6822 8.82209 17.8021 10.7516 15.4577 10.8394C15.416 10.8409 15.3742 10.8391 15.3327 10.8339C15.3172 10.832 15.2857 10.8308 15.2458 10.8352C14.8208 10.8824 14.438 10.5762 14.3908 10.1511C14.3436 9.72613 14.6498 9.34331 15.0748 9.29609C15.1964 9.28258 15.3238 9.27945 15.4495 9.2896C16.943 9.20773 18.1336 7.96815 18.1336 6.45231C18.1336 4.886 16.8683 3.61327 15.2945 3.61327C14.8669 3.61327 14.5203 3.26661 14.5203 2.83898Z"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.82285 11.5498C9.81349 11.5498 11.8434 12.0494 13.4122 13.0971C14.8223 14.0357 15.6302 15.3514 15.6302 16.7672C15.6302 18.1829 14.8224 19.5009 13.4129 20.4445L13.4127 20.4446C11.8392 21.4975 9.80666 22.0001 7.81511 22.0001C5.82395 22.0001 3.79184 21.4977 2.2184 20.4452C0.808052 19.5067 0 18.1909 0 16.7749C0 15.3592 0.807777 14.0412 2.21733 13.0976L2.22017 13.0957L2.22018 13.0957C3.7981 12.0495 5.83197 11.5498 7.82285 11.5498ZM3.07735 14.3854C1.98959 15.1141 1.54857 15.9946 1.54857 16.7749C1.54857 17.5551 1.9894 18.4329 3.07693 19.1564L3.07863 19.1576C4.3441 20.0043 6.05912 20.4515 7.81511 20.4515C9.57103 20.4515 11.286 20.0043 12.5514 19.1577C13.6403 18.4288 14.0817 17.5479 14.0817 16.7672C14.0817 15.987 13.6408 15.1092 12.5533 14.3857L12.5521 14.3849C11.2922 13.5434 9.57976 13.0984 7.82285 13.0984C6.06685 13.0984 4.34866 13.543 3.07735 14.3854Z"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5629 12.9924C16.6569 12.5753 17.0713 12.3133 17.4884 12.4073C18.3034 12.591 19.1033 12.9186 19.778 13.4331C20.7495 14.1628 21.2929 15.1799 21.2929 16.2546C21.2929 17.329 20.7498 18.3458 19.7788 19.0755C19.0959 19.5989 18.2838 19.9402 17.4452 20.1149C17.0265 20.2021 16.6165 19.9335 16.5292 19.5148C16.442 19.0962 16.7107 18.6861 17.1293 18.5989C17.7759 18.4642 18.3665 18.2076 18.8392 17.8446L18.8461 17.8393L18.8461 17.8393C19.4834 17.3613 19.7443 16.7791 19.7443 16.2546C19.7443 15.7301 19.4834 15.1479 18.8461 14.6699L18.8408 14.6659L18.8408 14.6659C18.3805 14.3143 17.7979 14.0644 17.148 13.918C16.7308 13.824 16.4689 13.4096 16.5629 12.9924Z" />
+</svg>

+ 4 - 0
assets/icons/profile.svg

@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6449 2.54857C9.53402 2.54857 7.83543 4.25521 7.83543 6.35805C7.83543 8.40528 9.43467 10.0663 11.4538 10.156C11.5762 10.1475 11.7056 10.1471 11.8276 10.1559C13.8448 10.0653 15.445 8.40534 15.4544 6.35647C15.4535 4.25549 13.7461 2.54857 11.6449 2.54857ZM6.28687 6.35805C6.28687 3.40223 8.6765 1 11.6449 1C14.6019 1 17.003 3.40109 17.003 6.35805L17.003 6.36127C16.9909 9.25234 14.7121 11.6087 11.8361 11.7053C11.8017 11.7065 11.7673 11.7054 11.733 11.7019C11.6833 11.697 11.6089 11.6963 11.5395 11.7026C11.5076 11.7055 11.4755 11.7064 11.4434 11.7053C8.56801 11.6087 6.28687 9.25219 6.28687 6.35805Z"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11.8229 12.5498C13.8135 12.5498 15.8434 13.0494 17.4122 14.0971C18.8223 15.0357 19.6302 16.3514 19.6302 17.7672C19.6302 19.1829 18.8224 20.5009 17.4129 21.4445L17.4127 21.4446C15.8392 22.4975 13.8067 23.0001 11.8151 23.0001C9.82395 23.0001 7.79184 22.4977 6.2184 21.4452C4.80805 20.5067 4 19.1909 4 17.7749C4 16.3592 4.80778 15.0412 6.21733 14.0976L6.22017 14.0957L6.22018 14.0957C7.7981 13.0495 9.83197 12.5498 11.8229 12.5498ZM7.07735 15.3854C5.98959 16.1141 5.54857 16.9946 5.54857 17.7749C5.54857 18.5551 5.9894 19.4329 7.07693 20.1564L7.07863 20.1576C8.3441 21.0043 10.0591 21.4515 11.8151 21.4515C13.571 21.4515 15.286 21.0043 16.5514 20.1577C17.6403 19.4288 18.0817 18.5479 18.0817 17.7672C18.0817 16.987 17.6408 16.1092 16.5533 15.3857L16.5521 15.3849C15.2922 14.5434 13.5798 14.0984 11.8229 14.0984C10.0669 14.0984 8.34866 14.543 7.07735 15.3854Z"/>
+</svg>

+ 12 - 0
src/screens/InAppScreens/MapScreen/index.tsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import { View, Text } from 'react-native';
+
+const MapScreen = () => {
+  return (
+    <View>
+      <Text>Map Screen</Text>
+    </View>
+  );
+};
+
+export default MapScreen;

+ 12 - 0
src/screens/InAppScreens/ProfileScreen/index.tsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import { View, Text } from 'react-native';
+
+const ProfileScreen = () => {
+  return (
+    <View>
+      <Text>Profile Screen</Text>
+    </View>
+  );
+};
+
+export default ProfileScreen;

+ 12 - 0
src/screens/InAppScreens/TravellersScreen/index.tsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import { View, Text } from 'react-native';
+
+const TravellersScreen = () => {
+  return (
+    <View>
+      <Text>Travellers Screen</Text>
+    </View>
+  );
+};
+
+export default TravellersScreen;

+ 12 - 0
src/screens/InAppScreens/TravelsScreen/index.tsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import { View, Text } from 'react-native';
+
+const TravelsScreen = () => {
+  return (
+    <View>
+      <Text>Travels Screen</Text>
+    </View>
+  );
+};
+
+export default TravelsScreen;

+ 2 - 1
src/types/navigation.ts

@@ -6,7 +6,8 @@ export enum NAVIGATION_PAGES {
   RESET_PASSWORD = 'resetPassword',
   RESET_PASSWORD_DEEP = 'resetPasswordDeep',
   IN_APP = 'inAppStack',
-  LOCATION_TAB = 'Location',
+  MAP_TAB = 'Map',
+  TRAVELLERS_TAB = 'Travellers',
   TRAVELS_TAB = 'Travels',
   PROFILE_TAB = 'Profile'
 }

部分文件因为文件数量过多而无法显示