Commit 21151e97 by G

handling loading state and request done with results

parent 1378854e
......@@ -59,16 +59,25 @@ const HomePageWithPaymentOptions: PaymentStackScreenComponentProps<"homePageWith
flexWrap={"wrap"}
rowGap={"m"}
>
{paymentTypesWithActiveStatus.map((paymentType) => (
<PaymentOptionContainer key={paymentType.id}>
<PaymentOption
onPress={() =>
navigation.navigate("paymentAmountInputScreen")
}
paymentMethod={paymentType.code}
/>
</PaymentOptionContainer>
))}
{isLoading && (
<Box flex={1}>
<Text textAlign={"center"}>
Chargement des méthodes de paiement...
</Text>
</Box>
)}
{!isLoading &&
!error &&
paymentTypesWithActiveStatus.map((paymentType) => (
<PaymentOptionContainer key={paymentType.id}>
<PaymentOption
onPress={() =>
navigation.navigate("paymentAmountInputScreen")
}
paymentMethod={paymentType.code}
/>
</PaymentOptionContainer>
))}
</Box>
</Box>
</Box>
......
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