Bläddra i källkod

disclaimers and fixes

Viktoriia 23 timmar sedan
förälder
incheckning
3f359436d0

+ 1 - 0
src/modules/api/events/events-api.ts

@@ -160,6 +160,7 @@ export interface PostGetEventForEditingReturn {
   time_from: string;
   time_to: string;
   title: string;
+  photo_id: number | null;
   result: string;
 }
 

+ 1 - 1
src/screens/InAppScreens/TravelsScreen/CreateEvent/index.tsx

@@ -90,7 +90,7 @@ const CreateEventScreen = ({ route }: { route: any }) => {
     time_to: eventData?.time_to ? timeStringToDate(eventData.time_to) : null,
     // capacity: eventData?.capacity ?? '',
     region: eventData?.region ?? null,
-    photo: null,
+    photo: eventData?.photo_id ?? null,
     city: eventData?.address1 ?? '',
     address: eventData?.address2 ?? '',
     pin:

+ 17 - 0
src/screens/InAppScreens/TravelsScreen/CreateEvent/styles.tsx

@@ -77,5 +77,22 @@ export const styles = StyleSheet.create({
     color: Colors.DARK_BLUE,
     fontSize: getFontSize(14),
     fontFamily: 'redhat-700'
+  },
+  checkbox: {
+    flexDirection: 'row',
+    alignItems: 'center',
+    gap: 8
+  },
+  text: {
+    color: Colors.DARK_BLUE,
+    fontSize: getFontSize(12),
+    flex: 1,
+    paddingRight: 4
+  },
+  textError: {
+    fontSize: getFontSize(12),
+    fontWeight: '500',
+    color: '#EF5B5B',
+    marginTop: 5
   }
 });

+ 34 - 4
src/screens/InAppScreens/TravelsScreen/CreateSharedTrip/index.tsx

@@ -49,7 +49,8 @@ const EventSchema = yup.object({
   end_date: yup.date().nullable().required(),
   tentative: yup.number().optional(),
   photo: yup.number().nullable().required(),
-  details: yup.string().required()
+  details: yup.string().required(),
+  checkboxAgreed: yup.bool().isTrue()
 });
 
 const CreateSharedTripScreen = ({ route }: { route: any }) => {
@@ -128,8 +129,9 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
     start_date: eventData?.date_from ?? '',
     end_date: eventData?.date_to ?? '',
     tentative: eventData?.date_tentative ?? 0,
-    photo: null,
-    details: eventData?.details ?? ''
+    photo: eventData?.photo_id ?? null,
+    details: eventData?.details ?? '',
+    checkboxAgreed: false
   };
 
   const [modalInfo, setModalInfo] = useState({
@@ -212,7 +214,8 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
                   end_date: values.end_date,
                   tentative: values.tentative,
                   regions: regionsToSave,
-                  details: values.details
+                  details: values.details,
+                  disclaimer: values.checkboxAgreed ? 1 : 0
                 };
 
                 if (values.photo) {
@@ -551,6 +554,33 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
                     ) : null}
                   </View>
 
