-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoCompleteSearch.js
73 lines (73 loc) · 1.94 KB
/
AutoCompleteSearch.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
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
import React, {useState} from 'react';
import {View, Text, StyleSheet, TextInput, Image} from 'react-native';
import Colors from './assets/colors';
import {Picker} from '@react-native-community/picker';
const AutocompleteSearch = props => {
const [searchedText, setSearchedText] = useState('');
const [familyId, setFamily] = useState(0);
return (
<View>
<View>
{/* <Text style={labelStyle}>First Depositer Name</Text> */}
<View style={styles.userIconCon}>
<Image
source={require('./assets/images/user-search.png')}
style={styles.userIcon}
/>
</View>
<TextInput
style={[styles.textInput]}
placeholder="Search family group name"
value={searchedText}
onChangeText={text => setSearchedText(text)}
/>
</View>
<Picker
testID="Scheme"
selectedValue={familyId}
// style={{height: 50, width: 150}}
style={styles.schemePicker}
// prompt={false}
// onValueChange={this.inputHandler.bind(this, 'family')}
>
{props.data.map((group, index) => {
// console.log('index', index);
return (
<Picker.Item
itemStyle={styles.schemeItem}
key={index}
label={group.name}
value={group.id}
prompt={false}
/>
);
})}
</Picker>
{/* {props.data.map(() => {
return ()
})} */}
</View>
);
};
const styles = StyleSheet.create({
userIconCon: {
width: 50,
height: 49,
position: 'absolute',
justifyContent: 'center',
alignItems: 'center',
},
userIcon: {
width: '50%',
height: 30,
// borderWidth: 1,
},
textInput: {
borderBottomColor: Colors.primary,
borderBottomWidth: 1,
fontSize: 18,
paddingStart: 50,
// backgroundColor: 'darkgray',
},
});
export default AutocompleteSearch;