|
@@ -7,13 +7,12 @@ import Tooltip from 'react-native-walkthrough-tooltip';
|
|
|
import RegionsRenderer from '../RegionsRenderer';
|
|
|
|
|
|
import CompassIcon from 'assets/icons/travels-section/compass.svg';
|
|
|
-import FriendsIcon from 'assets/icons/user-group.svg';
|
|
|
import FlagsIcon from 'assets/icons/travels-section/flags.svg';
|
|
|
-import PhotosIcon from 'assets/icons/travels-section/images.svg';
|
|
|
import RegionsIcon from 'assets/icons/travels-section/regions.svg';
|
|
|
import SeriesIcon from 'assets/icons/travels-section/series.svg';
|
|
|
import WHSIcon from 'assets/icons/travels-section/whs.svg';
|
|
|
import ArrowIcon from 'assets/icons/next.svg';
|
|
|
+import UNPIcon from 'assets/icons/travels-section/unp.svg';
|
|
|
|
|
|
import { styles } from './styles';
|
|
|
import { InfoItem } from './InfoItem';
|
|
@@ -46,15 +45,16 @@ type PersonalInfoProps = {
|
|
|
ownProfile: 0 | 1;
|
|
|
};
|
|
|
updates: {
|
|
|
- countries: number;
|
|
|
- dare: number;
|
|
|
- friends: number;
|
|
|
- new_nm: number;
|
|
|
- photos: number;
|
|
|
- series: number;
|
|
|
- visited_regions: number;
|
|
|
- whs: number;
|
|
|
- };
|
|
|
+ un_visited: number;
|
|
|
+ un_new: number;
|
|
|
+ unp_visited: number;
|
|
|
+ unp_new: number;
|
|
|
+ nm_visited: number;
|
|
|
+ nm_new: number;
|
|
|
+ new_dare: number;
|
|
|
+ new_series: number;
|
|
|
+ new_whs: number;
|
|
|
+ } | null;
|
|
|
userId: number;
|
|
|
navigation: NavigationProp<any>;
|
|
|
isPublicView: boolean;
|
|
@@ -151,15 +151,15 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
|
|
|
};
|
|
|
|
|
|
const hasUpdates = () => {
|
|
|
+ if (!updates) return false;
|
|
|
+
|
|
|
return (
|
|
|
- (updates.countries && updates.countries > 0) ||
|
|
|
- (updates.visited_regions && updates.visited_regions > 0) ||
|
|
|
- (updates.dare && updates.dare > 0) ||
|
|
|
- (updates.series && updates.series > 0) ||
|
|
|
- (updates.whs && updates.whs > 0) ||
|
|
|
- (updates.new_nm && updates.new_nm > 0) ||
|
|
|
- (updates.photos && updates.photos > 0) ||
|
|
|
- (updates.friends && updates.friends > 0)
|
|
|
+ (updates.un_visited && updates.un_visited > 0) ||
|
|
|
+ (updates.unp_visited && updates.unp_visited > 0) ||
|
|
|
+ (updates.nm_visited && updates.nm_visited > 0) ||
|
|
|
+ (updates.new_dare && updates.new_dare > 0) ||
|
|
|
+ (updates.new_series && updates.new_series > 0) ||
|
|
|
+ (updates.new_whs && updates.new_whs > 0)
|
|
|
);
|
|
|
};
|
|
|
|
|
@@ -228,7 +228,7 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
|
|
|
) : null}
|
|
|
|
|
|
{data.friends.length > 0 ? (
|
|
|
- <InfoItem inline={true} title={'FRIENDS'}>
|
|
|
+ <InfoItem inline={true} title={`FRIENDS (${data.friends.length})`}>
|
|
|
<View style={{ flexDirection: 'row', flex: 1 }}>
|
|
|
{data.friends.slice(0, maxAvatars).map((friend, index) => (
|
|
|
<Tooltip
|
|
@@ -317,79 +317,75 @@ export const PersonalInfo: FC<PersonalInfoProps> = ({
|
|
|
</InfoItem>
|
|
|
) : null}
|
|
|
|
|
|
- {hasUpdates() ? (
|
|
|
- <InfoItem title={'UPDATES (last 90 days)'}>
|
|
|
+ {updates && hasUpdates() ? (
|
|
|
+ <InfoItem title={'Visited in the last 90 days'}>
|
|
|
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
|
- {updates.countries && updates.countries > 0 ? (
|
|
|
+ {updates.un_visited && updates.un_visited > 0 ? (
|
|
|
<View style={styles.updates}>
|
|
|
<FlagsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.countries}</Text>
|
|
|
- <Text style={styles.updatesText}>visited countries</Text>
|
|
|
- </View>
|
|
|
+ {updates.un_new && updates.un_new > 0 ? (
|
|
|
+ <View>
|
|
|
+ <Text style={styles.updatesText}>
|
|
|
+ {updates.un_visited} (+{updates.un_new} new)
|
|
|
+ </Text>
|
|
|
+ <Text style={styles.updatesText}>UN countries</Text>
|
|
|
+ </View>
|
|
|
+ ) : (
|
|
|
+ <Text style={styles.updatesText}>{updates.un_visited} UN countries</Text>
|
|
|
+ )}
|
|
|
+ </View>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {updates.unp_visited && updates.unp_visited > 0 ? (
|
|
|
+ <View style={styles.updates}>
|
|
|
+ <UNPIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
+ {updates.unp_new && updates.unp_new > 0 ? (
|
|
|
+ <View>
|
|
|
+ <Text style={styles.updatesText}>
|
|
|
+ {updates.unp_visited} (+{updates.unp_new} new)
|
|
|
+ </Text>
|
|
|
+ <Text style={styles.updatesText}>UN+ states</Text>
|
|
|
+ </View>
|
|
|
+ ) : (
|
|
|
+ <Text style={styles.updatesText}>{updates.unp_visited} UN+ states</Text>
|
|
|
+ )}
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {updates.visited_regions && updates.visited_regions > 0 ? (
|
|
|
+
|
|
|
+ {updates.nm_visited && updates.nm_visited > 0 ? (
|
|
|
<View style={styles.updates}>
|
|
|
<RegionsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.visited_regions}</Text>
|
|
|
- <Text style={styles.updatesText}>visited regions</Text>
|
|
|
- </View>
|
|
|
+ {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>
|
|
|
+ )}
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {updates.dare && updates.dare > 0 ? (
|
|
|
+
|
|
|
+ {updates.new_dare && updates.new_dare > 0 ? (
|
|
|
<View style={styles.updates}>
|
|
|
<CompassIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.dare}</Text>
|
|
|
- <Text style={styles.updatesText}>new DARE places</Text>
|
|
|
- </View>
|
|
|
+ <Text style={styles.updatesText}>{updates.new_dare} new DARE</Text>
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {updates.series && updates.series > 0 ? (
|
|
|
+
|
|
|
+ {updates.new_series && updates.new_series > 0 ? (
|
|
|
<View style={styles.updates}>
|
|
|
<SeriesIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.series}</Text>
|
|
|
- <Text style={styles.updatesText}>new series</Text>
|
|
|
- </View>
|
|
|
+ <Text style={styles.updatesText}>{updates.new_series} new Series</Text>
|
|
|
</View>
|
|
|
) : null}
|
|
|
- {updates.whs && updates.whs > 0 ? (
|
|
|
+
|
|
|
+ {updates.new_whs && updates.new_whs > 0 ? (
|
|
|
<View style={styles.updates}>
|
|
|
<WHSIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.whs}</Text>
|
|
|
- <Text style={styles.updatesText}>new WHS sites</Text>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- ) : null}
|
|
|
- {updates.new_nm && updates.new_nm > 0 ? (
|
|
|
- <View style={styles.updates}>
|
|
|
- <RegionsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.new_nm}</Text>
|
|
|
- <Text style={styles.updatesText}>new NM regions</Text>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- ) : null}
|
|
|
- {updates.photos && updates.photos > 0 ? (
|
|
|
- <View style={styles.updates}>
|
|
|
- <PhotosIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.photos}</Text>
|
|
|
- <Text style={styles.updatesText}>new photos</Text>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- ) : null}
|
|
|
- {updates.friends && updates.friends > 0 ? (
|
|
|
- <View style={styles.updates}>
|
|
|
- <FriendsIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- <View>
|
|
|
- <Text style={styles.updatesTextCount}>+{updates.friends}</Text>
|
|
|
- <Text style={styles.updatesText}>new friends</Text>
|
|
|
- </View>
|
|
|
+ <Text style={styles.updatesText}>{updates.new_whs} new WHS</Text>
|
|
|
</View>
|
|
|
) : null}
|
|
|
</View>
|