Browse Source

Merge branch 'buttons-relocation' of Viktoriia/nomadmania-app into dev

Viktoriia 11 months ago
parent
commit
b7f9250284

+ 192 - 222
Route.tsx

@@ -76,16 +76,18 @@ import UsersListScreen from 'src/screens/InAppScreens/MapScreen/UsersListScreen'
 import SuggestSeriesScreen from 'src/screens/InAppScreens/TravelsScreen/SuggestSeriesScreen';
 import SuggestSeriesScreen from 'src/screens/InAppScreens/TravelsScreen/SuggestSeriesScreen';
 import MyFriendsScreen from 'src/screens/InAppScreens/ProfileScreen/MyFriendsScreen';
 import MyFriendsScreen from 'src/screens/InAppScreens/ProfileScreen/MyFriendsScreen';
 import CountryViewScreen from 'src/screens/InAppScreens/MapScreen/CountryViewScreen';
 import CountryViewScreen from 'src/screens/InAppScreens/MapScreen/CountryViewScreen';
+import { userApi } from '@api/user';
 
 
 enableScreens();
 enableScreens();
 
 
 const ScreenStack = createStackNavigator();
 const ScreenStack = createStackNavigator();
 const BottomTab = createBottomTabNavigator();
 const BottomTab = createBottomTabNavigator();
