Commit 4d3f4d36 by G

Test :: fetch the payments types on screen opening

parent afa4c7a5
import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; import type { PaymentStackScreenComponentProps } from "@/navigations/Types";
import getPaymentTypes from "@/utils/requests/getPaymentTypes";
import BalanceContainer from "@components/BalanceContainer"; import BalanceContainer from "@components/BalanceContainer";
import BeasyLogoIcon from "@components/BeasyLogoIcon"; import BeasyLogoIcon from "@components/BeasyLogoIcon";
import NotificationIconButton from "@components/NotificationIconButton"; import NotificationIconButton from "@components/NotificationIconButton";
...@@ -6,11 +7,21 @@ import PaymentOption from "@components/PaymentOption"; ...@@ -6,11 +7,21 @@ import PaymentOption from "@components/PaymentOption";
import BackgroundGreenWhiteContentArea from "@components/backgrounds/BackgroundGreenWhiteContentArea"; import BackgroundGreenWhiteContentArea from "@components/backgrounds/BackgroundGreenWhiteContentArea";
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 { useQuery } from "@tanstack/react-query";
import { Dimensions } from "react-native"; import { Dimensions } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context"; import { SafeAreaView } from "react-native-safe-area-context";
const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWithPaymentOptions"> = const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWithPaymentOptions"> =
({ navigation }) => { ({ 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 ( return (
<BackgroundGreenWhiteContentArea> <BackgroundGreenWhiteContentArea>
<SafeAreaView> <SafeAreaView>
......
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