From 189a2b57722561726fa74ee8a2537886b2d991ac Mon Sep 17 00:00:00 2001 From: G Date: Wed, 8 May 2024 12:06:37 +0000 Subject: [PATCH] change PaymentOptions type to match the returned ones from api --- src/components/PaymentOption.tsx | 30 +++++++++++------------------- src/screens/HomePageWithPaymentOptions.tsx | 10 +++++----- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/components/PaymentOption.tsx b/src/components/PaymentOption.tsx index f13016c..daf325d 100644 --- a/src/components/PaymentOption.tsx +++ b/src/components/PaymentOption.tsx @@ -2,15 +2,7 @@ import { images } from "@styles/Commons"; import { Image, TouchableOpacity } from "react-native"; import Box from "./bases/Box"; -export enum PaymentMethods { - OrangeMoney = 1, - MtnMoney = 2, - MoobMoney = 3, - WaveMoney = 4, - VisaCard = 5, -} - -type PaymentOptions = "OrangeMoney" | "MtnMoney" | "MoovMoney" | "WaveMoney" | "VisaCard"; +type PaymentOptions = "ORANGE" | "MTN" | "FLOOZ" | "WAVE" | "CB"; type Props = { onPress: () => void; @@ -32,7 +24,7 @@ const PaymentOptionContainer = ({ children }: { children: React.ReactNode }) => ); }; -const OrangeMoney = () => { +const Orange = () => { return ( { ); }; -const MtnMoney = () => { +const Mtn = () => { return ( @@ -51,7 +43,7 @@ const MtnMoney = () => { ); }; -const MoovMoney = () => { +const Flooz = () => { return ( @@ -59,7 +51,7 @@ const MoovMoney = () => { ); }; -const WaveMoney = () => { +const Wave = () => { return ( @@ -67,7 +59,7 @@ const WaveMoney = () => { ); }; -const VisaCard = () => { +const Cb = () => { return ( @@ -78,11 +70,11 @@ const VisaCard = () => { const PaymentOption = ({ onPress, paymentMethod }: Props) => { return ( - {paymentMethod === "OrangeMoney" && } - {paymentMethod === "MtnMoney" && } - {paymentMethod === "MoovMoney" && } - {paymentMethod === "WaveMoney" && } - {paymentMethod === "VisaCard" && } + {paymentMethod === "ORANGE" && } + {paymentMethod === "MTN" && } + {paymentMethod === "FLOOZ" && } + {paymentMethod === "WAVE" && } + {paymentMethod === "CB" && } ); }; diff --git a/src/screens/HomePageWithPaymentOptions.tsx b/src/screens/HomePageWithPaymentOptions.tsx index 9db248d..92c9f27 100644 --- a/src/screens/HomePageWithPaymentOptions.tsx +++ b/src/screens/HomePageWithPaymentOptions.tsx @@ -66,7 +66,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith onPress={() => navigation.navigate("paymentAmountInputScreen") } - paymentMethod={"OrangeMoney"} + paymentMethod={"ORANGE"} /> @@ -74,7 +74,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith onPress={() => navigation.navigate("paymentAmountInputScreen") } - paymentMethod={"MtnMoney"} + paymentMethod={"MTN"} /> @@ -82,7 +82,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith onPress={() => navigation.navigate("paymentAmountInputScreen") } - paymentMethod={"MoovMoney"} + paymentMethod={"FLOOZ"} /> @@ -91,7 +91,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith onPress={() => navigation.navigate("paymentAmountInputScreen") } - paymentMethod={"WaveMoney"} + paymentMethod={"WAVE"} /> @@ -100,7 +100,7 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith onPress={() => navigation.navigate("paymentAmountInputScreen") } - paymentMethod={"VisaCard"} + paymentMethod={"CB"} /> -- libgit2 0.27.1