+const MapDrawer = createDrawerNavigator();
 
 
 SplashScreen.preventAutoHideAsync();
 SplashScreen.preventAutoHideAsync();
 
 
 const Route = () => {
 const Route = () => {
-  const token = storage.get('token', StoreType.STRING);
+  const token = storage.get('token', StoreType.STRING) as string;
 
 
   const [fontsLoaded] = useFonts({
   const [fontsLoaded] = useFonts({
     'redhat-900': require('./assets/fonts/RedHatDisplay-Black-900.ttf'),
     'redhat-900': require('./assets/fonts/RedHatDisplay-Black-900.ttf'),
@@ -96,6 +98,25 @@ const Route = () => {
     'montserrat-400': require('./assets/fonts/Montserrat-Regular.ttf')
     'montserrat-400': require('./assets/fonts/Montserrat-Regular.ttf')
   });
   });
   const [dbLoaded, setDbLoaded] = useState(false);
   const [dbLoaded, setDbLoaded] = useState(false);
+  const uid = storage.get('uid', StoreType.STRING);
+  const hasUserInfo = storage.get('currentUserData', StoreType.STRING);
+
+  useEffect(() => {
+    const fetchAndSaveUserInfo = async () => {
+      if (uid && token) {
+        const profileData = await userApi.getProfileInfoData(token, +uid);
+        const userInfo = {
+          avatar: profileData?.data?.data?.user_data.avatar ?? '',
+          first_name: profileData?.data?.data?.user_data.first_name,
+          last_name: profileData?.data?.data?.user_data.last_name,
+          homebase_flag: profileData?.data?.data?.user_data.flag1
+        };
+        storage.set('currentUserData', JSON.stringify(userInfo));
+      }
+    };
+
+    fetchAndSaveUserInfo();
+  }, [hasUserInfo]);
 
 
   useEffect(() => {
   useEffect(() => {
     const prepareApp = async () => {
     const prepareApp = async () => {
@@ -142,14 +163,20 @@ const Route = () => {
   }
   }
 
 
   const screenOptions = ({
   const screenOptions = ({
-    route
+    route,
+    navigation
   }: {
   }: {
     route: RouteProp<ParamListBase, string>;
     route: RouteProp<ParamListBase, string>;
     navigation: any;
     navigation: any;
   }) => ({
   }) => ({
     headerShown: false,
     headerShown: false,
     tabBarButton: (props: any) => (
     tabBarButton: (props: any) => (
-      <TabBarButton {...props} label={route.name} focused={props.accessibilityState.selected} />
+      <TabBarButton
+        {...props}
+        label={route.name}
+        focused={props?.accessibilityState?.selected || false}
+        navigation={navigation}
+      />
     ),
     ),
     tabBarStyle: {
     tabBarStyle: {
       ...Platform.select({
       ...Platform.select({
@@ -172,19 +199,162 @@ const Route = () => {
     }
     }
   };
   };
 
 
-  const MapDrawer = createDrawerNavigator();
+  const BottomTabNavigator = () => (
+    <BottomTab.Navigator screenOptions={screenOptions}>
+      <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_MAP_TAB}>
+        {() => (
+          <ScreenStack.Navigator screenOptions={screenOptions}>
+            <ScreenStack.Screen name={NAVIGATION_PAGES.MAP_TAB} component={MapScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
+              component={ProfileScreen}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.USERS_MAP} component={UsersMapScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.REGION_PREVIEW}
+              component={RegionViewScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.USERS_LIST}
+              component={UsersListScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.FRIENDS_LIST}
+              component={UsersListScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.COUNTRY_PREVIEW}
+              component={CountryViewScreen}
+              options={regionViewScreenOptions}
+            />
 
 
-  function MapDrawerNavigator() {
-    return (
-      <MapDrawer.Navigator drawerContent={(props) => <MenuDrawer {...props} />}>
-        <MapDrawer.Screen
-          options={{ headerShown: false }}
-          name="MapDrawerScreen"
-          component={MapScreen}
-        />
-      </MapDrawer.Navigator>
-    );
-  }
+            <ScreenStack.Screen name={NAVIGATION_PAGES.PROFILE_TAB} component={ProfileScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.EDIT_PERSONAL_INFO}
+              component={EditPersonalInfo}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.SETTINGS} component={Settings} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.MY_FRIENDS}
+              component={MyFriendsScreen}
+              options={regionViewScreenOptions}
+            />
+          </ScreenStack.Navigator>
+        )}
+      </BottomTab.Screen>
+      <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_TRAVELS_TAB}>
+        {() => (
+          <ScreenStack.Navigator screenOptions={screenOptions}>
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRAVELS_TAB} component={TravelsScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.SERIES} component={SeriesScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.SERIES_ITEM} component={SeriesItemScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.EARTH} component={EarthScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.PHOTOS} component={PhotosScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.MORE_PHOTOS} component={MorePhotosScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.ADD_PHOTO} component={AddPhotoScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRIPS} component={TripsScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.ADD_TRIP} component={AddNewTripScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.ADD_REGIONS} component={AddRegionsScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.COUNTRIES} component={CountriesScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.REGIONS} component={RegionsScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.DARE} component={DareScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.REGION_PREVIEW}
+              component={RegionViewScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.USERS_LIST}
+              component={UsersListScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
+              component={ProfileScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.EDIT_PERSONAL_INFO}
+              component={EditPersonalInfo}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.USERS_MAP} component={UsersMapScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.SUGGEST_SERIES}
+              component={SuggestSeriesScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.FRIENDS_LIST}
+              component={UsersListScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.COUNTRY_PREVIEW}
+              component={CountryViewScreen}
+              options={regionViewScreenOptions}
+            />
+          </ScreenStack.Navigator>
+        )}
+      </BottomTab.Screen>
+      <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_TRAVELLERS_TAB}>
+        {() => (
+          <ScreenStack.Navigator screenOptions={screenOptions}>
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.TRAVELLERS_TAB}
+              component={TravellersScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.MASTER_RANKING}
+              component={MasterRankingScreen}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.LPI_RANKING} component={LPIRanking} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.IN_MEMORIAM} component={InMemoriamScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.IN_HISTORY} component={InHistoryScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.UN_MASTERS} component={UNMastersScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.STATISTICS} component={StatisticsScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
+              component={ProfileScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.EDIT_PERSONAL_INFO}
+              component={EditPersonalInfo}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.STATISTICS_LIST_DATA}
+              component={StatisticsListScreen}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRIUMPHS} component={TriumphsScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.SERIES_RANKING}
+              component={SeriesRankingScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.SERIES_RANKING_LIST}
+              component={SeriesRankingListScreen}
+            />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.USERS_MAP} component={UsersMapScreen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.FRIENDS_LIST}
+              component={UsersListScreen}
+              options={regionViewScreenOptions}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.MY_FRIENDS}
+              component={MyFriendsScreen}
+              options={regionViewScreenOptions}
+            />
+          </ScreenStack.Navigator>
+        )}
+      </BottomTab.Screen>
+      <BottomTab.Screen name={NAVIGATION_PAGES.MENU_DRAWER}>
+        {() => {
+          return null;
+        }}
+      </BottomTab.Screen>
+    </BottomTab.Navigator>
+  );
 
 
   return (
   return (
     <ScreenStack.Navigator
     <ScreenStack.Navigator
@@ -215,213 +385,13 @@ const Route = () => {
       <ScreenStack.Screen name={NAVIGATION_PAGES.EARTH_INFO} component={EarthInfoScreen} />
       <ScreenStack.Screen name={NAVIGATION_PAGES.EARTH_INFO} component={EarthInfoScreen} />
       <ScreenStack.Screen name={NAVIGATION_PAGES.IN_APP}>
       <ScreenStack.Screen name={NAVIGATION_PAGES.IN_APP}>
         {() => (
         {() => (
-          <BottomTab.Navigator screenOptions={screenOptions}>
-            <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_MAP_TAB}>
-              {() => (
-                <ScreenStack.Navigator screenOptions={screenOptions}>
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.MAP_TAB}
-                    component={MapDrawerNavigator}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
-                    component={ProfileScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_MAP}
-                    component={UsersMapScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.REGION_PREVIEW}
-                    component={RegionViewScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.FRIENDS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.COUNTRY_PREVIEW}
-                    component={CountryViewScreen}
-                    options={regionViewScreenOptions}
-                  />
-                </ScreenStack.Navigator>
-              )}
-            </BottomTab.Screen>
-            <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_TRAVELS_TAB}>
-              {() => (
-                <ScreenStack.Navigator screenOptions={screenOptions}>
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.TRAVELS_TAB}
-                    component={TravelsScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.SERIES} component={SeriesScreen} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.SERIES_ITEM}
-                    component={SeriesItemScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.EARTH} component={EarthScreen} />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.PHOTOS} component={PhotosScreen} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.MORE_PHOTOS}
-                    component={MorePhotosScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.ADD_PHOTO}
-                    component={AddPhotoScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.TRIPS} component={TripsScreen} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.ADD_TRIP}
-                    component={AddNewTripScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.ADD_REGIONS}
-                    component={AddRegionsScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.COUNTRIES}
-                    component={CountriesScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.REGIONS} component={RegionsScreen} />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.DARE} component={DareScreen} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.REGION_PREVIEW}
-                    component={RegionViewScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
-                    component={ProfileScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_MAP}
-                    component={UsersMapScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.SUGGEST_SERIES}
-                    component={SuggestSeriesScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.FRIENDS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.COUNTRY_PREVIEW}
-                    component={CountryViewScreen}
-                    options={regionViewScreenOptions}
-                  />
-                </ScreenStack.Navigator>
-              )}
-            </BottomTab.Screen>
-            <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_TRAVELLERS_TAB}>
-              {() => (
-                <ScreenStack.Navigator screenOptions={screenOptions}>
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.TRAVELLERS_TAB}
-                    component={TravellersScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.MASTER_RANKING}
-                    component={MasterRankingScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.LPI_RANKING} component={LPIRanking} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.IN_MEMORIAM}
-                    component={InMemoriamScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.IN_HISTORY}
-                    component={InHistoryScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.UN_MASTERS}
-                    component={UNMastersScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.STATISTICS}
-                    component={StatisticsScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
-                    component={ProfileScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.STATISTICS_LIST_DATA}
-                    component={StatisticsListScreen}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.TRIUMPHS} component={TriumphsScreen} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.SERIES_RANKING}
-                    component={SeriesRankingScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.SERIES_RANKING_LIST}
-                    component={SeriesRankingListScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_MAP}
-                    component={UsersMapScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.FRIENDS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.MY_FRIENDS}
-                    component={MyFriendsScreen}
-                    options={regionViewScreenOptions}
-                  />
-                </ScreenStack.Navigator>
-              )}
-            </BottomTab.Screen>
-            <BottomTab.Screen name={NAVIGATION_PAGES.IN_APP_PROFILE}>
-              {() => (
-                <ScreenStack.Navigator screenOptions={screenOptions}>
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.PROFILE_TAB}
-                    component={ProfileScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.EDIT_PERSONAL_INFO}
-                    component={EditPersonalInfo}
-                  />
-                  <ScreenStack.Screen name={NAVIGATION_PAGES.SETTINGS} component={Settings} />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.FRIENDS_LIST}
-                    component={UsersListScreen}
-                    options={regionViewScreenOptions}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW}
-                    component={ProfileScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.USERS_MAP}
-                    component={UsersMapScreen}
-                  />
-                  <ScreenStack.Screen
-                    name={NAVIGATION_PAGES.MY_FRIENDS}
-                    component={MyFriendsScreen}
-                    options={regionViewScreenOptions}
-                  />
-                </ScreenStack.Navigator>
-              )}
-            </BottomTab.Screen>
-          </BottomTab.Navigator>
+          <MapDrawer.Navigator drawerContent={(props) => <MenuDrawer {...props} />}>
+            <MapDrawer.Screen
+              name="DrawerApp"
+              component={BottomTabNavigator}
+              options={{ headerShown: false }}
+            />
+          </MapDrawer.Navigator>
         )}
         )}
       </ScreenStack.Screen>
       </ScreenStack.Screen>
     </ScreenStack.Navigator>
     </ScreenStack.Navigator>

+ 1 - 1
assets/icons/menu.svg

@@ -1,3 +1,3 @@
 <svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
 <svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M2.00005 0.800049C1.33731 0.800049 0.800049 1.33731 0.800049 2.00005C0.800049 2.66279 1.33731 3.20005 2.00005 3.20005H18C18.6628 3.20005 19.2001 2.66279 19.2001 2.00005C19.2001 1.33731 18.6628 0.800049 18 0.800049H2.00005ZM0.800049 8.00005C0.800049 7.33731 1.33731 6.80005 2.00005 6.80005H18C18.6628 6.80005 19.2001 7.33731 19.2001 8.00005C19.2001 8.66279 18.6628 9.20005 18 9.20005H2.00005C1.33731 9.20005 0.800049 8.66279 0.800049 8.00005ZM0.800049 14C0.800049 13.3373 1.33731 12.8 2.00005 12.8H18C18.6628 12.8 19.2001 13.3373 19.2001 14C19.2001 14.6628 18.6628 15.2 18 15.2H2.00005C1.33731 15.2 0.800049 14.6628 0.800049 14Z" fill="#0F3F4F"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M2.00005 0.800049C1.33731 0.800049 0.800049 1.33731 0.800049 2.00005C0.800049 2.66279 1.33731 3.20005 2.00005 3.20005H18C18.6628 3.20005 19.2001 2.66279 19.2001 2.00005C19.2001 1.33731 18.6628 0.800049 18 0.800049H2.00005ZM0.800049 8.00005C0.800049 7.33731 1.33731 6.80005 2.00005 6.80005H18C18.6628 6.80005 19.2001 7.33731 19.2001 8.00005C19.2001 8.66279 18.6628 9.20005 18 9.20005H2.00005C1.33731 9.20005 0.800049 8.66279 0.800049 8.00005ZM0.800049 14C0.800049 13.3373 1.33731 12.8 2.00005 12.8H18C18.6628 12.8 19.2001 13.3373 19.2001 14C19.2001 14.6628 18.6628 15.2 18 15.2H2.00005C1.33731 15.2 0.800049 14.6628 0.800049 14Z"/>
 </svg>
 </svg>

