|
@@ -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 '';
|
|
|
+ // }
|
|
|
};
|