From 4d3f4d3622502eb209600a04f5c19d42613a1eef Mon Sep 17 00:00:00 2001 From: G Date: Wed, 8 May 2024 10:08:37 +0000 Subject: [PATCH] Test :: fetch the payments types on screen opening --- src/screens/HomePageWithPaymentOptions.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/screens/HomePageWithPaymentOptions.tsx b/src/screens/HomePageWithPaymentOptions.tsx index 1e74825..86478d7 100644 --- a/src/screens/HomePageWithPaymentOptions.tsx +++ b/src/screens/HomePageWithPaymentOptions.tsx @@ -1,4 +1,5 @@ import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; +import getPaymentTypes from "@/utils/requests/getPaymentTypes"; import BalanceContainer from "@components/BalanceContainer"; import BeasyLogoIcon from "@components/BeasyLogoIcon"; import NotificationIconButton from "@components/NotificationIconButton"; @@ -6,11 +7,21 @@ import PaymentOption from "@components/PaymentOption"; import BackgroundGreenWhiteContentArea from "@components/backgrounds/BackgroundGreenWhiteContentArea"; import Box from "@components/bases/Box"; import Text from "@components/bases/Text"; +import { useQuery } from "@tanstack/react-query"; import { Dimensions } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWithPaymentOptions"> = ({ navigation }) => { + const { data, isLoading, error } = useQuery({ + queryKey: ["paymentTypes"], + queryFn: getPaymentTypes, + enabled: true, + }); + + console.log("data", data); + console.log("isLoading", isLoading); + console.log("error", error); return ( -- libgit2 0.27.1