1
1
import _ from 'lodash' ;
2
2
import React , { Component } from 'react' ;
3
3
import { ScrollView , Image } from 'react-native' ;
4
- import { View , Colors , Dialog , Text , Stepper , Typography , Picker , Avatar , Assets , TagsInput , PanningProvider } from 'react-native-ui-lib' ; //eslint-disable-line
4
+ import {
5
+ View ,
6
+ Colors ,
7
+ Dialog ,
8
+ Text ,
9
+ Picker ,
10
+ Avatar ,
11
+ Assets ,
12
+ PanningProvider
13
+ } from 'react-native-ui-lib' ; //eslint-disable-line
5
14
import contacts from '../../data/conversations' ;
6
15
import tagIcon from '../../assets/icons/tags.png' ;
7
16
import dropdown from '../../assets/icons/chevronDown.png' ;
@@ -11,13 +20,13 @@ const options = [
11
20
{ label : 'Java' , value : 'java' } ,
12
21
{ label : 'Python' , value : 'python' } ,
13
22
{ label : 'C++' , value : 'c++' , disabled : true } ,
14
- { label : 'Perl' , value : 'perl' } ,
23
+ { label : 'Perl' , value : 'perl' }
15
24
] ;
16
25
const filters = [
17
26
{ label : 'All' , value : 0 } ,
18
27
{ label : 'Draft' , value : 1 } ,
19
28
{ label : 'Published' , value : 2 } ,
20
- { label : 'Scheduled' , value : 3 } ,
29
+ { label : 'Scheduled' , value : 3 }
21
30
] ;
22
31
23
32
export default class PickerScreen extends Component {
@@ -35,7 +44,7 @@ export default class PickerScreen extends Component {
35
44
contact : contacts [ 0 ] ,
36
45
tags : [ { label : 'Amit' } , { label : 'Ethan' } ] ,
37
46
tags2 : [ 'Tags' , 'Input' ] ,
38
- tags3 : [ 'Non' , 'Removable' , 'Tags' ] ,
47
+ tags3 : [ 'Non' , 'Removable' , 'Tags' ]
39
48
} ;
40
49
}
41
50
@@ -74,9 +83,7 @@ export default class PickerScreen extends Component {
74
83
return (
75
84
< ScrollView keyboardShouldPersistTaps = "always" >
76
85
< View flex padding-20 >
77
- < Text text40 >
78
- Picker
79
- </ Text >
86
+ < Text text40 > Picker</ Text >
80
87
< Picker
81
88
placeholder = "Favorite Language"
82
89
floatingPlaceholder
@@ -91,7 +98,7 @@ export default class PickerScreen extends Component {
91
98
// onSearchChange={value => console.warn('value', value)}
92
99
>
93
100
{ _ . map ( options , option => (
94
- < Picker . Item key = { option . value } value = { option } disabled = { option . disabled } />
101
+ < Picker . Item key = { option . value } value = { option } disabled = { option . disabled } />
95
102
) ) }
96
103
</ Picker >
97
104
@@ -105,7 +112,7 @@ export default class PickerScreen extends Component {
105
112
hideUnderline
106
113
>
107
114
{ _ . map ( options , option => (
108
- < Picker . Item key = { option . value } value = { option } disabled = { option . disabled } />
115
+ < Picker . Item key = { option . value } value = { option } disabled = { option . disabled } />
109
116
) ) }
110
117
</ Picker >
111
118
</ View >
@@ -118,7 +125,14 @@ export default class PickerScreen extends Component {
118
125
onChange = { nativePickerValue => this . setState ( { nativePickerValue} ) }
119
126
rightIconSource = { dropdown }
120
127
containerStyle = { { marginTop : 20 } }
121
- // renderNativePicker={(props) => {
128
+ // renderPicker={() => {
129
+ // return (
130
+ // <View>
131
+ // <Text>Open Native Picker!</Text>
132
+ // </View>
133
+ // );
134
+ // }}
135
+ // renderNativePicker={props => {
122
136
// return (
123
137
// <View flex bg-red50>
124
138
// <Text>CUSTOM NATIVE PICKER</Text>
@@ -136,7 +150,7 @@ export default class PickerScreen extends Component {
136
150
cancelLabelStyle = { { color : Colors . violet30 } }
137
151
>
138
152
{ _ . map ( options , option => (
139
- < Picker . Item key = { option . value } value = { option . value } label = { option . label } disabled = { option . disabled } />
153
+ < Picker . Item key = { option . value } value = { option . value } label = { option . label } disabled = { option . disabled } />
140
154
) ) }
141
155
</ Picker >
142
156
@@ -151,7 +165,7 @@ export default class PickerScreen extends Component {
151
165
renderCustomModal = { this . renderDialog }
152
166
>
153
167
{ _ . map ( options , option => (
154
- < Picker . Item key = { option . value } value = { option } label = { option . label } disabled = { option . disabled } />
168
+ < Picker . Item key = { option . value } value = { option } label = { option . label } disabled = { option . disabled } />
155
169
) ) }
156
170
</ Picker >
157
171
</ View >
@@ -165,7 +179,7 @@ export default class PickerScreen extends Component {
165
179
renderPicker = { ( { label} ) => {
166
180
return (
167
181
< View row center >
168
- < Image style = { { marginRight : 1 , height : 16 , resizeMode : 'contain' } } source = { tagIcon } />
182
+ < Image style = { { marginRight : 1 , height : 16 , resizeMode : 'contain' } } source = { tagIcon } />
169
183
< Text dark10 text80 >
170
184
{ label } Posts
171
185
</ Text >
@@ -174,7 +188,7 @@ export default class PickerScreen extends Component {
174
188
} }
175
189
>
176
190
{ _ . map ( filters , filter => (
177
- < Picker . Item key = { filter . value } value = { filter } />
191
+ < Picker . Item key = { filter . value } value = { filter } />
178
192
) ) }
179
193
</ Picker >
180
194
@@ -188,7 +202,7 @@ export default class PickerScreen extends Component {
188
202
renderPicker = { contact => {
189
203
return (
190
204
< View row center >
191
- < Avatar size = { 30 } imageSource = { { uri : contact . thumbnail } } />
205
+ < Avatar size = { 30 } imageSource = { { uri : contact . thumbnail } } />
192
206
< Text text70 marginL-10 >
193
207
{ contact . name }
194
208
</ Text >
@@ -205,20 +219,20 @@ export default class PickerScreen extends Component {
205
219
style = { {
206
220
height : 56 ,
207
221
borderBottomWidth : 1 ,
208
- borderColor : Colors . dark80 ,
222
+ borderColor : Colors . dark80
209
223
} }
210
224
paddingH-15
211
225
row
212
226
centerV
213
227
spread
214
228
>
215
229
< View row centerV >
216
- < Avatar size = { 35 } imageSource = { { uri : item . thumbnail } } />
230
+ < Avatar size = { 35 } imageSource = { { uri : item . thumbnail } } />
217
231
< Text marginL-10 text70 dark10 >
218
232
{ item . name }
219
233
</ Text >
220
234
</ View >
221
- { props . isSelected && < Image source = { Assets . icons . check } /> }
235
+ { props . isSelected && < Image source = { Assets . icons . check } /> }
222
236
</ View >
223
237
) }
224
238
getItemLabel = { item => item . name }
0 commit comments