import React from 'react';
import { View, Text, TextInput, StyleSheet } from 'react-native';
const CustomInput = ({ label, placeholder, value, onChangeText, ...otherProps }) => (
<View style={styles.container}>
{label && <Text style={styles.label}>{label}</Text>}
<TextInput
style={styles.input}
placeholder={placeholder}
value={value}
onChangeText={onChangeText}
{...otherProps}
/>
</View>
);
const styles = StyleSheet.create({
container: {
width: '100%',
marginBottom: 15,
},
label: {
fontSize: 14,
marginBottom: 5,
},
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
borderRadius: 5,
paddingLeft: 10,
paddingRight: 10,
},
});
export default CustomInput;
import { View, Text, TextInput, StyleSheet } from 'react-native';
const CustomInput = ({ label, placeholder, value, onChangeText, ...otherProps }) => (
<View style={styles.container}>
{label && <Text style={styles.label}>{label}</Text>}
<TextInput
style={styles.input}
placeholder={placeholder}
value={value}
onChangeText={onChangeText}
{...otherProps}
/>
</View>
);
const styles = StyleSheet.create({
container: {
width: '100%',
marginBottom: 15,
},
label: {
fontSize: 14,
marginBottom: 5,
},
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
borderRadius: 5,
paddingLeft: 10,
paddingRight: 10,
},
});
export default CustomInput;