forked from react-native-elements/react-native-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms_home.js
More file actions
206 lines (202 loc) · 5.78 KB
/
forms_home.js
File metadata and controls
206 lines (202 loc) · 5.78 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import React, { Component } from 'react';
import { ScrollView, View, StyleSheet, Platform } from 'react-native';
import colors from 'HSColors';
import Icon from 'react-native-vector-icons/MaterialIcons';
import {
Button,
Text,
FormInput,
FormLabel,
CheckBox,
SearchBar,
} from 'react-native-elements';
class Forms extends Component {
renderFormsSearchBars() {
if (Platform.OS === 'ios') {
return (
<View>
<FormLabel containerStyle={styles.labelContainerStyle}>
Name
</FormLabel>
<FormInput
ref="form2"
containerRef="containerRefYOYO"
textInputRef="textInputRef"
placeholder="Please enter your name..."
/>
<FormLabel
textInputRef="textInputRef"
containerStyle={styles.labelContainerStyle}
>
Address
</FormLabel>
<FormInput
textInputRef="textInputRef"
ref="form1"
placeholder="Please enter your address..."
/>
<FormLabel
textInputRef="textInputRef"
containerStyle={styles.labelContainerStyle}
>
Phone
</FormLabel>
<FormInput
textInputRef="textInputRef"
placeholder="Please enter your phone number..."
/>
<Button
onPress={() => console.log('yo')}
icon={{ name: 'done' }}
buttonStyle={{ marginTop: 15 }}
title="SUBMIT"
/>
<View style={{ marginTop: 10, marginBottom: 0, flexDirection: 'row', alignItems: 'flex-start'}}>
<FormInput
containerStyle={{ flex: 1, borderBottomColor: 'red' }}
inputStyle={{ color: 'red' }}
ref={ref => this.shakeInputRef = ref}
value={'An invalid input'}
/>
<Button
onPress={() => this.shakeInputRef.shake()}
title="SHAKE"
/>
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar
lightTheme
clearIcon
textInputRef="textInputRef"
placeholder="Type Here..."
/>
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar
noIcon
lightTheme
textInputRef="textInputRef"
placeholder="Type Here..."
/>
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar
round
lightTheme
clearIcon
textInputRef="searchBar3"
placeholder="Type Here..."
/>
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar textInputRef="textInputRef" placeholder="Type Here..." />
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar
noIcon
clearIcon
textInputRef="textInputRef"
placeholder="Type Here..."
/>
</View>
<View style={{ marginTop: 10, marginBottom: 0 }}>
<SearchBar
round
textInputRef="textInputRef"
placeholder="Type Here..."
/>
</View>
</View>
);
}
}
render() {
return (
<ScrollView
style={{ backgroundColor: 'white' }}
keyboardShouldPersistTaps="always"
>
<View style={styles.headingContainer}>
<Icon color="white" name="pets" size={62} />
<Text style={styles.heading}>Forms</Text>
</View>
{this.renderFormsSearchBars()}
<View style={{ marginTop: 20 }}>
<CheckBox title="Click Here" checked />
<CheckBox center title="Click Here" checked />
<CheckBox title="Click Here" checked right />
<CheckBox
right
title="Click Here"
checkedIcon="dot-circle-o"
uncheckedIcon="circle-o"
/>
<CheckBox
center
checkedIcon="dot-circle-o"
uncheckedIcon="circle-o"
title="Click Here"
checked
checkedColor="#4a6da7"
/>
<CheckBox center iconRight title="Click Here" />
<CheckBox
center
iconRight
uncheckedIcon="add"
checkedIcon="clear"
iconType="material"
title="Click Here to Add This Item"
/>
<CheckBox
center
checked
iconType="material"
checkedIcon="clear"
uncheckedIcon="add"
iconRight
title="Click Here to Remove This Item"
checkedColor="red"
/>
<CheckBox center title="Add Phone" uncheckedIcon="plus" />
<CheckBox
checked
center
checkedTitle="You Clicked!"
title="Click Here"
iconType="material"
checkedIcon="done"
checkedColor="blue"
uncheckedColor="red"
/>
<CheckBox
center
iconType="material"
title="Click Here"
checkedIcon="accessibility"
uncheckedIcon="check-box-outline-blank"
checkedColor="blue"
uncheckedColor="black"
/>
</View>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
headingContainer: {
justifyContent: 'center',
alignItems: 'center',
padding: 40,
backgroundColor: colors.secondary2,
},
heading: {
color: 'white',
marginTop: 10,
fontSize: 22,
},
labelContainerStyle: {
marginTop: 8,
},
});
export default Forms;