+ 9 - 0
src/components/MenuDrawer/index.tsx

@@ -14,6 +14,8 @@ import MailIcon from '../../../assets/icons/mail.svg';
 import DocumentIcon from '../../../assets/icons/document.svg';
 import DocumentIcon from '../../../assets/icons/document.svg';
 import ExitIcon from '../../../assets/icons/exit.svg';
 import ExitIcon from '../../../assets/icons/exit.svg';
 import UserXMark from '../../../assets/icons/user-xmark.svg';
 import UserXMark from '../../../assets/icons/user-xmark.svg';
+import InfoIcon from 'assets/icons/info-solid.svg';
+
 import { APP_VERSION, FASTEST_MAP_HOST } from 'src/constants';
 import { APP_VERSION, FASTEST_MAP_HOST } from 'src/constants';
 import { useNotification } from 'src/contexts/NotificationContext';
 import { useNotification } from 'src/contexts/NotificationContext';
 
 
@@ -45,6 +47,7 @@ export const MenuDrawer = (props: any) => {
   const handleLogout = () => {
   const handleLogout = () => {
     storage.remove('token');
     storage.remove('token');
     storage.remove('uid');
     storage.remove('uid');
+    storage.remove('currentUserData');
     updateNotificationStatus();
     updateNotificationStatus();
     navigation.dispatch(
     navigation.dispatch(
       CommonActions.reset({
       CommonActions.reset({
@@ -65,6 +68,12 @@ export const MenuDrawer = (props: any) => {
           <View style={styles.logoContainer}>
           <View style={styles.logoContainer}>
             <Image source={require('../../../assets/logo-ua.png')} style={styles.logo} />
             <Image source={require('../../../assets/logo-ua.png')} style={styles.logo} />
           </View>
           </View>
+          <MenuButton
+            label="Info"
+            icon={<InfoIcon fill={Colors.DARK_BLUE} width={20} height={20} />}
+            red={false}
+            buttonFn={() => navigation.navigate(NAVIGATION_PAGES.INFO as never)}
+          />
           <MenuButton
           <MenuButton
             label="Contact Us"
             label="Contact Us"
             icon={<MailIcon fill={Colors.DARK_BLUE} width={20} height={20} />}
             icon={<MailIcon fill={Colors.DARK_BLUE} width={20} height={20} />}

+ 11 - 5
src/components/TabBarButton/index.tsx

@@ -6,7 +6,7 @@ import { NAVIGATION_PAGES } from '../../types';
 import MapIcon from '../../../assets/icons/bottom-navigation/map.svg';
 import MapIcon from '../../../assets/icons/bottom-navigation/map.svg';
 import TravellersIcon from '../../../assets/icons/bottom-navigation/travellers.svg';
 import TravellersIcon from '../../../assets/icons/bottom-navigation/travellers.svg';
 import GlobeIcon from '../../../assets/icons/bottom-navigation/globe-solid.svg';
 import GlobeIcon from '../../../assets/icons/bottom-navigation/globe-solid.svg';
-import ProfileIcon from '../../../assets/icons/bottom-navigation/profile.svg';
+import MenuIcon from '../../../assets/icons/menu.svg';
 
 
 import { Colors } from '../../theme';
 import { Colors } from '../../theme';
 import { styles } from './style';
 import { styles } from './style';
@@ -21,8 +21,8 @@ const getTabIcon = (routeName: string) => {
       return TravellersIcon;
       return TravellersIcon;
     case NAVIGATION_PAGES.IN_APP_TRAVELS_TAB:
     case NAVIGATION_PAGES.IN_APP_TRAVELS_TAB:
       return GlobeIcon;
       return GlobeIcon;
-    case NAVIGATION_PAGES.IN_APP_PROFILE:
-      return ProfileIcon;
+    case NAVIGATION_PAGES.MENU_DRAWER:
+      return MenuIcon;
     default:
     default:
       return null;
       return null;
   }
   }
@@ -31,11 +31,13 @@ const getTabIcon = (routeName: string) => {
 const TabBarButton = ({
 const TabBarButton = ({
   label,
   label,
   onPress,
   onPress,
-  focused
+  focused,
+  navigation
 }: {
 }: {
   label: string;
   label: string;
   onPress: () => void;
   onPress: () => void;
   focused: boolean;
   focused: boolean;
+  navigation: any;
 }) => {
 }) => {
   const IconComponent: React.FC<SvgProps> | null = getTabIcon(label);
   const IconComponent: React.FC<SvgProps> | null = getTabIcon(label);
   const { isNotificationActive } = useNotification();
   const { isNotificationActive } = useNotification();
@@ -43,7 +45,11 @@ const TabBarButton = ({
   let currentColor = focused ? Colors.DARK_BLUE : Colors.LIGHT_GRAY;
   let currentColor = focused ? Colors.DARK_BLUE : Colors.LIGHT_GRAY;
 
 
   return (
   return (
-    <TouchableWithoutFeedback onPress={onPress}>
+    <TouchableWithoutFeedback
+      onPress={() =>
+        label === NAVIGATION_PAGES.MENU_DRAWER ? (navigation as any)?.openDrawer() : onPress()
+      }
+    >
       <View style={styles.buttonStyle}>
       <View style={styles.buttonStyle}>
         <View style={{ alignItems: 'center' }}>
         <View style={{ alignItems: 'center' }}>
           {IconComponent && <IconComponent width={24} height={24} fill={currentColor} />}
           {IconComponent && <IconComponent width={24} height={24} fill={currentColor} />}

+ 1 - 2
src/screens/InAppScreens/MapScreen/CountryViewScreen/index.tsx

@@ -58,8 +58,7 @@ const CountryViewScreen: FC<Props> = ({ navigation, route }) => {
   useEffect(() => {
   useEffect(() => {
     navigation.getParent()?.setOptions({
     navigation.getParent()?.setOptions({
       tabBarStyle: {
       tabBarStyle: {
-        display: 'none',
-        position: 'absolute',
+        display: 'flex',
         ...Platform.select({
         ...Platform.select({
           android: {
           android: {
             height: 58
             height: 58

+ 1 - 2
src/screens/InAppScreens/MapScreen/RegionViewScreen/index.tsx

@@ -79,8 +79,7 @@ const RegionViewScreen: FC<Props> = ({ navigation, route }) => {
   useEffect(() => {
   useEffect(() => {
     navigation.getParent()?.setOptions({
     navigation.getParent()?.setOptions({
       tabBarStyle: {
       tabBarStyle: {
-        display: 'none',
-        position: 'absolute',
+        display: 'flex',
         ...Platform.select({
         ...Platform.select({
           android: {
           android: {
             height: 58
             height: 58

+ 1 - 1
src/screens/InAppScreens/MapScreen/UniversalSearch/index.tsx

@@ -53,7 +53,7 @@ const SearchModal = ({
             navigation.navigate(
             navigation.navigate(
               ...([
               ...([
                 NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW,
                 NAVIGATION_PAGES.PUBLIC_PROFILE_VIEW,
-                { userId: item.id, hideTabBar: true }
+                { userId: item.id }
               ] as never)
               ] as never)
             );
             );
           }
           }

+ 42 - 39
src/screens/InAppScreens/MapScreen/index.tsx

@@ -6,7 +6,8 @@ import {
   Text,
   Text,
   TextInput,
   TextInput,
   TouchableOpacity,
   TouchableOpacity,
-  View
+  View,
+  Image
 } from 'react-native';
 } from 'react-native';
 import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react';
 import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react';
 import MapView, { Geojson, Marker, UrlTile } from 'react-native-maps';
 import MapView, { Geojson, Marker, UrlTile } from 'react-native-maps';
@@ -15,11 +16,11 @@ import * as FileSystem from 'expo-file-system';
 import * as Location from 'expo-location';
 import * as Location from 'expo-location';
 import { storage, StoreType } from '../../../storage';
 import { storage, StoreType } from '../../../storage';
 
 
-import MenuIcon from '../../../../assets/icons/menu.svg';
 import SearchIcon from '../../../../assets/icons/search.svg';
 import SearchIcon from '../../../../assets/icons/search.svg';
 import LocationIcon from '../../../../assets/icons/location.svg';
 import LocationIcon from '../../../../assets/icons/location.svg';
 import CloseSvg from '../../../../assets/icons/close.svg';
 import CloseSvg from '../../../../assets/icons/close.svg';
 import FilterIcon from 'assets/icons/filter.svg';
 import FilterIcon from 'assets/icons/filter.svg';
+import ProfileIcon from 'assets/icons/bottom-navigation/profile.svg';
 
 
 import regions from '../../../../assets/geojson/nm2022.json';
 import regions from '../../../../assets/geojson/nm2022.json';
 import jsonData, { fetchJsonData } from '../../../database/geojsonService';
 import jsonData, { fetchJsonData } from '../../../database/geojsonService';
@@ -30,7 +31,7 @@ import {
   getSecondDatabase,
   getSecondDatabase,
   refreshDatabases
   refreshDatabases
 } from '../../../db';
 } from '../../../db';
-import { LocationPopup, WarningModal, EditNmModal } from '../../../components';
+import { LocationPopup, WarningModal, EditNmModal, AvatarWithInitials } from '../../../components';
 
 
 import { styles } from './style';
 import { styles } from './style';
 import {
 import {
@@ -74,7 +75,7 @@ const localDareDir = `${FileSystem.cacheDirectory}tiles/regions_mqp`;
 
 
 const AnimatedMarker = Animation.createAnimatedComponent(Marker);
 const AnimatedMarker = Animation.createAnimatedComponent(Marker);
 
 
-const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
+const MapScreen: React.FC<MapScreenProps> = ({ navigation, route }) => {
   const [dareData, setDareData] = useState(jsonData);
   const [dareData, setDareData] = useState(jsonData);
   const tilesBaseURL = `${FASTEST_MAP_HOST}/tiles_osm`;
   const tilesBaseURL = `${FASTEST_MAP_HOST}/tiles_osm`;
   const gridUrl = `${FASTEST_MAP_HOST}/tiles_nm/grid`;
   const gridUrl = `${FASTEST_MAP_HOST}/tiles_nm/grid`;
@@ -136,6 +137,8 @@ const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
   });
   });
 
 
   const { handleUpdateNM, handleUpdateDare, handleUpdateSlow, userData, setUserData } = useRegion();
   const { handleUpdateNM, handleUpdateDare, handleUpdateSlow, userData, setUserData } = useRegion();
+  const userInfo = storage.get('currentUserData', StoreType.STRING) as string;
+  const [userInfoData, setUserInfoData] = useState<any>(null);
 
 
   useFocusEffect(
   useFocusEffect(
     useCallback(() => {
     useCallback(() => {
@@ -160,6 +163,18 @@ const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
     }, [userData])
     }, [userData])
   );
   );
 
 
+  useEffect(() => {
+    if (route.params?.id && route.params?.type && dareData) {
+      handleFindRegion(route.params?.id, route.params?.type);
+    }
+  }, [route, dareData]);
+
+  useEffect(() => {
+    if (userInfo) {
+      setUserInfoData(JSON.parse(userInfo));
+    }
+  }, [userInfo]);
+
   useEffect(() => {
   useEffect(() => {
     if (!dareData) {
     if (!dareData) {
       const fetchData = async () => {
       const fetchData = async () => {
@@ -232,31 +247,9 @@ const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
     ).start();
     ).start();
   }, [strokeWidthAnim]);
   }, [strokeWidthAnim]);
 
 
-  useEffect(() => {
-    navigation.addListener('state', (state) => {
-      navigation
-        .getParent()
-        ?.getParent()
-        ?.setOptions({
-          tabBarStyle: {
-            display:
-              (state.data.state.history[1] as { status?: string })?.status === 'open' ||
-              regionPopupVisible
-                ? 'none'
-                : 'flex',
-            position: 'absolute',
-            ...Platform.select({
-              android: {
-                height: 58
-              }
-            })
-          }
-        });
-    });
-    navigation
-      .getParent()
-      ?.getParent()
-      ?.setOptions({
+  useFocusEffect(
+    useCallback(() => {
+      navigation.getParent()?.setOptions({
         tabBarStyle: {
         tabBarStyle: {
           display: regionPopupVisible ? 'none' : 'flex',
           display: regionPopupVisible ? 'none' : 'flex',
           position: 'absolute',
           position: 'absolute',
@@ -267,7 +260,8 @@ const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
           })
           })
         }
         }
       });
       });
-  }, [regionPopupVisible, navigation]);
+    }, [regionPopupVisible, navigation])
+  );
 
 
   useEffect(() => {
   useEffect(() => {
     (async () => {
     (async () => {
@@ -843,19 +837,28 @@ const MapScreen: React.FC<MapScreenProps> = ({ navigation }) => {
           {!isExpanded ? (
           {!isExpanded ? (
             <TouchableOpacity
             <TouchableOpacity
               style={[styles.cornerButton, styles.topRightButton]}
               style={[styles.cornerButton, styles.topRightButton]}
-              onPress={() => (navigation as any)?.openDrawer()}
+              onPress={() => navigation.navigate(NAVIGATION_PAGES.PROFILE_TAB)}
             >
             >
-              <MenuIcon />
+              {token ? (
+                userInfoData?.avatar ? (
+                  <Image
+                    style={styles.avatar}
+                    source={{ uri: API_HOST + '/img/avatars/' + userInfoData?.avatar }}
+                  />
+                ) : (
+                  <AvatarWithInitials
+                    text={`${userInfoData?.first_name[0] ?? ''}${userInfoData?.last_name[0] ?? ''}`}
+                    flag={API_HOST + '/img/flags_new/' + userInfoData?.homebase_flag}
+                    size={48}
+                    borderColor={Colors.WHITE}
+                  />
+                )
+              ) : (
+                <ProfileIcon fill={Colors.DARK_BLUE} />
+              )}
             </TouchableOpacity>
             </TouchableOpacity>
           ) : null}
           ) : null}
 
 
-          <TouchableOpacity
-            style={[styles.cornerButton, { top: 115, right: 16 }]}
-            onPress={() => navigation.navigate(NAVIGATION_PAGES.INFO)}
-          >
-            <InfoIcon />
-          </TouchableOpacity>
-
           <Animated.View
           <Animated.View
             style={[
             style={[
               styles.searchContainer,
               styles.searchContainer,

+ 7 - 0
src/screens/InAppScreens/MapScreen/style.tsx

@@ -93,4 +93,11 @@ export const styles = StyleSheet.create({
     color: Colors.DARK_BLUE,
     color: Colors.DARK_BLUE,
     fontWeight: '600'
     fontWeight: '600'
   },
   },
+  avatar: {
+    borderRadius: 48 / 2,
+    width: 48,
+    height: 48,
+    borderWidth: 2,
+    borderColor: Colors.WHITE
+  },
 });
 });

+ 1 - 0
src/screens/InAppScreens/ProfileScreen/Profile/edit-personal-info.tsx

@@ -104,6 +104,7 @@ export const EditPersonalInfo = () => {
   const handleLogout = () => {
   const handleLogout = () => {
     storage.remove('token');
     storage.remove('token');
     storage.remove('uid');
     storage.remove('uid');
+    storage.remove('currentUserData');
     updateNotificationStatus();
     updateNotificationStatus();
     navigation.dispatch(
     navigation.dispatch(
       CommonActions.reset({
       CommonActions.reset({

+ 233 - 36
src/screens/InAppScreens/ProfileScreen/UsersMap/index.tsx

@@ -1,16 +1,41 @@
-import { Platform, TouchableOpacity, View, Image, Text } from 'react-native';
+import {
+  Platform,
+  TouchableOpacity,
+  View,
+  Image,
+  Animated as Animation,
+  Linking,
+  TextInput,
+  Dimensions
+} from 'react-native';
 import React, { FC, useEffect, useRef, useState } from 'react';
 import React, { FC, useEffect, useRef, useState } from 'react';
-import MapView, { UrlTile } from 'react-native-maps';
+import MapView, { UrlTile, Marker } from 'react-native-maps';
+import * as Location from 'expo-location';
+import Animated, {
+  Easing,
+  useSharedValue,
+  useAnimatedStyle,
+  withTiming
+} from 'react-native-reanimated';
 
 
 import { styles } from './styles';
 import { styles } from './styles';
 import { API_HOST, FASTEST_MAP_HOST } from 'src/constants';
 import { API_HOST, FASTEST_MAP_HOST } from 'src/constants';
-import { NavigationProp } from '@react-navigation/native';
-import { AvatarWithInitials } from 'src/components';
+import { CommonActions, NavigationProp } from '@react-navigation/native';
+import { AvatarWithInitials, LocationPopup } from 'src/components';
 import { Colors } from 'src/theme';
 import { Colors } from 'src/theme';
 
 
 import CloseSvg from 'assets/icons/close.svg';
 import CloseSvg from 'assets/icons/close.svg';
 import FilterIcon from 'assets/icons/filter.svg';
 import FilterIcon from 'assets/icons/filter.svg';
+import LocationIcon from 'assets/icons/location.svg';
+import SearchIcon from 'assets/icons/search.svg';
+
 import FilterModal from '../../MapScreen/FilterModal';
 import FilterModal from '../../MapScreen/FilterModal';
+import SearchModal from '../../MapScreen/UniversalSearch';
+import { useGetUniversalSearch } from '@api/search';
+import { storage, StoreType } from 'src/storage';
+import { NAVIGATION_PAGES } from 'src/types';
+
+const AnimatedMarker = Animation.createAnimatedComponent(Marker);
 
 
 type Props = {
 type Props = {
   navigation: NavigationProp<any>;
   navigation: NavigationProp<any>;
@@ -18,6 +43,7 @@ type Props = {
 };
 };
 
 
 const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
 const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
+  const token = storage.get('token', StoreType.STRING) as string;
   const userId = route.params?.userId;
   const userId = route.params?.userId;
   const data = route.params?.data;
   const data = route.params?.data;
 
 
@@ -26,6 +52,7 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
   const visitedDefaultTiles = `${FASTEST_MAP_HOST}/tiles_nm/user_visited/${userId}`;
   const visitedDefaultTiles = `${FASTEST_MAP_HOST}/tiles_nm/user_visited/${userId}`;
 
 
   const mapRef = useRef<MapView>(null);
   const mapRef = useRef<MapView>(null);
+  const strokeWidthAnim = useRef(new Animation.Value(2)).current;
   const [isFilterVisible, setIsFilterVisible] = useState(false);
   const [isFilterVisible, setIsFilterVisible] = useState(false);
   const [tilesType, setTilesType] = useState({ label: 'NM regions', value: 0 });
   const [tilesType, setTilesType] = useState({ label: 'NM regions', value: 0 });
   const tilesTypes = [
   const tilesTypes = [
@@ -35,20 +62,97 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
   ];
   ];
   const [type, setType] = useState(0);
   const [type, setType] = useState(0);
   const [visitedTiles, setVisitedTiles] = useState(visitedDefaultTiles);
   const [visitedTiles, setVisitedTiles] = useState(visitedDefaultTiles);
+  const [location, setLocation] = useState<Location.LocationObjectCoords | null>(null);
+  const [askLocationVisible, setAskLocationVisible] = useState<boolean>(false);
+  const [openSettingsVisible, setOpenSettingsVisible] = useState<boolean>(false);
+  const [isExpanded, setIsExpanded] = useState(false);
+  const [searchVisible, setSearchVisible] = useState(false);
+  const [index, setIndex] = useState<number>(0);
+  const width = useSharedValue(48);
+  const usableWidth = Dimensions.get('window').width - 32;
+  const [search, setSearch] = useState('');
+  const [searchInput, setSearchInput] = useState('');
+  const { data: searchData } = useGetUniversalSearch(search, search.length > 0);
 
 
   useEffect(() => {
   useEffect(() => {
-    navigation.getParent()?.setOptions({
-      tabBarStyle: {
-        display: 'none',
-        position: 'absolute',
-        ...Platform.select({
-          android: {
-            height: 58
-          }
+    Animation.loop(
+      Animation.sequence([
+        Animation.timing(strokeWidthAnim, {
+          toValue: 3,
+          duration: 700,
+          useNativeDriver: false
+        }),
+        Animation.timing(strokeWidthAnim, {
+          toValue: 2,
+          duration: 700,
+          useNativeDriver: false
         })
         })
-      }
+      ])
+    ).start();
+  }, [strokeWidthAnim]);
+
+  const handleGetLocation = async () => {
+    let { status, canAskAgain } = await Location.getForegroundPermissionsAsync();
+
+    if (status === 'granted') {
+      getLocation();
+    } else if (!canAskAgain) {
+      setOpenSettingsVisible(true);
+    } else {
+      setAskLocationVisible(true);
+    }
+  };
+
+  const getLocation = async () => {
+    let currentLocation = await Location.getCurrentPositionAsync({
+      accuracy: Location.Accuracy.Balanced
+    });
+    setLocation(currentLocation.coords);
+
+    mapRef.current?.animateToRegion(
+      {
+        latitude: currentLocation.coords.latitude,
+        longitude: currentLocation.coords.longitude,
+        latitudeDelta: 5,
+        longitudeDelta: 5
+      },
+      800
+    );
+  };
+
+  const handleAcceptPermission = async () => {
+    setAskLocationVisible(false);
+    let { status, canAskAgain } = await Location.requestForegroundPermissionsAsync();
+
+    if (status === 'granted') {
+      getLocation();
+    } else if (!canAskAgain) {
+      setOpenSettingsVisible(true);
+    }
+  };
+
+  const handlePress = () => {
+    if (isExpanded) {
+      setIndex(0);
+      setSearchInput('');
+    }
+    setIsExpanded((prev) => !prev);
+    width.value = withTiming(isExpanded ? 48 : usableWidth, {
+      duration: 300,
+      easing: Easing.inOut(Easing.ease)
     });
     });
-  }, [navigation]);
+  };
+
+  const animatedStyle = useAnimatedStyle(() => {
+    return {
+      width: width.value
+    };
+  });
+
+  const handleSearch = async () => {
+    setSearch(searchInput);
+    setSearchVisible(true);
+  };
 
 
   const renderMapTiles = (url: string, zIndex: number, opacity = 1) => (
   const renderMapTiles = (url: string, zIndex: number, opacity = 1) => (
     <UrlTile
     <UrlTile
@@ -67,6 +171,33 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
     navigation.goBack();
     navigation.goBack();
   };
   };
 
 
+  const handleCloseModal = () => {
+    setSearchInput('');
+    setSearchVisible(false);
+    handlePress();
+  };
+
+  const handleFindRegion = (id: number, type: string) => {
+    navigation.dispatch(
+      CommonActions.reset({
+        index: 1,
+        routes: [
+          {
+            name: NAVIGATION_PAGES.IN_APP_MAP_TAB,
+            state: {
+              routes: [
+                {
+                  name: NAVIGATION_PAGES.MAP_TAB,
+                  params: { id, type }
+                }
+              ]
+            }
+          }
+        ]
+      })
+    );
+  };
+
   return (
   return (
     <View style={styles.container}>
     <View style={styles.container}>
       <MapView
       <MapView
@@ -88,36 +219,79 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
         {renderMapTiles(tilesBaseURL, 1)}
         {renderMapTiles(tilesBaseURL, 1)}
         {type !== 1 && renderMapTiles(gridUrl, 2)}
         {type !== 1 && renderMapTiles(gridUrl, 2)}
         {userId && renderMapTiles(visitedTiles, 2, 0.5)}
         {userId && renderMapTiles(visitedTiles, 2, 0.5)}
+        {location && (
+          <AnimatedMarker coordinate={location} anchor={{ x: 0.5, y: 0.5 }}>
+            <Animation.View style={[styles.location, { borderWidth: strokeWidthAnim }]} />
+          </AnimatedMarker>
+        )}
       </MapView>
       </MapView>
 
 
-      <TouchableOpacity
-        style={[styles.cornerButton, styles.topLeftButton, styles.closeLeftButton]}
-        onPress={handleGoBack}
-      >
-        <CloseSvg fill="white" width={13} height={13} />
-        <Text style={styles.textClose}>Close</Text>
-      </TouchableOpacity>
-      <View style={[styles.cornerButton, styles.topRightButton]}>
-        {data.user_data.avatar ? (
-          <Image
-            style={styles.avatar}
-            source={{ uri: API_HOST + '/img/avatars/' + data.user_data.avatar }}
-          />
-        ) : (
-          <AvatarWithInitials
-            text={`${data.user_data.first_name[0] ?? ''}${data.user_data.last_name[0] ?? ''}`}
-            flag={API_HOST + '/img/flags_new/' + data.user_data.flag1}
-            size={48}
-            borderColor={Colors.WHITE}
-          />
-        )}
-      </View>
+      {!isExpanded ? (
+        <TouchableOpacity
+          style={[styles.cornerButton, styles.topRightButton]}
+          onPress={handleGoBack}
+        >
+          {data.user_data.avatar ? (
+            <Image
+              style={styles.avatar}
+              source={{ uri: API_HOST + '/img/avatars/' + data.user_data.avatar }}
+            />
+          ) : (
+            <AvatarWithInitials
+              text={`${data.user_data.first_name[0] ?? ''}${data.user_data.last_name[0] ?? ''}`}
+              flag={API_HOST + '/img/flags_new/' + data.user_data.flag1}
+              size={48}
+              borderColor={Colors.WHITE}
+            />
+          )}
+        </TouchableOpacity>
+      ) : null}
+
       <TouchableOpacity
       <TouchableOpacity
         style={[styles.cornerButton, styles.bottomButton, styles.bottomLeftButton]}
         style={[styles.cornerButton, styles.bottomButton, styles.bottomLeftButton]}
         onPress={() => setIsFilterVisible(true)}
         onPress={() => setIsFilterVisible(true)}
       >
       >
         <FilterIcon />
         <FilterIcon />
       </TouchableOpacity>
       </TouchableOpacity>
+
+      <TouchableOpacity
+        onPress={handleGetLocation}
+        style={[styles.cornerButton, styles.bottomButton, styles.bottomRightButton]}
+      >
+        <LocationIcon />
+      </TouchableOpacity>
+      <Animated.View
+        style={[
+          styles.searchContainer,
+          styles.cornerButton,
+          styles.topLeftButton,
+          animatedStyle,
+          { padding: 5 }
+        ]}
+      >
+        {isExpanded ? (
+          <>
+            <TouchableOpacity onPress={handlePress} style={styles.iconButton}>
+              <CloseSvg fill={'#0F3F4F'} />
+            </TouchableOpacity>
+            <TextInput
+              style={styles.input}
+              placeholder="Search regions, places, nomads"
+              placeholderTextColor={Colors.LIGHT_GRAY}
+              value={searchInput}
+              onChangeText={(text) => setSearchInput(text)}
+              onSubmitEditing={handleSearch}
+            />
+            <TouchableOpacity onPress={handleSearch} style={styles.iconButton}>
+              <SearchIcon fill={'#0F3F4F'} />
+            </TouchableOpacity>
+          </>
+        ) : (
+          <TouchableOpacity onPress={handlePress} style={[styles.iconButton]}>
+            <SearchIcon fill={'#0F3F4F'} />
+          </TouchableOpacity>
+        )}
+      </Animated.View>
       <FilterModal
       <FilterModal
         isFilterVisible={isFilterVisible}
         isFilterVisible={isFilterVisible}
         setIsFilterVisible={setIsFilterVisible}
         setIsFilterVisible={setIsFilterVisible}
@@ -130,6 +304,29 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
         setVisitedTiles={setVisitedTiles}
         setVisitedTiles={setVisitedTiles}
         isPublicView={true}
         isPublicView={true}
       />
       />
+      <LocationPopup
+        visible={askLocationVisible}
+        onClose={() => setAskLocationVisible(false)}
+        onAccept={handleAcceptPermission}
+        modalText="To use this feature we need your permission to access your location. If you press OK your system will ask you to approve location sharing with NomadMania app."
+      />
+      <LocationPopup
+        visible={openSettingsVisible}
+        onClose={() => setOpenSettingsVisible(false)}
+        onAccept={() =>
+          Platform.OS === 'ios' ? Linking.openURL('app-settings:') : Linking.openSettings()
+        }
+        modalText="NomadMania app needs location permissions to function properly. Open settings?"
+      />
+      <SearchModal
+        searchVisible={searchVisible}
+        handleCloseModal={handleCloseModal}
+        handleFindRegion={handleFindRegion}
+        index={index}
+        searchData={searchData}
+        setIndex={setIndex}
+        token={token}
+      />
     </View>
     </View>
   );
   );
 };
 };

+ 39 - 4
src/screens/InAppScreens/ProfileScreen/UsersMap/styles.tsx

@@ -25,7 +25,7 @@ export const styles = StyleSheet.create({
     elevation: 5
     elevation: 5
   },
   },
   topLeftButton: {
   topLeftButton: {
-    top: 58,
+    top: 52,
     left: 16
     left: 16
   },
   },
   closeLeftButton: {
   closeLeftButton: {
@@ -49,13 +49,16 @@ export const styles = StyleSheet.create({
     right: 16
     right: 16
   },
   },
   bottomButton: {
   bottomButton: {
-    bottom: 58,
+    bottom: 22,
     width: 42,
     width: 42,
     height: 42,
     height: 42,
-    borderRadius: 21,
+    borderRadius: 21
+  },
+  bottomRightButton: {
+    right: 16
   },
   },
   bottomLeftButton: {
   bottomLeftButton: {
-    left: 16,
+    left: 16
   },
   },
   avatar: {
   avatar: {
     borderRadius: 48 / 2,
     borderRadius: 48 / 2,
@@ -63,5 +66,37 @@ export const styles = StyleSheet.create({
     height: 48,
     height: 48,
     borderWidth: 2,
     borderWidth: 2,
     borderColor: Colors.WHITE
     borderColor: Colors.WHITE
+  },
+  location: {
+    width: 18,
+    height: 18,
+    borderRadius: 9,
+    borderColor: 'white',
+    backgroundColor: '#ED9334',
+    scale: 1,
+    shadow: {
+      shadowColor: '#212529',
+      shadowOffset: {
+        width: 0,
+        height: 4
+      },
+      shadowOpacity: 0.12,
+      shadowRadius: 8,
+      elevation: 5
+    }
+  },
+  searchContainer: {
+    flexDirection: 'row',
+    alignItems: 'center',
+    overflow: 'hidden'
+  },
+  iconButton: {
+    padding: 10
+  },
+  input: {
+    flex: 1,
+    height: 40,
+    color: Colors.DARK_BLUE,
+    fontWeight: '600'
   }
   }
 });
 });

+ 13 - 3
src/screens/InAppScreens/ProfileScreen/index.tsx

@@ -88,6 +88,16 @@ const ProfileScreen: FC<Props> = ({ navigation, route }) => {
 
 
   useEffect(() => {
   useEffect(() => {
     setIsFriend(userData?.data?.is_friend ?? 0);
     setIsFriend(userData?.data?.is_friend ?? 0);
+
+    if (userData && userData?.data?.own_profile === 1) {
+      const userInfo = {
+        avatar: userData?.data?.user_data.avatar ?? '',
+        first_name: userData?.data?.user_data.first_name,
+        last_name: userData?.data?.user_data.last_name,
+        homebase_flag: userData?.data?.user_data.flag1
+      };
+      storage.set('currentUserData', JSON.stringify(userInfo));
+    }
   }, [userData]);
   }, [userData]);
 
 
   if (!userData?.data || !lastUpdates?.data || isFetching) return <Loading />;
   if (!userData?.data || !lastUpdates?.data || isFetching) return <Loading />;
@@ -96,7 +106,7 @@ const ProfileScreen: FC<Props> = ({ navigation, route }) => {
   const links = JSON.parse(data.user_data.links_json);
   const links = JSON.parse(data.user_data.links_json);
 
 
   const handleGoToMap = () => {
   const handleGoToMap = () => {
-    isPublicView
+    data.own_profile === 0
       ? navigation.navigate(NAVIGATION_PAGES.USERS_MAP, { userId: route.params?.userId, data })
       ? navigation.navigate(NAVIGATION_PAGES.USERS_MAP, { userId: route.params?.userId, data })
       : navigation.dispatch(
       : navigation.dispatch(
           CommonActions.reset({
           CommonActions.reset({
@@ -178,7 +188,7 @@ const ProfileScreen: FC<Props> = ({ navigation, route }) => {
 
 
   return (
   return (
     <PageWrapper>
     <PageWrapper>
-      {isPublicView && <Header label="Profile" />}
+      <Header label="Profile" />
       <ScrollView
       <ScrollView
         showsVerticalScrollIndicator={false}
         showsVerticalScrollIndicator={false}
         contentContainerStyle={{ paddingBottom: 58 }}
         contentContainerStyle={{ paddingBottom: 58 }}
@@ -248,7 +258,7 @@ const ProfileScreen: FC<Props> = ({ navigation, route }) => {
                 </View>
                 </View>
               </View>
               </View>
 
 
-              {!isPublicView ? (
+              {data.own_profile === 1 ? (
                 <TouchableOpacity
                 <TouchableOpacity
                   style={styles.settings}
                   style={styles.settings}
                   onPress={() => navigation.navigate(NAVIGATION_PAGES.EDIT_PERSONAL_INFO)}
                   onPress={() => navigation.navigate(NAVIGATION_PAGES.EDIT_PERSONAL_INFO)}

+ 0 - 15
src/screens/InAppScreens/TravelsScreen/CountriesScreen/index.tsx

@@ -43,21 +43,6 @@ const CountriesScreen = () => {
     setIsEditModalVisible(true);
     setIsEditModalVisible(true);
   };
   };
 
 
-  useFocusEffect(
-    useCallback(() => {
-      navigation.getParent()?.setOptions({
-        tabBarStyle: {
-          display: 'flex',
-          ...Platform.select({
-            android: {
-              height: 58
-            }
-          })
-        }
-      });
-    }, [navigation])
-  );
-
   useEffect(() => {
   useEffect(() => {
     if (slow && slow.length) {
     if (slow && slow.length) {
       token && calcTotalScore();
       token && calcTotalScore();

+ 0 - 15
src/screens/InAppScreens/TravelsScreen/DareScreen/index.tsx

@@ -48,21 +48,6 @@ const DareScreen = () => {
     }
     }
   }, [megaregions])
   }, [megaregions])
 
 
-  useFocusEffect(
-    useCallback(() => {
-      navigation.getParent()?.setOptions({
-        tabBarStyle: {
-          display: 'flex',
-          ...Platform.select({
-            android: {
-              height: 58
-            }
-          })
-        }
-      });
-    }, [navigation])
-  );
-
   useEffect(() => {
   useEffect(() => {
     if (dareRegions && dareRegions.length) {
     if (dareRegions && dareRegions.length) {
       token && calcTotalCountries();
       token && calcTotalCountries();

+ 0 - 15
src/screens/InAppScreens/TravelsScreen/RegionsScreen/index.tsx

@@ -52,21 +52,6 @@ const RegionsScreen = () => {
   const navigation = useNavigation();
   const navigation = useNavigation();
   const { handleUpdateNMList: handleUpdateNM, nmRegions, setNmRegions, setUserData } = useRegion();
   const { handleUpdateNMList: handleUpdateNM, nmRegions, setNmRegions, setUserData } = useRegion();
 
 
-  useFocusEffect(
-    useCallback(() => {
-      navigation.getParent()?.setOptions({
-        tabBarStyle: {
-          display: 'flex',
-          ...Platform.select({
-            android: {
-              height: 58
-            }
-          })
-        }
-      });
-    }, [navigation])
-  );
-
   useEffect(() => {
   useEffect(() => {
     const currentYear = moment().year();
     const currentYear = moment().year();
     let yearSelector: { label: string; value: number }[] = [{ label: 'visited', value: 1 }];
     let yearSelector: { label: string; value: number }[] = [{ label: 'visited', value: 1 }];

+ 19 - 1
src/screens/LoginScreen/index.tsx

@@ -14,6 +14,7 @@ import { useLoginMutation } from '@api/auth';
 import { fetchAndSaveStatistics } from 'src/database/statisticsService';
 import { fetchAndSaveStatistics } from 'src/database/statisticsService';
 import { useNetInfo } from '@react-native-community/netinfo';
 import { useNetInfo } from '@react-native-community/netinfo';
 import { useNotification } from 'src/contexts/NotificationContext';
 import { useNotification } from 'src/contexts/NotificationContext';
+import { usePostGetProfileInfoDataQuery } from '@api/user';
 
 
 type Props = {
 type Props = {
   navigation: NavigationProp<any>;
   navigation: NavigationProp<any>;
@@ -30,6 +31,11 @@ const LoginScreen: FC<Props> = ({ navigation }) => {
 
 
   const { data, mutate: userLogin } = useLoginMutation();
   const { data, mutate: userLogin } = useLoginMutation();
   const { updateNotificationStatus } = useNotification();
   const { updateNotificationStatus } = useNotification();
+  const { data: profileData } = usePostGetProfileInfoDataQuery(
+    data?.token || '',
+    data?.uid ? +data.uid : 0,
+    data?.token ? true : false
+  );
 
 
   const updateLocalData = async (token: string) => {
   const updateLocalData = async (token: string) => {
     await fetchAndSaveStatistics(token);
     await fetchAndSaveStatistics(token);
@@ -45,6 +51,18 @@ const LoginScreen: FC<Props> = ({ navigation }) => {
       storage.set('isFirstLaunch', false);
       storage.set('isFirstLaunch', false);
       updateNotificationStatus();
       updateNotificationStatus();
       updateLocalData(data.token);
       updateLocalData(data.token);
+    }
+  }, [data]);
+
+  useEffect(() => {
+    if (profileData) {
+      const userInfo = {
+        avatar: profileData?.data?.user_data.avatar ?? '',
+        first_name: profileData?.data?.user_data.first_name,
+        last_name: profileData?.data?.user_data.last_name,
+        homebase_flag: profileData?.data?.user_data.flag1
+      };
+      storage.set('currentUserData', JSON.stringify(userInfo));
 
 
       isFirstLaunch
       isFirstLaunch
         ? dispatch(
         ? dispatch(
@@ -60,7 +78,7 @@ const LoginScreen: FC<Props> = ({ navigation }) => {
             })
             })
           );
           );
     }
     }
-  }, [data]);
+  }, [profileData]);
 
 
   return (
   return (
     <PageWrapper>
     <PageWrapper>

+ 36 - 16
src/screens/RegisterScreen/EditAccount/index.tsx

@@ -14,6 +14,7 @@ import { storage } from '../../../storage';
 import store from '../../../storage/zustand';
 import store from '../../../storage/zustand';
 import { NAVIGATION_PAGES } from '../../../types';
 import { NAVIGATION_PAGES } from '../../../types';
 import { fetchAndSaveStatistics } from 'src/database/statisticsService';
 import { fetchAndSaveStatistics } from 'src/database/statisticsService';
+import { usePostGetProfileInfoDataQuery } from '@api/user';
 
 
 const SignUpSchema = yup.object({
 const SignUpSchema = yup.object({
   first_name: yup.string().required(),
   first_name: yup.string().required(),
@@ -31,6 +32,11 @@ const EditAccount = () => {
   const [user] = store((state) => [state.registration.user]);
   const [user] = store((state) => [state.registration.user]);
 
 
   const { data, error, mutate: userRegister } = useRegisterMutation();
   const { data, error, mutate: userRegister } = useRegisterMutation();
+  const { data: profileData } = usePostGetProfileInfoDataQuery(
+    data?.token || '',
+    data?.uid ? +data.uid : 0,
+    data?.token ? true : false
+  );
   const [isLoading, setIsLoading] = useState(true);
   const [isLoading, setIsLoading] = useState(true);
 
 
   useFocusEffect(
   useFocusEffect(
@@ -43,6 +49,25 @@ const EditAccount = () => {
     }, [])
     }, [])
   );
   );
 
 
+  useEffect(() => {
+    if (profileData) {
+      const userInfo = {
+        avatar: profileData?.data?.user_data.avatar ?? '',
+        first_name: profileData?.data?.user_data.first_name,
+        last_name: profileData?.data?.user_data.last_name,
+        homebase_flag: profileData?.data?.user_data.flag1
+      };
+      storage.set('currentUserData', JSON.stringify(userInfo));
+
+      dispatch(
+        CommonActions.reset({
+          index: 1,
+          routes: [{ name: NAVIGATION_PAGES.INFO }]
+        })
+      );
+    }
+  }, [profileData]);
+
   const updateLocalData = async (token: string) => {
   const updateLocalData = async (token: string) => {
     await fetchAndSaveStatistics(token);
     await fetchAndSaveStatistics(token);
   };
   };
@@ -82,15 +107,17 @@ const EditAccount = () => {
                     homebase: values.homebase,
                     homebase: values.homebase,
                     homebase2: values.homebase2
                     homebase2: values.homebase2
                   },
                   },
-                  photo: values.photo.uri ? {
-                    type: values.photo.type,
-                    uri: values.photo.uri,
-                    name: values.photo.uri.split('/').pop()!
-                  } : {
-                    type: undefined,
-                    uri: undefined,
-                    name: undefined
-                  }
+                  photo: values.photo.uri
+                    ? {
+                        type: values.photo.type,
+                        uri: values.photo.uri,
+                        name: values.photo.uri.split('/').pop()!
+                      }
+                    : {
+                        type: undefined,
+                        uri: undefined,
+                        name: undefined
+                      }
                 };
                 };
 
 
                 userRegister(data, {
                 userRegister(data, {
@@ -99,13 +126,6 @@ const EditAccount = () => {
                       storage.set('token', data.token);
                       storage.set('token', data.token);
                       storage.set('uid', data.uid.toString());
                       storage.set('uid', data.uid.toString());
                       updateLocalData(data.token);
                       updateLocalData(data.token);
-                
-                      dispatch(
-                        CommonActions.reset({
-                          index: 1,
-                          routes: [{ name: NAVIGATION_PAGES.INFO }]
-                        })
-                      );
                     }
                     }
                   }
                   }
                 });
                 });

+ 1 - 0
src/types/map/index.ts

@@ -10,6 +10,7 @@ export interface Region {
 
 
 export interface MapScreenProps {
 export interface MapScreenProps {
   navigation: BottomTabNavigationProp<any>;
   navigation: BottomTabNavigationProp<any>;
+  route: any;
 }
 }
 
 
 export interface Series {
 export interface Series {

+ 1 - 0
src/types/navigation.ts

@@ -56,4 +56,5 @@ export enum NAVIGATION_PAGES {
   FRIENDS_LIST = 'inAppFriendsList',
   FRIENDS_LIST = 'inAppFriendsList',
   MY_FRIENDS = 'inAppMyFriends',
   MY_FRIENDS = 'inAppMyFriends',
   COUNTRY_PREVIEW = 'inAppCountryPreview',
   COUNTRY_PREVIEW = 'inAppCountryPreview',
+  MENU_DRAWER = 'Menu',
 }
 }