Explorar el Código

edit_in_trips + removed transit

Viktoriia hace 1 mes
padre
commit
089b4db79a

+ 31 - 0
Route.tsx

@@ -350,6 +350,15 @@ const Route = () => {
               component={EditCountryDataScreen}
             />
             <ScreenStack.Screen name={NAVIGATION_PAGES.EDIT_NM_DATA} component={EditNmDataScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRIPS_2025} component={Trips2025Screen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_TRIP_2025}
+              component={AddNewTrip2025Screen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_REGIONS_NEW}
+              component={AddRegionsNewScreen}
+            />
           </ScreenStack.Navigator>
         )}
       </BottomTab.Screen>
@@ -420,6 +429,15 @@ const Route = () => {
               component={CountryViewScreen}
               options={regionViewScreenOptions}
             />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRIPS_2025} component={Trips2025Screen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_TRIP_2025}
+              component={AddNewTrip2025Screen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_REGIONS_NEW}
+              component={AddRegionsNewScreen}
+            />
           </ScreenStack.Navigator>
         )}
       </BottomTab.Screen>
@@ -491,6 +509,19 @@ const Route = () => {
               component={EditCountryDataScreen}
             />
             <ScreenStack.Screen name={NAVIGATION_PAGES.EDIT_NM_DATA} component={EditNmDataScreen} />
+            <ScreenStack.Screen name={NAVIGATION_PAGES.TRIPS_2025} component={Trips2025Screen} />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_TRIP_2025}
+              component={AddNewTrip2025Screen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.ADD_REGIONS_NEW}
+              component={AddRegionsNewScreen}
+            />
+            <ScreenStack.Screen
+              name={NAVIGATION_PAGES.REGIONS_VISITED}
+              component={RegionsVisitedScreen}
+            />
           </ScreenStack.Navigator>
         )}
       </BottomTab.Screen>

+ 4 - 59
src/components/Calendars/RangeCalendar/index.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useState } from 'react';
-import { TouchableOpacity, View, Text } from 'react-native';
+import { View } from 'react-native';
 import { Modal } from '../../Modal';
 import DateTimePicker, { DateType } from 'react-native-ui-datepicker';
 import dayjs from 'dayjs';
@@ -20,9 +20,6 @@ import { Colors } from '../../../theme';
 import { Button } from 'src/components/Button';
 import { ButtonVariants } from 'src/types/components';
 import Navigation from './Navigation';
