From d8d7c62b46284db88c1aeb9c2f0ae458f1d28b53 Mon Sep 17 00:00:00 2001 From: G Date: Tue, 28 May 2024 17:04:15 +0000 Subject: [PATCH] make request to get the list of transactions and render it in a scroll view --- src/screens/TransactionHistoryScreen.tsx | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/screens/TransactionHistoryScreen.tsx b/src/screens/TransactionHistoryScreen.tsx index 9a435f1..d85f320 100644 --- a/src/screens/TransactionHistoryScreen.tsx +++ b/src/screens/TransactionHistoryScreen.tsx @@ -1,13 +1,43 @@ +import { getTransactionsHistory } from "@/utils/requests/transactions"; +import TransactionInformationsItem from "@components/TransactionInformationsItem"; import BackgroundWithBeasyIconAndWhiteContentArea from "@components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea"; -import Text from "@components/bases/Text"; +import Box from "@components/bases/Box"; import { LOG } from "@logger"; +import { useQuery } from "@tanstack/react-query"; +import { ScrollView } from "react-native"; const log = LOG.extend("TransactionHistoryScreen"); const TransactionHistoryScreen = () => { + log.verbose("TransactionHistoryScreen"); + + const { data, isLoading, error } = useQuery({ + queryKey: ["transactionsHistory"], + queryFn: getTransactionsHistory, + }); + + console.info("Data", data); + return ( - Hello + + {data?.map((transaction) => ( + // {transaction.reference} + + + + ))} + ); }; -- libgit2 0.27.1