-
Notifications
You must be signed in to change notification settings - Fork 0
/
SearchBar.js
47 lines (43 loc) · 1.13 KB
/
SearchBar.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
44
45
46
47
import React from 'react';
import { View, TextInput, StyleSheet } from 'react-native';
import { Feather } from '@expo/vector-icons';
import { testProperties } from '../utility/helper';
const SearchBar = ({ term, onTermChange , onTermSubmit}) => {
return (
<View style={styles.backgroundStyle}>
<Feather name="search" style={styles.iconStyle}/>
<TextInput
{...testProperties('search_bar')}
autoCapitalize="none"
autoCorrect={false}
style={styles.inputStyle}
placeholder="Search"
value={term}
//onChangeText={newTerm => onTermChange(newTerm)}
onChangeText={onTermChange}
onEndEditing={onTermSubmit}
/>
</View>
);
};
const styles = StyleSheet.create({
backgroundStyle: {
marginTop: 10,
backgroundColor: '#F0EEEE',
height: 50,
borderRadius: 5,
marginHorizontal: 15,
flexDirection: 'row',
marginBottom: 10
},
inputStyle: {
fontSize: 18,
flex: 1
},
iconStyle: {
fontSize: 35,
alignSelf: 'center',
marginHorizontal: 2
}
});
export default SearchBar;