-import { CheckBox } from 'src/components';
-import TransitSvg from 'assets/icons/transit.svg';
-import Tooltip from 'react-native-walkthrough-tooltip';
 
 export default function RangeCalendar({
   isModalVisible,
@@ -35,12 +32,10 @@ export default function RangeCalendar({
   minDate: externalMinDate,
   maxDate: externalMaxDate,
   initialStartDate,
-  initialEndDate,
-  withTransit = false,
-  isTransit = false
+  initialEndDate
 }: {
   isModalVisible: boolean;
-  closeModal: (startDate?: string | null, endDate?: string | null, transit?: boolean) => void;
+  closeModal: (startDate?: string | null, endDate?: string | null) => void;
   allowRangeSelection?: boolean;
   disableFutureDates?: boolean;
   disablePastDates?: boolean;
@@ -50,8 +45,6 @@ export default function RangeCalendar({
   maxDate?: string | Date | dayjs.Dayjs;
   initialStartDate?: string | null;
   initialEndDate?: string | null;
-  withTransit?: boolean;
-  isTransit?: boolean;
 }) {
   const [selectedStartDate, setSelectedStartDate] = useState<string | null>(null);
   const [selectedEndDate, setSelectedEndDate] = useState<string | null>(null);
@@ -60,7 +53,6 @@ export default function RangeCalendar({
   const [endDate, setEndDate] = useState<DateType>(undefined);
   const [currentMonth, setCurrentMonth] = useState<number | undefined>(undefined);
   const [currentYear, setCurrentYear] = useState<number | undefined>(undefined);
-  const [transit, setTransit] = useState<boolean | undefined>(undefined);
   const [toolTipVisible, setToolTipVisible] = useState<boolean>(false);
 
   const computedMinDate = externalMinDate
@@ -88,9 +80,6 @@ export default function RangeCalendar({
         setSelectedEndDate(initialEndDate);
         setEndDate(dayjs(initialEndDate));
       }
-      if (withTransit) {
-        setTransit(isTransit);
-      }
     } else if (selectedDate) {
       const dateObj = dayjs(selectedDate);
       setSelectedStartDate(selectedDate);
@@ -155,7 +144,7 @@ export default function RangeCalendar({
   };
 
   const handleClose = () => {
-    closeModal(selectedStartDate, selectedEndDate, transit);
+    closeModal(selectedStartDate, selectedEndDate);
     setSelectedStartDate(null);
     setSelectedEndDate(null);
     setStartDate(undefined);
@@ -293,50 +282,6 @@ export default function RangeCalendar({
         />
       </View>
       <View style={styles.modalFooter}>
-        {withTransit ? (
-          <TouchableOpacity
-            onPress={() => setTransit(!transit)}
-            hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
-            style={{
-              flexDirection: 'row',
-              paddingBottom: 16,
-              gap: 8
-            }}
-          >
-            <Tooltip
-              isVisible={toolTipVisible}
-              content={
-                <Text
-                  style={{
-                    fontSize: 12,
-                    color: Colors.DARK_BLUE,
-                    fontStyle: 'italic',
-                    fontWeight: '600'
-                  }}
-                >
-                  Transit
-                </Text>
-              }
-              contentStyle={{ backgroundColor: Colors.WHITE }}
-              placement="top"
-              onClose={() => setToolTipVisible(false)}
-              backgroundColor="transparent"
-              allowChildInteraction={false}
-            >
-              <TouchableOpacity
-                onPress={() => setToolTipVisible(true)}
-                hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
-              >
-                <TransitSvg fill={Colors.DARK_BLUE} height={24} width={24} />
-              </TouchableOpacity>
-            </Tooltip>
-            <CheckBox
-              onChange={(value) => setTransit(!transit)}
-              value={transit}
-              color={Colors.DARK_BLUE}
-            />
-          </TouchableOpacity>
-        ) : null}
         <Button
           children="Done"
           onPress={handleClose}

+ 7 - 5
src/components/RegionPopup/index.tsx

@@ -220,9 +220,9 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
           <View style={styles.btnContainer}>
             {userData?.visited &&
             userData?.type !== 'dare' &&
+            userData?.type !== 'nm' &&
             !disabled &&
-            (userData?.visited_regions <= 1 ||
-              (userData?.type === 'nm' && userData?.no_of_visits === 1)) ? (
+            userData?.visited_regions <= 1 ? (
               <TouchableOpacity
                 onPress={
                   userData?.type === 'countries'
@@ -251,7 +251,9 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
             <TouchableOpacity
               style={[
                 styles.btn,
-                userData?.visited && !disabled ? styles.visitedButton : styles.markVisitedButton
+                (userData?.visited && !disabled) || userData.edit_in_trips === 1
+                  ? styles.visitedButton
+                  : styles.markVisitedButton
               ]}
               onPress={() => {
                 if (
@@ -275,7 +277,7 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
                     ] as never)
                   );
                   return;
-                } else if (userData?.type === 'nm' && userData?.no_of_visits > 1) {
+                } else if (userData?.type === 'nm' && userData?.edit_in_trips === 1) {
                   openEditModal();
                   return;
                 }
@@ -306,7 +308,7 @@ const RegionPopup: React.FC<RegionPopupProps> = ({
               (userData?.visited &&
                 !disabled &&
                 userData?.type === 'nm' &&
-                userData?.no_of_visits > 1) ? (
+                userData?.edit_in_trips === 1) ? (
                 <View style={styles.visitedContainer}>
                   <EditSvg width={14} height={14} />
                   <Text style={styles.visitedButtonText}>Edit</Text>

+ 22 - 21
src/screens/InAppScreens/MapScreen/RegionViewScreen/index.tsx

@@ -202,17 +202,24 @@ const RegionViewScreen: FC<Props> = ({ navigation, route }) => {
   if (isLoading) return <Loading />;
 
   const handleOpenEditModal = () => {
-    handleModalStateChange({
-      selectedFirstYear: regionData?.first_visit_year,
-      selectedLastYear: regionData?.last_visit_year,
-      selectedQuality:
-        qualityOptions.find((quality) => quality.id === regionData?.best_visit_quality) ||
-        qualityOptions[2],
-      selectedNoOfVisits: regionData?.no_of_visits || 1,
-      id: regionId
-    });
+    // handleModalStateChange({
+    //   selectedFirstYear: regionData?.first_visit_year,
+    //   selectedLastYear: regionData?.last_visit_year,
+    //   selectedQuality:
+    //     qualityOptions.find((quality) => quality.id === regionData?.best_visit_quality) ||
+    //     qualityOptions[2],
+    //   selectedNoOfVisits: regionData?.no_of_visits || 1,
+    //   id: regionId
+    // });
     // setIsEditModalVisible(true);
-    navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionId });
+    // navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionId });
+    let regionName = name[0];
+    if (name[1]) {
+      regionName = name.join(' - ');
+    }
+    navigation.navigate(NAVIGATION_PAGES.TRIPS_2025, {
+      region: { id: regionId, name: regionName }
+    });
   };
 
   const handleUpdateNmModal = (
@@ -427,14 +434,14 @@ const RegionViewScreen: FC<Props> = ({ navigation, route }) => {
           <View style={[styles.nameContainer, styles.margin]}>
             <Text style={styles.title}>{name[0]}</Text>
             <View style={ButtonStyles.btnContainer}>
-              {regionData?.visited &&
+              {/* {regionData?.visited &&
               type === 'nm' &&
               !disabled &&
               regionData?.no_of_visits === 1 ? (
                 <TouchableOpacity onPress={handleOpenEditModal} style={ButtonStyles.editBtn}>
                   <EditSvg width={14} height={14} />
                 </TouchableOpacity>
-              ) : null}
+              ) : null} */}
               {regionData.future ? (
                 <View style={{ flex: 1 }}>
                   <Text
@@ -454,25 +461,19 @@ const RegionViewScreen: FC<Props> = ({ navigation, route }) => {
                 <TouchableOpacity
                   style={[
                     ButtonStyles.btn,
-                    (regionData?.visited || regionData.future) && !disabled
+                    (regionData?.visited || regionData.edit_in_trips === 1) && !disabled
                       ? ButtonStyles.visitedButton
                       : ButtonStyles.markVisitedButton
                   ]}
                   onPress={() => {
-                    if (
-                      regionData?.type === 'nm' &&
-                      (regionData?.no_of_visits > 1 || regionData.future)
-                    ) {
+                    if (regionData?.type === 'nm' && regionData?.edit_in_trips === 1) {
                       handleOpenEditModal();
                       return;
                     }
                     type === 'nm' ? handleUpdateNm() : handleUpdateDare();
                   }}
                 >
-                  {(regionData?.visited || regionData.future) &&
-                  !disabled &&
-                  regionData?.type === 'nm' &&
-                  (regionData?.no_of_visits > 1 || regionData.future) ? (
+                  {regionData.edit_in_trips === 1 && !disabled && regionData?.type === 'nm' ? (
                     <View style={ButtonStyles.visitedContainer}>
                       <EditSvg width={14} height={14} />
                       <Text style={ButtonStyles.visitedButtonText}>Edit</Text>

+ 13 - 10
src/screens/InAppScreens/MapScreen/index.tsx

@@ -1367,17 +1367,20 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
   };
 
   const handleOpenEditModal = () => {
-    handleModalStateChange({
-      selectedFirstYear: userData?.first_visit_year,
-      selectedLastYear: userData?.last_visit_year,
-      selectedQuality:
-        qualityOptions.find((quality) => quality.id === userData?.best_visit_quality) ||
-        qualityOptions[2],
-      selectedNoOfVisits: userData?.no_of_visits || 1,
-      id: regionData?.id
-    });
+    // handleModalStateChange({
+    //   selectedFirstYear: userData?.first_visit_year,
+    //   selectedLastYear: userData?.last_visit_year,
+    //   selectedQuality:
+    //     qualityOptions.find((quality) => quality.id === userData?.best_visit_quality) ||
+    //     qualityOptions[2],
+    //   selectedNoOfVisits: userData?.no_of_visits || 1,
+    //   id: regionData?.id
+    // });
     // setIsEditModalVisible(true);
-    navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionData?.id });
+    // navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionData?.id });
+    navigation.navigate(NAVIGATION_PAGES.TRIPS_2025, {
+      region: { id: regionData.id, name: regionData.name }
+    });
   };
 
   const handleOpenEditSlowModal = () => {

+ 4 - 1
src/screens/InAppScreens/ProfileScreen/UsersMap/index.tsx

@@ -534,7 +534,10 @@ const UsersMapScreen: FC<Props> = ({ navigation, route }) => {
   };
 
   const handleOpenEditModal = () => {
-    navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionData?.id });
+    // navigation.navigate(NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: regionData?.id });
+    navigation.navigate(NAVIGATION_PAGES.TRIPS_2025, {
+      region: { id: regionData?.id, name: regionData?.name }
+    });
   };
 
   const handleOpenEditSlowModal = () => {};

+ 6 - 34
src/screens/InAppScreens/TravelsScreen/AddNewTrip2025Screen/index.tsx

@@ -108,26 +108,6 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
     const perRegionMap: Record<string, any> = {};
 
     for (const r of list) {
-      const isTransit = r.quality === 1;
-
-      if (isTransit) {
-        const key = `${r.id}_transit`;
-
-        if (!perRegionMap[key]) {
-          perRegionMap[key] = {
-            id: r.id,
-            name: r.region_name,
-            days: 0,
-            transit: true,
-            flag1: r.flag1!,
-            flag2: r.flag2 ?? null
-          };
-        }
-
-        perRegionMap[key].days += 1;
-        continue;
-      }
-
       if (!isFullDate(r.visitStartDate) || !isFullDate(r.visitEndDate)) continue;
 
       const startISO = dateValueToISO(r.visitStartDate)!;
@@ -353,11 +333,7 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
     setCalendarVisibleForIndex(index);
   };
 
-  const closeRangeCalendar = (
-    startDate?: string | null,
-    endDate?: string | null,
-    transit?: boolean
-  ) => {
+  const closeRangeCalendar = (startDate?: string | null, endDate?: string | null) => {
     const clickedInstanceIndex = calendarVisibleForIndex;
     setCalendarVisibleForIndex(null);
 
@@ -375,7 +351,7 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
 
     const updatedBeforeSort = (regions ?? []).map((r) =>
       r._instanceId === openedInstanceId
-        ? { ...r, visitStartDate: startVal, visitEndDate: endVal, quality: transit ? 1 : 3 }
+        ? { ...r, visitStartDate: startVal, visitEndDate: endVal }
         : r
     );
 
@@ -469,7 +445,7 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
       const regionsData = regions.map((region) => {
         return {
           id: region.id,
-          quality: region.quality,
+          quality: 3,
           hidden: region.hidden,
           year_from: region.visitStartDate?.year || null,
           year_to: region.visitEndDate?.year || null,
@@ -521,7 +497,7 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
       const regionsData = regions.map((region) => {
         return {
           id: region.id,
-          quality: region.quality,
+          quality: 3,
           hidden: region.hidden,
           year_from: region.visitStartDate?.year || null,
           year_to: region.visitEndDate?.year || null,
@@ -736,11 +712,8 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
       <RangeCalendar
         isModalVisible={calendarVisibleForIndex !== null}
         allowRangeSelection={true}
-        closeModal={(startDate?: string | null, endDate?: string | null, transit?: boolean) =>
-          closeRangeCalendar(startDate, endDate, transit)
-        }
-        isTransit={
-          calendarVisibleForIndex !== null && regions?.[calendarVisibleForIndex]?.quality === 1
+        closeModal={(startDate?: string | null, endDate?: string | null) =>
+          closeRangeCalendar(startDate, endDate)
         }
         initialStartDate={
           calendarVisibleForIndex !== null &&
@@ -756,7 +729,6 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
             ? `${regions[calendarVisibleForIndex].visitEndDate.year}-${regions[calendarVisibleForIndex].visitEndDate.month}-${regions[calendarVisibleForIndex].visitEndDate.day}`
             : undefined
         }
-        withTransit={true}
       />
       <WarningModal
         type={'delete'}

+ 5 - 5
src/screens/InAppScreens/TravelsScreen/Components/MyRegionsItems/NmRegionItem.tsx

@@ -102,11 +102,11 @@ export const NmRegionItem = React.memo(
 
           {token && (
             <View style={styles.btnContainer}>
-              {item.visits === 1 && !item.future ? (
+              {/* {item.visits === 1 && !item.future ? (
                 <TouchableOpacity onPress={() => openEditModal(item)} style={styles.editBtn}>
                   <EditSvg width={14} height={14} />
                 </TouchableOpacity>
-              ) : null}
+              ) : null} */}
               {item.future ? (
                 <View style={{ flex: 1 }}>
                   <Text
@@ -125,10 +125,10 @@ export const NmRegionItem = React.memo(
               <TouchableOpacity
                 style={[
                   styles.btn,
-                  item.visits > 0 || item.future ? styles.visitedButton : styles.markVisitedButton
+                  item.visits > 0 || item.edit_in_trips === 1 ? styles.visitedButton : styles.markVisitedButton
                 ]}
                 onPress={() => {
-                  if (item.visits > 1 || item.future) {
+                  if (item.edit_in_trips === 1) {
                     openEditModal(item);
                     return;
                   }
@@ -141,7 +141,7 @@ export const NmRegionItem = React.memo(
                   );
                 }}
               >
-                {item.visits > 1 || item.future ? (
+                {item.edit_in_trips === 1 ? (
                   <View style={styles.visitedContainer}>
                     <EditSvg width={14} height={14} />
                     <Text style={styles.visitedButtonText}>Edit</Text>

+ 0 - 33
src/screens/InAppScreens/TravelsScreen/Components/RegionItemNew/index.tsx

@@ -1,6 +1,5 @@
 import React, { useState } from 'react';
 import { View, Text, Image, TouchableOpacity } from 'react-native';
-import { MaterialCommunityIcons } from '@expo/vector-icons';
 
 import { RegionAddData } from '../../utils/types';
 import { Colors } from 'src/theme';
@@ -9,8 +8,6 @@ import { styles } from './styles';
 
 import TrashSvg from 'assets/icons/travels-screens/trash-solid.svg';
 import CalendarSvg from 'assets/icons/calendar.svg';
-import TransitSvg from 'assets/icons/transit.svg';
-import Tooltip from 'react-native-walkthrough-tooltip';
 
 interface RegionItemProps {
   region: RegionAddData;
@@ -42,7 +39,6 @@ const RegionItem = ({
   const [name, ...rest] = region.region_name?.split(/ – | - /);
   const subname = rest?.join(' - ');
   const [datesTooLong, setDatesTooLong] = useState(false);
-  const [toolTipVisible, setToolTipVisible] = useState<boolean>(false);
 
   return (
     <View key={region.id} style={styles.regionItem}>
@@ -106,35 +102,6 @@ const RegionItem = ({
                   : (datesLabel ?? 'Select visit dates')}
               </Text>
             </TouchableOpacity>
-            {region.quality === 1 ? (
-              <Tooltip
-                isVisible={toolTipVisible}
-                content={
-                  <Text
-                    style={{
-                      fontSize: 12,
-                      color: Colors.DARK_BLUE,
-                      fontStyle: 'italic',
-                      fontWeight: '600'
-                    }}
-                  >
-                    Transit
-                  </Text>
-                }
-                contentStyle={{ backgroundColor: Colors.WHITE }}
-                placement="top"
-                onClose={() => setToolTipVisible(false)}
-                backgroundColor="transparent"
-                allowChildInteraction={false}
-              >
-                <TouchableOpacity
-                  onPress={() => setToolTipVisible(true)}
-                  hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
-                >
-                  <TransitSvg fill={Colors.DARK_BLUE} width={24} height={24} />
-                </TouchableOpacity>
-              </Tooltip>
-            ) : null}
           </View>
 
           {errorMessage ? (

+ 4 - 16
src/screens/InAppScreens/TravelsScreen/Components/SummarySheet.tsx

@@ -4,13 +4,11 @@ import ActionSheet, { ActionSheetRef } from 'react-native-actions-sheet';
 import { API_HOST } from 'src/constants';
 import { Colors } from 'src/theme';
 import { getFontSize } from 'src/utils';
-import TransitSvg from 'assets/icons/transit.svg';
 
 type SummaryItem = {
   id: number;
   name: string;
   days: number;
-  transit: boolean;
   flag1: string;
   flag2: string | null;
 };
@@ -111,20 +109,10 @@ const SummarySheet = React.forwardRef<ActionSheetRef, Props>(
                   </Text>
                 </View>
               </View>
-              {r.transit ? (
-                <View style={{ flexDirection: 'row', alignItems: 'center', gap: 5 }}>
-                  {r.days > 1 ? (
-                    <Text style={{ fontSize: 13, fontWeight: '600', color: Colors.DARK_BLUE }}>
-                      {r.days}
-                    </Text>
-                  ) : null}
-                  <TransitSvg fill={Colors.DARK_BLUE} height={20} width={20} />
-                </View>
-              ) : (
-                <Text style={{ fontSize: 13, fontWeight: '600', color: Colors.DARK_BLUE }}>
-                  {r.days} {r.days === 1 ? 'day' : 'days'}
-                </Text>
-              )}
+
+              <Text style={{ fontSize: 13, fontWeight: '600', color: Colors.DARK_BLUE }}>
+                {r.days} {r.days === 1 ? 'day' : 'days'}
+              </Text>
             </View>
           ))}
         </ScrollView>

+ 15 - 9
src/screens/InAppScreens/TravelsScreen/EditCountryDataScreen/index.tsx

@@ -120,16 +120,22 @@ const EditCountryDataScreen = ({ route }: { route: any }) => {
   };
 
   const handleOpenEditModal = (item: NmRegion) => {
-    handleModalStateChange({
-      selectedFirstYear: item.year,
-      selectedLastYear: item.last,
-      selectedQuality:
-        qualityOptions.find((quality) => quality.id === item.quality) || qualityOptions[2],
-      selectedNoOfVisits: item.visits || 1,
-      id: item.id
-    });
+    // handleModalStateChange({
+    //   selectedFirstYear: item.year,
+    //   selectedLastYear: item.last,
+    //   selectedQuality:
+    //     qualityOptions.find((quality) => quality.id === item.quality) || qualityOptions[2],
+    //   selectedNoOfVisits: item.visits || 1,
+    //   id: item.id
+    // });
     // setIsEditModalVisible(true);
-    navigation.navigate(...([NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: item.id }] as never));
+    // navigation.navigate(...([NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: item.id }] as never));
+    navigation.navigate(
+      ...([
+        NAVIGATION_PAGES.TRIPS_2025,
+        { region: { id: item.id, name: item.region_name } }
+      ] as never)
+    );
   };
 
   useEffect(() => {

+ 16 - 21
src/screens/InAppScreens/TravelsScreen/RegionsScreen/index.tsx

@@ -16,7 +16,6 @@ import { Colors } from 'src/theme';
 import { styles } from './styles';
 import {
   useGetMegaregionsQuery,
-  useGetRegionQeQuery,
   useGetRegionsQuery,
   usePostSetTCCRegionMutation
 } from '@api/myRegions';
@@ -34,21 +33,11 @@ const RegionsScreen = () => {
   const { data: countriesList } = useGetListCountriesQuery(true);
   const [megaSelectorVisible, setMegaSelectorVisible] = useState(false);
   const [countrySelectorVisible, setCountrySelectorVisible] = useState(false);
-  // const [selectedMega, setSelectedMega] = useState<{ name: string; id: number }>({
-  //   id: 1,
-  //   name: 'SOUTHERN EUROPE'
-  // });
   const [selectedMega, setSelectedMega] = useState<{ name: string; id: number | 'all' }>({
     id: 'all',
     name: 'ALL MEGAREGIONS'
   });
   const [selectedCountry, setSelectedCountry] = useState<{ name: string; id: number } | null>(null);
-  // const { data: regionsQe } = useGetRegionQeQuery(
-  //   selectedCountry ? undefined : selectedMega.id,
-  //   selectedCountry ? selectedCountry.id : undefined,
-  //   String(token),
-  //   true
-  // );
   const { data: regionsQe } = useGetRegionsQuery(
     selectedCountry ? undefined : selectedMega.id,
     selectedCountry ? selectedCountry.id : undefined,
@@ -88,17 +77,23 @@ const RegionsScreen = () => {
   };
 
   const handleOpenEditModal = (item: NmRegion) => {
-    handleModalStateChange({
-      selectedFirstYear: item.year,
-      selectedLastYear: item.last,
-      selectedQuality:
-        qualityOptions.find((quality) => quality.id === item.quality) || qualityOptions[2],
-      selectedNoOfVisits: item.visits || 1,
-      id: item.id
-    });
-    // setIsEditModalVisible(true);
+    // handleModalStateChange({
+    //   selectedFirstYear: item.year,
+    //   selectedLastYear: item.last,
+    //   selectedQuality:
+    //     qualityOptions.find((quality) => quality.id === item.quality) || qualityOptions[2],
+    //   selectedNoOfVisits: item.visits || 1,
+    //   id: item.id
+    // });
+    // // setIsEditModalVisible(true);
+    // navigation.navigate(
+    //   ...([NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: item.id, regionsList: true }] as never)
+    // );
     navigation.navigate(
-      ...([NAVIGATION_PAGES.EDIT_NM_DATA, { regionId: item.id, regionsList: true }] as never)
+      ...([
+        NAVIGATION_PAGES.TRIPS_2025,
+        { region: { id: item.id, name: item.region_name } }
+      ] as never)
     );
   };
 

+ 40 - 10
src/screens/InAppScreens/TravelsScreen/Trips2025Screen/index.tsx

@@ -26,13 +26,16 @@ import { getFontSize } from 'src/utils';
 import { FlashList, FlashListRef } from '@shopify/flash-list';
 import WarningIcon from 'assets/icons/warning.svg';
 import moment from 'moment';
+import ChevronLeft from 'assets/icons/chevron-left.svg';
 
 const TripsScreen = ({ route }: { route: any }) => {
   const token = storage.get('token', StoreType.STRING) as string;
   const navigation = useNavigation();
   const [isDatePickerVisible, setDatePickerVisible] = useState(false);
   const { data: years, refetch } = useGetTripsYearsQuery(token, true);
-  const [selectedYear, setSelectedYear] = useState<string | null>(moment().year().toString());
+  const [selectedYear, setSelectedYear] = useState<string | null>(
+    !route.params?.region ? moment().year().toString() : null
+  );
   const [selectedRegion, setSelectedRegion] = useState<{ id: number; name: string } | null>(
     route.params?.region
       ? { id: route.params?.region?.id, name: route.params?.region?.name ?? '' }
@@ -92,6 +95,8 @@ const TripsScreen = ({ route }: { route: any }) => {
         try {
           await refetch();
           await refetchTrips();
+          await refetchTripsForRegion();
+          await refetchRegionsThatHaveTrips();
         } catch (error) {
           console.error(error);
         }
@@ -105,10 +110,14 @@ const TripsScreen = ({ route }: { route: any }) => {
   );
 
   useEffect(() => {
-    if (years && years.data && !selectedYear) {
-      setSelectedYear(years.data[0]);
+    if (route?.params?.region) {
+      navigation.getParent()?.setOptions({
+        tabBarStyle: {
+          display: 'flex'
+        }
+      });
     }
-  }, [years]);
+  }, [route]);
 
   useEffect(() => {
     if (!isWarningModalVisible) {
@@ -157,17 +166,38 @@ const TripsScreen = ({ route }: { route: any }) => {
     <PageWrapper>
       <View
         style={{
-          alignItems: 'center',
-          paddingVertical: 16,
+          display: 'flex',
           flexDirection: 'row',
-          justifyContent: 'center'
+          alignItems: 'center',
+          justifyContent: 'space-between',
+          width: '100%',
+          marginTop: '5%',
+          marginBottom: '5%'
         }}
       >
+        {route.params?.region ? (
+          <TouchableOpacity onPress={() => navigation.goBack()}>
+            <View
+              style={{
+                width: 25,
+                height: 25,
+                display: 'flex',
+                justifyContent: 'center',
+                alignItems: 'center'
+              }}
+            >
+              <ChevronLeft fill={Colors.DARK_BLUE} />
+            </View>
+          </TouchableOpacity>
+        ) : (
+          <View style={{ width: 25, height: 25 }} />
+        )}
         <Text
           style={{ color: Colors.DARK_BLUE, fontFamily: 'redhat-700', fontSize: getFontSize(14) }}
         >
           Trips
         </Text>
+        <View style={{ width: 25, height: 25 }} />
       </View>
       <View style={styles.tabContainer}>
         <TouchableOpacity style={styles.regionSelector} onPress={() => setDatePickerVisible(true)}>
@@ -181,10 +211,10 @@ const TripsScreen = ({ route }: { route: any }) => {
       </View>
 
       <TouchableOpacity
-        style={[styles.regionSelector, { flex: 0 }]}
+        style={[styles.regionSelector, { flex: 0, marginBottom: 6 }]}
         onPress={() => setIsModalVisible(true)}
       >
-        <Text style={styles.regionText}>
+        <Text style={[styles.regionText, { flex: 1 }]} numberOfLines={1}>
           {selectedRegion ? selectedRegion.name : 'All regions'}
         </Text>
         <ChevronIcon />
@@ -326,7 +356,7 @@ const TripsScreen = ({ route }: { route: any }) => {
         visible={isModalVisible}
       >
         <List
-          filteredRegions={regionsThatHaveTrips?.data}
+          filteredRegions={regionsThatHaveTrips?.data ?? []}
           itemObject={(object) => {
             setIsModalVisible(false);
             setSelectedRegion(object);

+ 1 - 0
src/screens/InAppScreens/TravelsScreen/utils/types.ts

@@ -105,6 +105,7 @@ export interface NmRegion {
   last: number;
   visits: number;
   future?: 0 | 1;
+  edit_in_trips: 0 | 1;
 }
 
 export interface TCCRegion {