From c84d94d290e20a54826786ee2d722c139f0bc4b9 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 8 May 2024 16:17:50 +0000 Subject: [PATCH] - remove safeAreaView that caused a wrong offset on the bottom side of the screen - manually rounding the white container around the input amount - remove the balance container container - add 'montant à payé' label and its amount right below it. - continuously update the total in the header part when changed --- src/screens/PaymentAmountInputScreen.tsx | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ 1 file changed, 67 insertions(+), 36 deletions(-) diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index 28fb94b..9155aec 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -1,60 +1,91 @@ import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; -import BalanceContainer from "@components/BalanceContainer"; import BeasyLogoIcon from "@components/BeasyLogoIcon"; import Button from "@components/Button"; import GoBackIconButton from "@components/GoBackIconButton"; import Input from "@components/Input"; import PaymentOption from "@components/PaymentOption"; -import BackgroundGreenWhiteContentArea from "@components/backgrounds/BackgroundGreenWhiteContentArea"; +import BackgroundDefault from "@components/backgrounds/BackgroundDefault"; import Box from "@components/bases/Box"; -import { SafeAreaView } from "react-native-safe-area-context"; +import Text from "@components/bases/Text"; +import { useState } from "react"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountInputScreen"> = ({ route, navigation, }) => { const { paymentType } = route.params; + const [amountToPay, setAmountToPay] = useState(0); - console.log("Payment type :: {}", paymentType); + const insets = useSafeAreaInsets(); + + const updateAmountToPay = (amount: string) => { + const amountParsed = Number.parseInt(amount); + if (!Number.isNaN(amountParsed)) { + return setAmountToPay(amountParsed); + } + + return setAmountToPay(0); + }; return ( - - - - - - navigation.goBack()} /> - - + + {/* */} + + + + navigation.goBack()} /> + + {/* + */} + + Montant à payé + + {amountToPay} + + + + + {}} paymentMethod={paymentType} /> - - - {}} paymentMethod={paymentType} /> - - - - -