Browse Source

fix: some changes

Oleksandr Honcharov 1 year ago
parent
commit
197d994271

+ 4 - 19
src/screens/InAppScreens/TravellersScreen/Components/Profile.tsx

@@ -62,9 +62,11 @@ export const Profile: FC<Props> = ({
 
   const scoreNames = ['NM', 'DARE', 'UN', 'UN+', 'TCC', 'DEEP', 'YES', 'SLOW', 'WHS', 'KYE', 'TBT'];
   const isOnline = getOnlineStatus();
+
   const avatarBaseUri = isOnline
     ? `${API_HOST}/img/avatars/`
     : `${FileSystem.documentDirectory}avatars/`;
+
   const flagBaseUri = isOnline
     ? `${API_HOST}/img/flags_new/`
     : `${FileSystem.documentDirectory}flags/`;
@@ -101,15 +103,7 @@ export const Profile: FC<Props> = ({
 
   const EmptyScore: FC<{ scoreName: string }> = ({ scoreName }) => {
     return (
-      <View
-        style={{
-          display: 'flex',
-          alignItems: 'center',
-          justifyContent: 'center',
-          flexDirection: 'column',
-          marginBottom: 10
-        }}
-      >
+      <View style={styles.scoreWrapper}>
         <Text style={[styles.scoreHeaderText, { flex: 0 }]}>-</Text>
         <Text style={[styles.scoreNameText, { flex: 0 }]}>{scoreName}</Text>
       </View>
@@ -197,16 +191,7 @@ export const Profile: FC<Props> = ({
             if (!number) return <EmptyScore scoreName={scoreNames[index]} />;
             if (index === active_score) return;
             return (
-              <View
-                style={{
-                  display: 'flex',
-                  alignItems: 'center',
-                  justifyContent: 'center',
-                  flexDirection: 'column',
-                  marginBottom: 10,
-                  width: 40
-                }}
-              >
+              <View style={styles.scoreWrapper}>
                 <Text style={[styles.scoreHeaderText, { flex: 0 }]}>{number}</Text>
                 <Text style={[styles.scoreNameText, { flex: 0 }]}>{scoreNames[index]}</Text>
               </View>

+ 8 - 0
src/screens/InAppScreens/TravellersScreen/Components/styles.ts

@@ -30,6 +30,14 @@ export const styles = StyleSheet.create({
     fontWeight: '600',
     fontSize: getFontSize(11)
   },
+  scoreWrapper: {
+    display: 'flex',
+    alignItems: 'center',
+    justifyContent: 'center',
+    flexDirection: 'column',
+    marginBottom: 10,
+    width: 40
+  },
   scoreHeaderText: {
     flex: 1,
     fontFamily: 'redhat-700',

+ 3 - 1
src/screens/InAppScreens/TravellersScreen/MasterRankingScreen/index.tsx

@@ -87,6 +87,7 @@ const MasterRankingScreen = () => {
         setMasterRanking(masterRanking.sort((a: Ranking, b: Ranking) => b.score_tcc - a.score_tcc));
         break;
       case 'DEEP':
+        //TODO: Crash
         setMasterRanking(
           masterRanking.sort((a: Ranking, b: Ranking) => b.score_deep - a.score_deep)
         );
@@ -149,8 +150,9 @@ const MasterRankingScreen = () => {
                   labelField="label"
                   valueField="value"
                   placeholder="Select ranking"
-                  value={valueRanking?.value}
+                  value={valueRanking.value}
                   onChange={(item) => {
+                    console.log(item, 'ITEM');
                     setValueRanking(item);
                   }}
                 />