From 208bfd80510d0d6e2d1bc7af7dfb4b041d7bbc64 Mon Sep 17 00:00:00 2001 From: G Date: Mon, 1 Jul 2024 12:31:35 +0000 Subject: [PATCH] rename the Input component to InputWithTopLabel --- src/components/Input.tsx | 24 ------------------------ src/components/InputWithTopLabel.tsx | 24 ++++++++++++++++++++++++ src/screens/NumberAndOtpForPaymentScreen.tsx | 10 +++++++--- src/screens/PaymentAmountInputScreen.tsx | 4 ++-- src/screens/UserLoginScreen.tsx | 6 +++--- 5 files changed, 36 insertions(+), 32 deletions(-) delete mode 100644 src/components/Input.tsx create mode 100644 src/components/InputWithTopLabel.tsx diff --git a/src/components/Input.tsx b/src/components/Input.tsx deleted file mode 100644 index f405315..0000000 --- a/src/components/Input.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { VariantProps } from "@shopify/restyle"; -import type { Theme } from "@themes/Theme"; -import { TextInput } from "react-native"; -import type { TextInputProps } from "react-native"; -import Box from "./bases/Box"; -import Text from "./bases/Text"; - -type Props = TextInputProps & - VariantProps & { - label: string; - }; - -const Input = ({ label, textVariants, ...rest }: Props) => { - return ( - - {label} - - - - - ); -}; - -export default Input; diff --git a/src/components/InputWithTopLabel.tsx b/src/components/InputWithTopLabel.tsx new file mode 100644 index 0000000..25ca24e --- /dev/null +++ b/src/components/InputWithTopLabel.tsx @@ -0,0 +1,24 @@ +import type { VariantProps } from "@shopify/restyle"; +import type { Theme } from "@themes/Theme"; +import type { TextInputProps } from "react-native"; +import { TextInput } from "react-native"; +import Box from "./bases/Box"; +import Text from "./bases/Text"; + +type Props = TextInputProps & + VariantProps & { + label: string; + }; + +const InputWithTopLabel = ({ label, textVariants, ...rest }: Props) => { + return ( + + {label} + + + + + ); +}; + +export default InputWithTopLabel; diff --git a/src/screens/NumberAndOtpForPaymentScreen.tsx b/src/screens/NumberAndOtpForPaymentScreen.tsx index 70695e4..69a2121 100644 --- a/src/screens/NumberAndOtpForPaymentScreen.tsx +++ b/src/screens/NumberAndOtpForPaymentScreen.tsx @@ -2,7 +2,7 @@ import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; import BeasyLogoIcon from "@components/BeasyLogoIcon"; import Button from "@components/Button"; import GoBackIconButton from "@components/GoBackIconButton"; -import Input from "@components/Input"; +import InputWithTopLabel from "@components/InputWithTopLabel"; import PaymentOption from "@components/PaymentOption"; import BackgroundGreenWhiteContentArea from "@components/backgrounds/BackgroundGreenWhiteContentArea"; import Box from "@components/bases/Box"; @@ -40,12 +40,16 @@ const NumberAndOtpForPaymentScreen: PaymentStackScreenComponentProps< {}} paymentMethod={"OM"} /> - - +