|
@@ -68,10 +68,10 @@ import { Dropdown } from 'react-native-searchable-dropdown-kj';
|
|
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
|
import Tooltip from 'react-native-walkthrough-tooltip';
|
|
|
import WebView from 'react-native-webview';
|
|
|
-import ClockIcon from 'assets/icons/events/clock.svg';
|
|
|
import { PhotosData } from '../../MapScreen/RegionViewScreen/types';
|
|
|
import ImageCarousel from '../../MapScreen/RegionViewScreen/ImageCarousel';
|
|
|
import EditSvg from 'assets/icons/events/edit.svg';
|
|
|
+import ChatIcon from 'assets/icons/bottom-navigation/messages.svg';
|
|
|
|
|
|
type TempFile = {
|
|
|
filetype: string;
|
|
@@ -126,6 +126,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
const [isImageModalVisible, setIsImageModalVisible] = useState(false);
|
|
|
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
|
|
const [nmId, setNmId] = useState<number | null>(null);
|
|
|
+ const [tooltipVisible, setTooltipVisible] = useState(false);
|
|
|
|
|
|
const { data: photosData } = useGetPhotosForRegionQuery(nmId ?? 0, nmId !== null);
|
|
|
|
|
@@ -621,7 +622,6 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
</Text>
|
|
|
{event.time_from && event.time_to ? (
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
|
|
|
- <ClockIcon fill={Colors.DARK_BLUE} height={12} width={12} />
|
|
|
<Text
|
|
|
style={{
|
|
|
fontSize: getFontSize(12),
|
|
@@ -634,7 +634,6 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
</View>
|
|
|
) : event.time ? (
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
|
|
|
- <ClockIcon fill={Colors.DARK_BLUE} height={12} width={12} />
|
|
|
<Text
|
|
|
style={{
|
|
|
fontSize: getFontSize(12),
|
|
@@ -822,12 +821,32 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 4, flex: 1 }}>
|
|
|
- <CalendarIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
- {formatEventDate(event)}
|
|
|
- </View>
|
|
|
-
|
|
|
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 4, flex: 1 }}>
|
|
|
- <EarthIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
+ {event.settings.type === 1 && event?.flag ? (
|
|
|
+ <Tooltip
|
|
|
+ isVisible={tooltipVisible}
|
|
|
+ content={<Text>{event.country}</Text>}
|
|
|
+ contentStyle={{ backgroundColor: Colors.FILL_LIGHT }}
|
|
|
+ placement="top"
|
|
|
+ onClose={() => setTooltipVisible(false)}
|
|
|
+ backgroundColor="transparent"
|
|
|
+ allowChildInteraction={false}
|
|
|
+ >
|
|
|
+ <TouchableOpacity onPress={() => setTooltipVisible(true)}>
|
|
|
+ <Image
|
|
|
+ source={{ uri: API_HOST + event.flag }}
|
|
|
+ style={{
|
|
|
+ width: 20,
|
|
|
+ height: 20,
|
|
|
+ borderRadius: 10,
|
|
|
+ borderWidth: 0.5,
|
|
|
+ borderColor: Colors.DARK_LIGHT
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </TouchableOpacity>
|
|
|
+ </Tooltip>
|
|
|
+ ) : (
|
|
|
+ <EarthIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
+ )}
|
|
|
<Text
|
|
|
style={{
|
|
|
fontSize: getFontSize(12),
|
|
@@ -839,6 +858,11 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
{event.settings.address1}
|
|
|
</Text>
|
|
|
</View>
|
|
|
+
|
|
|
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 4, flex: 1 }}>
|
|
|
+ <CalendarIcon fill={Colors.DARK_BLUE} height={20} width={20} />
|
|
|
+ {formatEventDate(event)}
|
|
|
+ </View>
|
|
|
</View>
|
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
|
|
@@ -905,7 +929,19 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
}}
|
|
|
style={[styles.userImage, { marginLeft: 0 }]}
|
|
|
/>
|
|
|
- ) : null}
|
|
|
+ ) : (
|
|
|
+ <AvatarWithInitials
|
|
|
+ text={
|
|
|
+ event.settings.host_data.first_name[0] +
|
|
|
+ event.settings.host_data.last_name[0]
|
|
|
+ }
|
|
|
+ flag={API_HOST + event.settings.host_data?.flag}
|
|
|
+ size={28}
|
|
|
+ fontSize={12}
|
|
|
+ borderColor={Colors.DARK_LIGHT}
|
|
|
+ borderWidth={1}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
<View style={{ justifyContent: 'space-between' }}>
|
|
|
<Text
|
|
@@ -915,17 +951,16 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
color: Colors.DARK_BLUE
|
|
|
}}
|
|
|
>
|
|
|
- {event.settings.host_data.first_name} {event.settings.host_data.last_name}
|
|
|
+ {event.settings.host_data.first_name}
|
|
|
</Text>
|
|
|
- <Text style={{ fontWeight: '600', fontSize: 12, color: Colors.DARK_BLUE }}>
|
|
|
- NM:{' '}
|
|
|
- <Text style={{ fontFamily: 'montserrat-700' }}>
|
|
|
- {event.settings.host_data.nm}
|
|
|
- </Text>{' '}
|
|
|
- / UN:{' '}
|
|
|
- <Text style={{ fontFamily: 'montserrat-700' }}>
|
|
|
- {event.settings.host_data.un}
|
|
|
- </Text>
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ fontFamily: 'montserrat-700',
|
|
|
+ fontSize: 12,
|
|
|
+ color: Colors.DARK_BLUE
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {event.settings.host_data.last_name}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</View>
|
|
@@ -937,7 +972,9 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
|
|
|
{filteredParticipants.length > 0 ? (
|
|
|
<View style={{ gap: 8, flex: 1 }}>
|
|
|
- <Text style={[styles.travelSeriesTitle, { fontSize: 12 }]}>Participants</Text>
|
|
|
+ <Text style={[styles.travelSeriesTitle, { fontSize: 12 }]}>
|
|
|
+ Participants{event.participants ? ` (${event.participants})` : ''}
|
|
|
+ </Text>
|
|
|
|
|
|
<View style={[styles.statItem, { justifyContent: 'flex-start' }]}>
|
|
|
<View style={styles.userImageContainer}>
|
|
@@ -968,19 +1005,15 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
key={index}
|
|
|
backgroundColor="transparent"
|
|
|
>
|
|
|
- <TouchableOpacity onPress={() => setTooltipUser(index)}>
|
|
|
+ <TouchableOpacity
|
|
|
+ style={index !== 0 ? { marginLeft: -10 } : {}}
|
|
|
+ onPress={() => setTooltipUser(index)}
|
|
|
+ >
|
|
|
{user.avatar ? (
|
|
|
<Image
|
|
|
key={index}
|
|
|
source={{ uri: API_HOST + user.avatar }}
|
|
|
- style={[
|
|
|
- styles.userImage,
|
|
|
- (filteredParticipants.length > maxVisibleParticipantsWithGap ||
|
|
|
- filteredParticipants.length < (event.participants ?? 0)) &&
|
|
|
- index !== 0
|
|
|
- ? { marginLeft: -10 }
|
|
|
- : {}
|
|
|
- ]}
|
|
|
+ style={[styles.userImage]}
|
|
|
/>
|
|
|
) : (
|
|
|
<AvatarWithInitials
|
|
@@ -997,12 +1030,23 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
</TouchableOpacity>
|
|
|
</Tooltip>
|
|
|
))}
|
|
|
- {maxVisibleParticipants < filteredParticipants.length ||
|
|
|
- filteredParticipants.length < (event.participants ?? 0) ? (
|
|
|
- <View style={styles.userCountContainer}>
|
|
|
- <Text style={styles.userCount}>{event.participants}</Text>
|
|
|
- </View>
|
|
|
- ) : null}
|
|
|
+ <TouchableOpacity
|
|
|
+ style={styles.userCountContainer}
|
|
|
+ onPress={() =>
|
|
|
+ navigation.navigate(
|
|
|
+ ...([
|
|
|
+ NAVIGATION_PAGES.PARTICIPANTS_LIST,
|
|
|
+ {
|
|
|
+ participants: event.participants_full_data
|
|
|
+ }
|
|
|
+ ] as never)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <View style={styles.dots}></View>
|
|
|
+ <View style={styles.dots}></View>
|
|
|
+ <View style={styles.dots}></View>
|
|
|
+ </TouchableOpacity>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
@@ -1062,32 +1106,92 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
) : null}
|
|
|
{event.settings.host_profile === +currentUserId ||
|
|
|
event.archived === 1 ? null : joined ? (
|
|
|
- <TouchableOpacity
|
|
|
- style={{
|
|
|
- flexDirection: 'row',
|
|
|
- alignItems: 'center',
|
|
|
- justifyContent: 'center',
|
|
|
- paddingVertical: 8,
|
|
|
- paddingHorizontal: 12,
|
|
|
- borderRadius: 20,
|
|
|
- backgroundColor: Colors.WHITE,
|
|
|
- gap: 6,
|
|
|
- borderWidth: 1,
|
|
|
- borderColor: Colors.DARK_BLUE
|
|
|
- }}
|
|
|
- onPress={handleUnjoinEvent}
|
|
|
- >
|
|
|
- <CalendarCrossedIcon fill={Colors.DARK_BLUE} width={16} height={16} />
|
|
|
- <Text
|
|
|
+ <View style={{ flexDirection: 'row', gap: 8 }}>
|
|
|
+ <TouchableOpacity
|
|
|
style={{
|
|
|
- color: Colors.DARK_BLUE,
|
|
|
- fontSize: getFontSize(14),
|
|
|
- fontFamily: 'montserrat-700'
|
|
|
+ flex: 1,
|
|
|
+ flexDirection: 'row',
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'center',
|
|
|
+ paddingVertical: 8,
|
|
|
+ paddingHorizontal: 12,
|
|
|
+ borderRadius: 20,
|
|
|
+ backgroundColor: Colors.WHITE,
|
|
|
+ gap: 6,
|
|
|
+ borderWidth: 1,
|
|
|
+ borderColor: Colors.DARK_BLUE
|
|
|
}}
|
|
|
+ onPress={handleUnjoinEvent}
|
|
|
>
|
|
|
- Cancel
|
|
|
- </Text>
|
|
|
- </TouchableOpacity>
|
|
|
+ <CalendarCrossedIcon fill={Colors.DARK_BLUE} width={16} height={16} />
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ color: Colors.DARK_BLUE,
|
|
|
+ fontSize: getFontSize(14),
|
|
|
+ fontFamily: 'montserrat-700'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ Cancel
|
|
|
+ </Text>
|
|
|
+ </TouchableOpacity>
|
|
|
+
|
|
|
+ {event.settings?.chat_token && (
|
|
|
+ <TouchableOpacity
|
|
|
+ style={{
|
|
|
+ flex: 1,
|
|
|
+ flexDirection: 'row',
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'center',
|
|
|
+ paddingVertical: 8,
|
|
|
+ paddingHorizontal: 12,
|
|
|
+ borderRadius: 20,
|
|
|
+ backgroundColor: Colors.ORANGE,
|
|
|
+ gap: 6,
|
|
|
+ borderWidth: 1,
|
|
|
+ borderColor: Colors.ORANGE
|
|
|
+ }}
|
|
|
+ onPress={() =>
|
|
|
+ navigation.dispatch(
|
|
|
+ CommonActions.reset({
|
|
|
+ index: 1,
|
|
|
+ routes: [
|
|
|
+ {
|
|
|
+ name: 'DrawerApp',
|
|
|
+ state: {
|
|
|
+ routes: [
|
|
|
+ {
|
|
|
+ name: NAVIGATION_PAGES.IN_APP_MESSAGES_TAB,
|
|
|
+ state: {
|
|
|
+ routes: [
|
|
|
+ { name: NAVIGATION_PAGES.CHATS_LIST },
|
|
|
+ {
|
|
|
+ name: NAVIGATION_PAGES.GROUP_CHAT,
|
|
|
+ params: { group_token: event.settings?.chat_token }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ )
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <ChatIcon fill={Colors.WHITE} width={16} height={16} />
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ color: Colors.WHITE,
|
|
|
+ fontSize: getFontSize(14),
|
|
|
+ fontFamily: 'montserrat-700'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ Chat
|
|
|
+ </Text>
|
|
|
+ </TouchableOpacity>
|
|
|
+ )}
|
|
|
+ </View>
|
|
|
) : !event.full ? (
|
|
|
<TouchableOpacity
|
|
|
style={{
|
|
@@ -1104,7 +1208,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
}}
|
|
|
onPress={handleJoinEvent}
|
|
|
>
|
|
|
- {event.settings.free ? (
|
|
|
+ {event.settings.type === 1 ? (
|
|
|
<>
|
|
|
<GigtIcon fill={Colors.WHITE} width={16} height={16} />
|
|
|
<Text
|