This repository was archived by the owner on Dec 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDocForm.js
More file actions
86 lines (76 loc) · 1.45 KB
/
DocForm.js
File metadata and controls
86 lines (76 loc) · 1.45 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React, { Component } from 'react';
import {
View,
TextInput,
Text,
StyleSheet
} from 'react-native';
class DocForm extends Component {
constructor(props) {
super(props);
this.state = {
doc: ''
};
}
_onDocSubmit(rowData, rowId) {
this.props.onDocSubmit(this.state.doc);
this.setState({
doc: ''
})
}
render() {
return (
<View style={styles.container}>
<View style={styles.inputContainer}>
<TextInput
style={styles.text}
onChangeText={(doc) => this.setState({doc})}
value={this.state.doc}
/>
</View>
<Text
onPress={this._onDocSubmit.bind(this)}
style={styles.btn}
>Add item
</Text>
</View>
)
}
}
const styles = StyleSheet.create({
//Main container - add text box
container: {
flex: 1,
flexDirection: 'row',
},
//inputContainer
inputContainer: {
flex: 0.5,
borderWidth: 1,
borderColor: '#D4D4D4',
backgroundColor: 'white',
height: 35,
marginBottom: 10,
marginRight: 10,
borderRadius: 2,
},
//Text input
text: {
height: 30,
marginBottom: 10,
paddingLeft: 10,
paddingTop: 5,
},
//Button
btn: {
paddingLeft: 10,
paddingRight: 10,
paddingTop: 8,
height: 34,
textAlign: 'center',
color: 'white',
backgroundColor: '#3068C6',
borderRadius: 2,
}
});
export default DocForm;