Przeglądaj źródła

feat: some changes

Oleksandr Honcharov 1 rok temu
rodzic
commit
8b4bccea15

+ 38 - 2
src/screens/InAppScreens/TravellersScreen/StatisticsListScreen/index.tsx

@@ -86,7 +86,7 @@ const StatisticsListScreen = ({ route }) => {
           </Text>
           <Image
             style={{ width: 36, height: 36, borderRadius: 18 }}
-            source={{ uri: API_HOST + '/img/flags_new/' + item.dare_flag }}
+            source={{ uri: API_HOST + '/img/flags_new/' + (item.dare_flag ?? item.flag) }}
           />
           <View
             style={{
@@ -98,7 +98,7 @@ const StatisticsListScreen = ({ route }) => {
             }}
           >
             <Text style={{ width: '75%', color: Colors.DARK_BLUE, fontWeight: '700' }}>
-              {item.dare_name}
+              {item.dare_name ?? item.country}
             </Text>
             <Text style={{ color: Colors.DARK_BLUE, fontWeight: '700' }}>{item.cnt}</Text>
           </View>
@@ -112,6 +112,42 @@ const StatisticsListScreen = ({ route }) => {
           </Text>
         </View>
       );
+    } else {
+      return (
+        <View
+          style={{
+            display: 'flex',
+            alignItems: 'center',
+            flexDirection: 'row',
+            flex: 1,
+            gap: 8
+          }}
+        >
+          <Text style={{ color: Colors.DARK_BLUE, fontSize: getFontSize(18), fontWeight: '700' }}>
+            {index + 1}
+          </Text>
+          <Image
+            style={{ width: 36, height: 36, borderRadius: 18 }}
+            source={{ uri: API_HOST + '/img/flags_new/' + item.flag }}
+          />
+          <View
+            style={{
+              flex: 1,
+              display: 'flex',
+              flexDirection: 'row',
+              justifyContent: 'space-between',
+              alignItems: 'center'
+            }}
+          >
+            <Text style={{ width: '75%', color: Colors.DARK_BLUE, fontWeight: '700' }}>
+              {item.country_name ?? item.nation ?? item.item_name}
+            </Text>
+            <Text style={{ color: Colors.DARK_BLUE, fontWeight: '700' }}>
+              {item.cnt ?? item.score}
+            </Text>
+          </View>
+        </View>
+      );
     }
   };