From a5d22a736d374b6ec83ff24faa8a29ba2dfbabf9 Mon Sep 17 00:00:00 2001 From: Ereffe <{ID}+{username}@users.noreply.github.com> Date: Sat, 13 Jan 2024 00:52:40 +0100 Subject: [PATCH] Added input component --- src/components/CustomInput.tsx | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/components/CustomInput.tsx diff --git a/src/components/CustomInput.tsx b/src/components/CustomInput.tsx new file mode 100644 index 0000000..ed79488 --- /dev/null +++ b/src/components/CustomInput.tsx @@ -0,0 +1,55 @@ +import React, { useState } from 'react'; +import { StyleSheet, Text, TextInput, View } from 'react-native'; + +interface CustomInputProps { + label: string; + secureTextEntry?: boolean; + onSubmit: (text: string) => void; +} + +const CustomInput: React.FC = ({ + label, + secureTextEntry, + onSubmit, +}) => { + const [text, setText] = useState(''); + + const handleSubmit = () => { + onSubmit(text); + }; + + return ( + + {label} + + + ); +}; + +const styles = StyleSheet.create({ + container: { + marginBottom: 10, + }, + label: { + fontSize: 16, + marginBottom: 5, + fontFamily: '', + }, + input: { + borderWidth: 1, + borderColor: '#c7c4d6', + borderRadius: 10, + width: 300, + height: 40, + padding: 10, + fontSize: 16, + }, +}); + +export default CustomInput;