diff --git a/client/app/components/settings/TextInputs.tsx b/client/app/components/settings/TextInputs.tsx new file mode 100644 index 000000000..62d43c85e --- /dev/null +++ b/client/app/components/settings/TextInputs.tsx @@ -0,0 +1,171 @@ +import React, {useState} from "react"; +import { + Button, + Modal, + SafeAreaView, + Text, + TextInput, + View, + StyleSheet, + Pressable, + TouchableWithoutFeedback +} from "react-native"; + +type GenericTextInputProps = { + defaultValue: string; + isVisible: boolean; + visibleSetter: Function; + outputSetter: Function; + headerText: string; + errorMessage: string; + maxLength: number; + inputValidator: Function; + +} + +const GenericTextInput = ({ + defaultValue, + isVisible, + visibleSetter, + outputSetter, + headerText, + errorMessage, + maxLength, + inputValidator, +}: GenericTextInputProps) => { + const[textInput, setTextInput] = useState(''); + const[error, setError] = useState(''); + + return( + { + visibleSetter(false); + setError(''); + }} + > + { + visibleSetter(false); + setError(''); + }}> + + + + {headerText} + {error} + {setTextInput(text); setError('');}} + /> + +