|
@@ -1,6 +1,6 @@
|
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
-import { View, Text, Image, TouchableOpacity, LayoutAnimation, Modal } from 'react-native';
|
|
|
|
|
-import { FlashList } from '@shopify/flash-list';
|
|
|
|
|
|
|
+import { View, Text, Image, TouchableOpacity, LayoutAnimation, Modal, Linking } from 'react-native';
|
|
|
|
|
+import { FlashList, FlashListRef } from '@shopify/flash-list';
|
|
|
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
|
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
|
|
import { popupStyles, styles } from './styles';
|
|
import { popupStyles, styles } from './styles';
|
|
|
import Animated, {
|
|
import Animated, {
|
|
@@ -99,7 +99,7 @@ const EventsScreen = () => {
|
|
|
local_meetings: false
|
|
local_meetings: false
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const scrollViewRefs = useRef<Record<string, FlashList<SingleEvent> | null>>({
|
|
|
|
|
|
|
+ const scrollViewRefs = useRef<Record<string, FlashListRef<SingleEvent> | null>>({
|
|
|
nm: null,
|
|
nm: null,
|
|
|
shared_trips: null,
|
|
shared_trips: null,
|
|
|
local_meetings: null
|
|
local_meetings: null
|
|
@@ -332,9 +332,14 @@ const EventsScreen = () => {
|
|
|
? { backgroundColor: Colors.FILL_LIGHT }
|
|
? { backgroundColor: Colors.FILL_LIGHT }
|
|
|
: { backgroundColor: Colors.WHITE }
|
|
: { backgroundColor: Colors.WHITE }
|
|
|
]}
|
|
]}
|
|
|
- onPress={() =>
|
|
|
|
|
- navigation.navigate(...([NAVIGATION_PAGES.EVENT, { url: item.url }] as never))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ if (index === 0 && item.wp_url) {
|
|
|
|
|
+ const eventUrl = `${API_HOST}/${item.url}`;
|
|
|
|
|
+ Linking.openURL(eventUrl).catch((err) => console.error('Failed to event URL:', err));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ navigation.navigate(...([NAVIGATION_PAGES.EVENT, { url: item.url }] as never));
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
disabled={item.active === 0}
|
|
disabled={item.active === 0}
|
|
|
>
|
|
>
|
|
|
<View style={styles.imageWrapper}>
|
|
<View style={styles.imageWrapper}>
|