-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocationCard.js
49 lines (45 loc) · 1.2 KB
/
LocationCard.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
import { StyleSheet, Text, View } from 'react-native';
import { ImageBackground } from 'react-native';
export default function LocationCard(props) {
return(
<View style={styles.overall}>
<ImageBackground source={props.image} style={styles.image}>
<View style={styles.textContainer}>
<Text style={styles.cityText} onPress={props.onPress}>{props.city}</Text>
<Text style={styles.distanceText} onPress={props.onPress}>{`${props.distance} away`}</Text>
</View>
</ImageBackground>
</View>
);
}
const styles = StyleSheet.create({
overall: {
paddingBottom: 25,
},
image: {
width: 350,
height: 350,
borderRadius: 50,
overflow: "hidden",
},
textContainer: {
color: 'white',
position: 'absolute',
left: 0,
right: 0,
bottom: 0,
justifyContent: 'center',
alignItems: 'left',
paddingLeft: 25,
paddingBottom: 10
},
cityText: {
color: 'white',
fontSize: 40,
fontWeight: "bold"
},
distanceText: {
color: 'white',
fontSize: 20
}
});