|
@@ -30,17 +30,31 @@ const UpdatesRenderer = <T extends string>({
|
|
|
|
|
|
const handlePress = (item: any) => {
|
|
|
setIsModalVisible(false);
|
|
|
- navigation.navigate(
|
|
|
- ...([
|
|
|
- NAVIGATION_PAGES.REGION_PREVIEW,
|
|
|
- {
|
|
|
- regionId: item.id,
|
|
|
- type: type === 'nm' ? 'nm' : 'dare',
|
|
|
- disabled: false,
|
|
|
- isProfileScreen: true
|
|
|
- }
|
|
|
- ] as never)
|
|
|
- );
|
|
|
+ if (type === 'nm' || type === 'dare') {
|
|
|
+ navigation.navigate(
|
|
|
+ ...([
|
|
|
+ NAVIGATION_PAGES.REGION_PREVIEW,
|
|
|
+ {
|
|
|
+ regionId: item.id,
|
|
|
+ type: type === 'nm' ? 'nm' : 'dare',
|
|
|
+ disabled: false,
|
|
|
+ isProfileScreen: true
|
|
|
+ }
|
|
|
+ ] as never)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ navigation.navigate(
|
|
|
+ ...([
|
|
|
+ NAVIGATION_PAGES.COUNTRY_PREVIEW,
|
|
|
+ {
|
|
|
+ regionId: item.id,
|
|
|
+ type: 'country',
|
|
|
+ disabled: false,
|
|
|
+ isProfileScreen: true
|
|
|
+ }
|
|
|
+ ] as never)
|
|
|
+ );
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const renderContent = () => {
|
|
@@ -78,7 +92,7 @@ const UpdatesRenderer = <T extends string>({
|
|
|
<Text style={styles.regionName}>{item.name}</Text>
|
|
|
</TouchableOpacity>
|
|
|
)}
|
|
|
- keyExtractor={(item) => item.id.toString()}
|
|
|
+ keyExtractor={(item, index) => item.id.toString() + index.toString()}
|
|
|
showsVerticalScrollIndicator={false}
|
|
|
nestedScrollEnabled={true}
|
|
|
contentContainerStyle={{ paddingTop: 8 }}
|
|
@@ -95,7 +109,7 @@ const UpdatesRenderer = <T extends string>({
|
|
|
estimatedItemSize={50}
|
|
|
data={(updates.data as UnOrUnp).visited_countries}
|
|
|
renderItem={({ item }) => (
|
|
|
- <View style={styles.item}>
|
|
|
+ <TouchableOpacity onPress={() => handlePress(item)} style={styles.item}>
|
|
|
<Image
|
|
|
source={{
|
|
|
uri: API_HOST + '/img/flags_new/' + item.flag
|
|
@@ -103,7 +117,7 @@ const UpdatesRenderer = <T extends string>({
|
|
|
style={styles.regionsFlag}
|
|
|
/>
|
|
|
<Text style={styles.regionName}>{item.country}</Text>
|
|
|
- </View>
|
|
|
+ </TouchableOpacity>
|
|
|
)}
|
|
|
keyExtractor={(item) => item.country.toString()}
|
|
|
showsVerticalScrollIndicator={false}
|