Commit 8dc74377 by G

update type and handling of goBack icon. Upon click go to the root of the…

update type and handling of goBack icon. Upon click go to the root of the bottomTabs 'screen with payment options' while resetting the history.
parent 6869818a
import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; import type { MainStackScreenComponentProps } from "@/navigations/Types";
import BeasyLogoIcon from "@components/BeasyLogoIcon"; import BeasyLogoIcon from "@components/BeasyLogoIcon";
import Button from "@components/Button"; import Button from "@components/Button";
import GoBackIconButton from "@components/GoBackIconButton"; import GoBackIconButton from "@components/GoBackIconButton";
...@@ -6,12 +6,13 @@ import BackgroundDefault from "@components/backgrounds/BackgroundDefault"; ...@@ -6,12 +6,13 @@ import BackgroundDefault from "@components/backgrounds/BackgroundDefault";
import Box from "@components/bases/Box"; import Box from "@components/bases/Box";
import Text from "@components/bases/Text"; import Text from "@components/bases/Text";
import { LOG } from "@logger"; import { LOG } from "@logger";
import { CommonActions } from "@react-navigation/native";
// import { Text } from "react-native"; // import { Text } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context"; import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
const log = LOG.extend("PaymentResultScreen"); const log = LOG.extend("PaymentResultScreen");
const PaymentResultScreen: PaymentStackScreenComponentProps<"paymentResultScreen"> = ({ const PaymentResultScreen: MainStackScreenComponentProps<"paymentResultScreen"> = ({
route, route,
navigation, navigation,
}) => { }) => {
...@@ -35,7 +36,16 @@ const PaymentResultScreen: PaymentStackScreenComponentProps<"paymentResultScreen ...@@ -35,7 +36,16 @@ const PaymentResultScreen: PaymentStackScreenComponentProps<"paymentResultScreen
mb={"m"} mb={"m"}
> >
<BeasyLogoIcon /> <BeasyLogoIcon />
<GoBackIconButton onPress={() => navigation.goBack()} /> <GoBackIconButton
onPress={() => {
navigation.dispatch(
CommonActions.reset({
index: 1,
routes: [{ name: "appBottomTabsNavigator" }],
}),
);
}}
/>
</Box> </Box>
<Box <Box
flex={1} flex={1}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment