forked from rpeden/tomtom-maps-react-native-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSuggestionListItem.js
35 lines (33 loc) · 1.07 KB
/
SuggestionListItem.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
import React from 'react';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
import { faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons';
export function SuggestionListItem(props) {
return (<TouchableOpacity onPress={() => props.onPressItem(props.item)}>
<View style={styles.searchListItem}>
<View style={styles.searchListItemIcon}>
<FontAwesomeIcon icon={faMapMarkerAlt} />
</View>
<View>
<Text style={styles.searchListItemTitle}>{props.item.p1}</Text>
{props.item.p2 && props.item.p3 ? <Text>{props.item.p2} {props.item.p3}</Text> : null}
{props.item.p2 && !props.item.p3 ? <Text>{props.item.p2}</Text> : null}
</View>
</View>
</TouchableOpacity>);
}
const styles = StyleSheet.create({
searchListItemIcon: {
marginLeft: 10,
marginRight: 10,
marginTop: 10
},
searchListItem: {
marginTop: 5,
marginBottom: 5,
flexDirection: "row"
},
searchListItemTitle: {
fontWeight: 'bold'
}
});