-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInput.js
44 lines (40 loc) · 1.08 KB
/
Input.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import { TextInput, Text, View } from 'react-native';
const Input = ({ label, value, onChangeText, placeholder, secureTextEntry }) => {
const { inputStyle, labelStyle, containerStyle } = styles;
return (
<View style={containerStyle}>
<Text style={labelStyle}>{label}</Text>
<TextInput
secureTextEntry={secureTextEntry}
placeholder={placeholder}
autoCorrect={false}
value={value}
onChangeText={onChangeText}
style={inputStyle}
/>
</View>
);
};
const styles = {
inputStyle: {
color: '#000',
paddingRight: 5,
fontSize: 18,
paddingLeft: 5,
lineHeight: 23,
flex: 2,
},
labelStyle: {
fontSize: 18,
paddingLeft: 20,
flex: 1
},
containerStyle: {
height: 40,
flexDirection: 'row',
flex: 1,
alignItems: 'center'
},
};
export default Input;