+                  <View>
+                    <TouchableOpacity
+                      onPress={() =>
+                        props.setFieldValue('checkboxAgreed', !props.values.checkboxAgreed)
+                      }
+                      style={styles.checkbox}
+                    >
+                      <CheckBox
+                        onChange={(value) => props.setFieldValue('checkboxAgreed', value)}
+                        value={props.values.checkboxAgreed}
+                        color={Colors.DARK_BLUE}
+                      />
+                      <Text style={styles.text}>
+                        I confirm that this trip is a private, non-commercial travel plan intended
+                        for fellow travelers to join and share costs. I understand that advertising
+                        professional, commercial, or tour agency services through this feature is
+                        not allowed. I acknowledge that NomadMania is not the organizer and takes no
+                        responsibility for this trip.
+                      </Text>
+                    </TouchableOpacity>
+                    <Text style={styles.textError}>
+                      {props.touched.checkboxAgreed && props.errors.checkboxAgreed
+                        ? 'to use our service you need to agree'
+                        : null}
+                    </Text>
+                  </View>
+
                   {eventId ? (
                     <View style={{ marginTop: 15, marginBottom: 15, gap: 8 }}>
                       <Button

+ 37 - 0
src/screens/InAppScreens/TravelsScreen/EventScreen/index.tsx

@@ -73,6 +73,7 @@ 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';
+import InfoIcon from 'assets/icons/info-solid.svg';
 
 type TempFile = {
   filetype: string;
@@ -149,6 +150,8 @@ const EventScreen = ({ route }: { route: any }) => {
   const [showScrollToTop, setShowScrollToTop] = useState(false);
   const scrollToTopOpacity = useRef(new Animated.Value(0)).current;
 
+  const [toolTipVisible, setToolTipVisible] = useState<boolean>(false);
+
   useEffect(() => {
     if (regions && regions.length > 0 && event && event.type === 4) {
       handleGetPhotosForAllRegions(regions);
@@ -1690,6 +1693,40 @@ const EventScreen = ({ route }: { route: any }) => {
               </TouchableOpacity>
             ) : null}
 
+            {event.type === 4 ? (
+              <TouchableOpacity
+                onPress={() => setToolTipVisible(true)}
+                style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}
+              >
+                <Tooltip
+                  isVisible={toolTipVisible}
+                  content={
+                    <Text style={{ fontSize: 12, color: Colors.DARK_BLUE }}>
+                      Disclaimer: This trip has been created and published by a community member.
+                      NomadMania is not the organizer and is not involved in planning, managing, or
+                      overseeing this trip. We take no responsibility for its content, safety, or
+                      execution. Please exercise your own judgment when joining.
+                    </Text>
+                  }
+                  contentStyle={{ backgroundColor: Colors.WHITE }}
+                  placement="bottom"
+                  onClose={() => setToolTipVisible(false)}
+                  backgroundColor="transparent"
+                  allowChildInteraction={false}
+                >
+                  <TouchableOpacity
+                    onPress={() => setToolTipVisible(true)}
+                    hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
+                  >
+                    <InfoIcon fill={Colors.DARK_BLUE} width={16} height={16} />
+                  </TouchableOpacity>
+                </Tooltip>
+                <Text style={{ fontSize: 12, color: Colors.DARK_BLUE, fontWeight: '600' }}>
+                  Disclaimer [read more]
+                </Text>
+              </TouchableOpacity>
+            ) : null}
+
             <View style={[styles.divider]} />
 
             {event.settings.details && event.settings.details.length ? (

+ 38 - 0
src/screens/InAppScreens/TravelsScreen/EventsScreen/index.tsx

@@ -47,6 +47,7 @@ import { renderSpotsText } from './utils';
 import ChevronIcon from 'assets/icons/chevron-left.svg';
 import Tooltip from 'react-native-walkthrough-tooltip';
 import { TabBar, TabView } from 'react-native-tab-view';
+import InfoIcon from 'assets/icons/info-solid.svg';
 
 function TabViewDelayed({
   children,
@@ -112,6 +113,7 @@ const EventsScreen = () => {
 
   const [showPopup, setShowPopup] = useState(false);
   const [popupPosition, setPopupPosition] = useState({ x: 0, y: 0 });
+  const [toolTipVisible, setToolTipVisible] = useState<boolean>(false);
 
   const buttonRef = useRef<TouchableOpacity>(null);
 
@@ -461,6 +463,42 @@ const EventsScreen = () => {
             scrollViewRefs.current[route.key] = ref;
           }}
           data={filteredEvents[route.key] || []}
+          ListHeaderComponent={
+            route.key === 'shared_trips' ? (
+              <TouchableOpacity
+                onPress={() => setToolTipVisible(true)}
+                style={{ flexDirection: 'row', alignItems: 'center', gap: 6, marginBottom: 12 }}
+              >
+                <Tooltip
+                  isVisible={toolTipVisible}
+                  content={
+                    <Text style={{ fontSize: 12, color: Colors.DARK_BLUE }}>
+                      Disclaimer: All trips listed here are shared by members of our travel
+                      community. NomadMania is not the organizer of these trips, and we do not
+                      verify their details, safety, or suitability. Participation is at your own
+                      discretion and risk. We do not take any responsibility for arrangements,
+                      agreements, or outcomes related to these community-shared trips.
+                    </Text>
+                  }
+                  contentStyle={{ backgroundColor: Colors.WHITE }}
+                  placement="bottom"
+                  onClose={() => setToolTipVisible(false)}
+                  backgroundColor="transparent"
+                  allowChildInteraction={false}
+                >
+                  <TouchableOpacity
+                    onPress={() => setToolTipVisible(true)}
+                    hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
+                  >
+                    <InfoIcon fill={Colors.DARK_BLUE} width={16} height={16} />
+                  </TouchableOpacity>
+                </Tooltip>
+                <Text style={{ fontSize: 12, color: Colors.DARK_BLUE, fontWeight: '600' }}>
+                  Disclaimer [read more]
+                </Text>
+              </TouchableOpacity>
+            ) : null
+          }
           scrollEnabled={true}
           keyExtractor={(item) => `${route.key}-${item.id}`}
           renderItem={renderEventCard}