You need to sign in or sign up before continuing.
Commit de216ba5 by G

remove onPress event, for CloseModal, it is self handled

parent 9a05e902
import { useModalsManagerContext } from "@/contexts/ModalsManagerContext";
import Button from "@components/Button";
import Box from "@components/bases/Box";
import ErrorIcon from "@components/icons/ErrorIcon";
......@@ -5,10 +6,11 @@ import { Text } from "react-native";
interface Props {
message?: string;
onPress?: () => void;
// onPress?: () => void;
}
const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {} }: Props) => {
const ErrorModal = ({ message = "Une erreur s'est produite" }: Props) => {
const { closeModal } = useModalsManagerContext();
return (
<Box
width={300}
......@@ -34,7 +36,7 @@ const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {}
variant={"fullError"}
textVariants={"white"}
label="Fermer"
onPress={onPress}
onPress={closeModal}
/>
</Box>
</Box>
......
......@@ -85,16 +85,9 @@ const useOrangeMoney = () => {
if (error instanceof Error) {
if (error.name === "ORANGE_PAYMENT_IN_PROGRESS") {
log.warn("handlePaymentButton | ORANGE_PAYMENT_IN_PROGRESS");
showModal(
<ErrorModal
message="Le payment est toujours en cours."
onPress={async () =>
await openBrowserThenCheckStatus(paymentUrl, orderId)
}
/>,
);
showModal(<ErrorModal message="Le payment est toujours en cours." />);
} else if (error.name === "ORANGE_PAYMENT_FAILED") {
showModal(<ErrorModal message="Le paiment à échoué." onPress={closeModal} />);
showModal(<ErrorModal message="Le paiment à échoué." />);
log.error("handlePaymentButton | ORANGE_PAYMENT_FAILED");
}
} else {
......
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