Viktoriia 10 місяців тому
батько
коміт
c4c91565dc

+ 17 - 17
src/screens/InAppScreens/ProfileScreen/Components/PersonalInfo.tsx

@@ -90,7 +90,7 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
     title: ''
   });
   const [isUpdatesModalVisible, setIsUpdatesModalVisible] = useState(false);
-  const [updateType, setUpdateType] = useState<string>('un');
+  const [updateType, setUpdateType] = useState<string>('nm');
 
   const { data: regions } = usePostGetProfileRegions(token as string, userId, type);
   const { data: update } = usePostGetUpdateQuery(token as string, userId, updateType, true);
@@ -329,6 +329,22 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
         {updates && hasUpdates() ? (
           <InfoItem title={'VISITED IN THE LAST 90 DAYS'}>
             <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
+              {updates.nm_visited && updates.nm_visited > 0 ? (
+                <TouchableOpacity style={styles.updates} onPress={() => handleOpenUpdates('nm')}>
+                  <RegionsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
+                  {updates.nm_new && updates.nm_new > 0 ? (
+                    <View>
+                      <Text style={styles.updatesText}>
+                        {updates.nm_visited} (+{updates.nm_new} new)
+                      </Text>
+                      <Text style={styles.updatesText}>NM regions</Text>
+                    </View>
+                  ) : (
+                    <Text style={styles.updatesText}>{updates.nm_visited} NM regions</Text>
+                  )}
+                </TouchableOpacity>
+              ) : null}
+
               {updates.un_visited && updates.un_visited > 0 ? (
                 <TouchableOpacity style={styles.updates} onPress={() => handleOpenUpdates('un')}>
                   <FlagsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
@@ -361,22 +377,6 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
                 </TouchableOpacity>
               ) : null}
 
-              {updates.nm_visited && updates.nm_visited > 0 ? (
-                <TouchableOpacity style={styles.updates} onPress={() => handleOpenUpdates('nm')}>
-                  <RegionsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
-                  {updates.nm_new && updates.nm_new > 0 ? (
-                    <View>
-                      <Text style={styles.updatesText}>
-                        {updates.nm_visited} (+{updates.nm_new} new)
-                      </Text>
-                      <Text style={styles.updatesText}>NM regions</Text>
-                    </View>
-                  ) : (
-                    <Text style={styles.updatesText}>{updates.nm_visited} NM regions</Text>
-                  )}
-                </TouchableOpacity>
-              ) : null}
-
               {updates.new_dare && updates.new_dare > 0 ? (
                 <TouchableOpacity style={styles.updates} onPress={() => handleOpenUpdates('dare')}>
                   <CompassIcon fill={Colors.DARK_BLUE} height={20} width={20} />