From 21151e970035d67f5fb7c2ead79d72537cc0ca11 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 8 May 2024 15:02:37 +0000 Subject: [PATCH] handling loading state and request done with results --- src/screens/HomePageWithPaymentOptions.tsx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/screens/HomePageWithPaymentOptions.tsx b/src/screens/HomePageWithPaymentOptions.tsx index 6236b07..e1ce0d9 100644 --- a/src/screens/HomePageWithPaymentOptions.tsx +++ b/src/screens/HomePageWithPaymentOptions.tsx @@ -59,16 +59,25 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith flexWrap={"wrap"} rowGap={"m"} > - {paymentTypesWithActiveStatus.map((paymentType) => ( - - - navigation.navigate("paymentAmountInputScreen") - } - paymentMethod={paymentType.code} - /> - - ))} + {isLoading && ( + + + Chargement des méthodes de paiement... + + + )} + {!isLoading && + !error && + paymentTypesWithActiveStatus.map((paymentType) => ( + + + navigation.navigate("paymentAmountInputScreen") + } + paymentMethod={paymentType.code} + /> + + ))} -- libgit2 0.27.1