@@ -8,17 +8,17 @@ import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
8
8
import {
9
9
Assets ,
10
10
Colors ,
11
+ Spacings ,
11
12
View ,
12
13
Text ,
14
+ TextField ,
13
15
TouchableOpacity ,
14
16
Icon ,
15
17
Button ,
16
- TabController ,
17
- Incubator
18
+ TabController
18
19
} from 'react-native-ui-lib' ; //eslint-disable-line
19
20
import { navigationData } from './MenuStructure' ;
20
21
21
- const { TextField} = Incubator ;
22
22
const settingsIcon = require ( '../assets/icons/settings.png' ) ;
23
23
const chevronIcon = require ( '../assets/icons/chevronRight.png' ) ;
24
24
@@ -56,8 +56,6 @@ class MainScreen extends Component {
56
56
filteredNavigationData : data
57
57
} ;
58
58
59
- this . filterExplorerScreens = _ . throttle ( this . filterExplorerScreens , 300 ) ;
60
-
61
59
Navigation . events ( ) . bindComponent ( this ) ;
62
60
}
63
61
@@ -119,11 +117,11 @@ class MainScreen extends Component {
119
117
} , 0 ) ;
120
118
} ;
121
119
122
- updateSearch = filterText => {
120
+ updateSearch = _ . throttle ( filterText => {
123
121
this . setState ( { filterText} , ( ) => {
124
122
this . filterExplorerScreens ( ) ;
125
123
} ) ;
126
- } ;
124
+ } , 800 ) ;
127
125
128
126
clearSearch = ( ) => {
129
127
this . updateSearch ( '' ) ;
@@ -164,8 +162,8 @@ class MainScreen extends Component {
164
162
return (
165
163
< TextField
166
164
migrate
165
+ preset = { null }
167
166
ref = { r => ( this . input = r ) }
168
- value = { filterText }
169
167
testID = "uilib.search_for_component"
170
168
placeholder = "Search for your component..."
171
169
onChangeText = { this . updateSearch }
@@ -178,9 +176,9 @@ class MainScreen extends Component {
178
176
text70
179
177
trailingAccessory = {
180
178
filterText ? (
181
- < Button link iconSource = { Assets . icons . demo . close } grey10 onPress = { this . clearSearch } />
179
+ < Button link iconSource = { Assets . icons . demo . close } $iconDefault onPress = { this . clearSearch } />
182
180
) : (
183
- < Icon source = { Assets . icons . demo . search } />
181
+ < Icon tintColor = { Colors . $iconDefault } source = { Assets . icons . demo . search } />
184
182
)
185
183
}
186
184
/>
@@ -230,7 +228,7 @@ class MainScreen extends Component {
230
228
keyboardShouldPersistTaps = "always"
231
229
data = { flatData }
232
230
contentContainerStyle = { { paddingTop : 20 } }
233
- keyExtractor = { ( item , index ) => index . toString ( ) }
231
+ keyExtractor = { ( _item , index ) => index . toString ( ) }
234
232
renderItem = { this . renderItem }
235
233
/>
236
234
) ;
@@ -299,12 +297,13 @@ const styles = StyleSheet.create({
299
297
textDecorationLine : 'line-through'
300
298
} ,
301
299
searchContainer : {
302
- padding : 16 ,
303
- paddingBottom : 0
300
+ padding : Spacings . s4 ,
301
+ paddingBottom : 0 ,
302
+ marginBottom : Spacings . s2
304
303
} ,
305
304
searchField : {
306
- padding : 12 ,
307
- backgroundColor : Colors . grey80 ,
305
+ padding : Spacings . s3 ,
306
+ backgroundColor : Colors . $backgroundNeutralLight ,
308
307
borderRadius : 8
309
308
}
310
309
} ) ;
0 commit comments