Преглед изворни кода

Update component/reservationLocationPage/reservationLocationPage.tsx

Co-authored-by: MGTKenYCS <108712278+MGTKenYCS@users.noreply.github.com>
Ian Fung пре 1 година
родитељ
комит
a071aed657
1 измењених фајлова са 9 додато и 1 уклоњено
  1. 9 1
      component/reservationLocationPage/reservationLocationPage.tsx

+ 9 - 1
component/reservationLocationPage/reservationLocationPage.tsx

@@ -276,7 +276,15 @@ const ReservationLocationPage = () => {
                         <View className="pt-6 ">
                             {/* For now, clicking the X button goes back to login page. */}
                             {/* Once home page component is created, i will change it */}
-                            <Pressable onPress={() => router.push('/')}>
+                            <Pressable
+                                onPress={() => {
+                                    if (router.canGoBack()) {
+                                        router.back();
+                                    } else {
+                                        router.replace('/');
+                                    }
+                                }}
+                            >
                                 <CrossLogoSvg />
                             </Pressable>
                         </View>