Created
May 16, 2020 09:45
-
-
Save Karthik-B-06/cfb96006dcc95fb34b01884d0fcea3d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { View, Text, StyleSheet, TextInput } from 'react-native'; | |
| const FormField = (props) => { | |
| return ( | |
| <View style={styles.formFieldWrapper}> | |
| <Text style={styles.labelText}>{props.label}</Text> | |
| <TextInput | |
| placeholder={props.placeholder} | |
| style={styles.formFieldText} | |
| onChange={(event) => props.handleFormValueChange(props.formKey, event.nativeEvent.text)} | |
| {...props.textInputProps} | |
| /> | |
| </View> | |
| ) | |
| } | |
| const styles = StyleSheet.create({ | |
| formFieldWrapper: { | |
| }, | |
| formFieldText: { | |
| fontSize: 20, | |
| borderRadius: 15, | |
| borderWidth: 1, | |
| padding: 12 | |
| }, | |
| labelText: { | |
| fontSize: 20, | |
| marginBottom: 12, | |
| paddingLeft: 10, | |
| paddingTop: 10 | |
| } | |
| }) | |
| export default FormField; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment