Bladeren bron

"year tab" by default, if year selected + small UI fix

Viktoriia 1 week geleden
bovenliggende
commit
d6521bd8e2

+ 9 - 0
src/screens/InAppScreens/TravelsScreen/AddNewTrip2025Screen/index.tsx

@@ -110,6 +110,15 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
       return { defaultMode: 'approx', initialApproxYear: start?.year ?? null };
     }
 
+    if (!start?.year) {
+      const otherWithYear = regions?.find(
+        (r, i) => i !== index && r.visitStartDate?.year && !r.visitStartDate?.month
+      );
+      if (otherWithYear) {
+        return { defaultMode: 'approx', initialApproxYear: null };
+      }
+    }
+
     return { defaultMode: 'exact', initialApproxYear: null };
   };
 

+ 7 - 6
src/screens/InAppScreens/TravelsScreen/EventsScreen/index.tsx

@@ -39,7 +39,7 @@ import { renderSpotsText } from './utils';
 import ChevronIcon from 'assets/icons/chevron-left.svg';
 import Tooltip from 'react-native-walkthrough-tooltip';
 import InfoIcon from 'assets/icons/info-solid.svg';
-import { SafeAreaView } from 'react-native-safe-area-context';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
 import TabViewWrapper from 'src/components/TabViewWrapper';
 import { getFontSize } from 'src/utils';
 
@@ -63,6 +63,7 @@ function TabViewDelayed({
 }
 
 const EventsScreen = () => {
+  const insets = useSafeAreaInsets();
   const token = (storage.get('token', StoreType.STRING) as string) ?? null;
   const { data, refetch } = useGetEventsListQuery(token, 0, true);
   const { data: pastData } = useGetEventsListQuery(token, 1, true);
@@ -557,14 +558,14 @@ const EventsScreen = () => {
   );
 
   return (
-    <SafeAreaView style={{ height: '100%' }} edges={['top']}>
+    <View style={{ height: '100%', paddingTop: insets.top }}>
       <View style={{ marginLeft: '5%', marginRight: '5%' }}>
         <View
           style={{
             alignItems: 'center',
-            paddingVertical: 16,
             flexDirection: 'row',
-            justifyContent: 'space-between'
+            justifyContent: 'space-between',
+            paddingVertical: 16
           }}
         >
           <View style={{ width: 30 }} />
@@ -582,7 +583,7 @@ const EventsScreen = () => {
             >
               <CalendarPlusIcon fill={Colors.DARK_BLUE} />
             </TouchableOpacity>
-          ) : null}
+          ) : <View style={{ width: 30 }} />}
         </View>
 
         <Animated.View style={[styles.searchContainer, searchContainerAnimatedStyle]}>
@@ -643,7 +644,7 @@ const EventsScreen = () => {
           </View>
         </TouchableOpacity>
       </Modal>
-    </SafeAreaView>
+    </View>
   );
 };
 

+ 5 - 4
src/screens/InAppScreens/TravelsScreen/Trips2025Screen/index.tsx

@@ -3,6 +3,7 @@ import { View, Text, TouchableOpacity, FlatList } from 'react-native';
 import { useFocusEffect, useNavigation } from '@react-navigation/native';
 
 import { PageWrapper, Header, Modal, FlatList as List, WarningModal } from 'src/components';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
 import TripItem from '../Components/TripItem';
 
 import {
@@ -29,6 +30,7 @@ import moment from 'moment';
 import ChevronLeft from 'assets/icons/chevron-left.svg';
 
 const TripsScreen = ({ route }: { route: any }) => {
+  const insets = useSafeAreaInsets();
   const token = storage.get('token', StoreType.STRING) as string;
   const navigation = useNavigation();
   const [isDatePickerVisible, setDatePickerVisible] = useState(false);
@@ -175,7 +177,7 @@ const TripsScreen = ({ route }: { route: any }) => {
   };
 
   return (
-    <PageWrapper>
+    <View style={{ paddingTop: insets.top, marginLeft: '5%', marginRight: '5%', height: '100%' }}>
       <View
         style={{
           display: 'flex',
@@ -183,8 +185,7 @@ const TripsScreen = ({ route }: { route: any }) => {
           alignItems: 'center',
           justifyContent: 'space-between',
           width: '100%',
-          marginTop: '5%',
-          marginBottom: '5%'
+          paddingVertical: 16
         }}
       >
         {route.params?.region ? (
@@ -376,7 +377,7 @@ const TripsScreen = ({ route }: { route: any }) => {
           }}
         />
       </Modal>
-    </PageWrapper>
+    </View>
   );
 };