Viktoriia před 3 týdny
rodič
revize
f868a7dba5

+ 1 - 1
src/screens/InAppScreens/TravelsScreen/EventsScreen/index.tsx

@@ -358,7 +358,7 @@ const EventsScreen = () => {
             {item.joined && token ? (
               <View style={styles.joinedOverlay}>
                 <Text style={{ color: Colors.WHITE, fontSize: 12, fontFamily: 'redhat-700' }}>
-                  Going
+                  Joined
                 </Text>
               </View>
             ) : null}

+ 41 - 36
src/screens/InAppScreens/TravelsScreen/EventsScreen/utils.tsx

@@ -2,7 +2,7 @@ import { SingleEvent } from '@api/events';
 import { Text } from 'react-native';
 
 export const renderSpotsText = (e: SingleEvent) => {
-  if (e.type === 4) {
+  if (e.type !== 1) {
     if (e.interested > 0 && e.joining > 0) {
       return (
         <Text>
@@ -24,44 +24,49 @@ export const renderSpotsText = (e: SingleEvent) => {
       );
     }
   }
-  // if (e.type === 1 && e.joining > 0) {
-  if (e.joining > 0) {
+  if (e.type === 1) {
     return (
       <Text>
-        <Text style={{ fontWeight: '700' }}>{e.joining}</Text> going
+        <Text style={{ fontWeight: '700' }}>{e.participants ?? 0}</Text> going
       </Text>
     );
   }
-  switch (e.registrations_info) {
-    case 2:
-      return (
-        <Text>
-          <Text style={{ fontWeight: '700' }}>{(e.capacity ?? 0) - (e.available ?? 0)}</Text> total
-          spots available
-        </Text>
-      );
-    case 3:
-      return (
-        <Text>
-          <Text style={{ fontWeight: '700' }}>{e.available}</Text> spots remaining
-        </Text>
-      );
-    case 4:
-      return (
-        <Text>
-          <Text style={{ fontWeight: '700' }}>{e.participants}</Text> Nomads interested
-        </Text>
-      );
-    case 5:
-      return (
-        <Text>
-          <Text style={{ fontWeight: '700' }}>
-            {e.available ?? (e.capacity ?? 0) - (e.participants ?? 0)} / {e.capacity}
-          </Text>{' '}
-          spots available
-        </Text>
-      );
-    default:
-      return '';
-  }
+
+  return (
+    <Text>
+      <Text style={{ fontWeight: '700' }}>{e.participants}</Text> Nomads interested
+    </Text>
+  );
+  // switch (e.registrations_info) {
+  //   case 2:
+  //     return (
+  //       <Text>
+  //         <Text style={{ fontWeight: '700' }}>{(e.capacity ?? 0) - (e.available ?? 0)}</Text> total
+  //         spots available
+  //       </Text>
+  //     );
+  //   case 3:
+  //     return (
+  //       <Text>
+  //         <Text style={{ fontWeight: '700' }}>{e.available}</Text> spots remaining
+  //       </Text>
+  //     );
+  //   case 4:
+  //     return (
+  //       <Text>
+  //         <Text style={{ fontWeight: '700' }}>{e.participants}</Text> Nomads interested
+  //       </Text>
+  //     );
+  //   case 5:
+  //     return (
+  //       <Text>
+  //         <Text style={{ fontWeight: '700' }}>
+  //           {e.available ?? (e.capacity ?? 0) - (e.participants ?? 0)} / {e.capacity}
+  //         </Text>{' '}
+  //         spots available
+  //       </Text>
+  //     );
+  //   default:
+  //     return '';
+  // }
 };