-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListItem.js
More file actions
62 lines (57 loc) · 1.37 KB
/
ListItem.js
File metadata and controls
62 lines (57 loc) · 1.37 KB
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
import React from 'react';
import { StyleSheet, Image, View, Text, TouchableOpacity } from 'react-native';
const ListItem = ({ item }) => {
const styles = StyleSheet.create({
container: {
backgroundColor: 'white',
alignItems: 'center',
margin: '5%',
padding: 25,
display: 'flex',
flexDirection: 'row',
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
},
textContainer: {
alignItems: 'center',
padding: 20,
display: 'flex',
},
title: {
paddingBottom: 20,
fontWeight: 'bold',
fontSize: 25,
},
subTitle: {
paddingBottom: 20,
fontSize: 18,
},
image: {
width: 150,
height: 150,
borderRadius: 150,
resizeMode: 'contain',
},
});
return (
<TouchableOpacity key={item._id}>
<View style={styles.container}>
<Image
source={{ url: item.plantInfo.imgUrl }}
style={styles.image}
></Image>
<View style={styles.textContainer}>
<Text style={styles.title}>{item.nickName}</Text>
<Text style={styles.subTitle}>{item.commonName}</Text>
<Text style={styles.subTitle}>{item.plantInfo.water}</Text>
</View>
</View>
</TouchableOpacity>
);
};
export default ListItem;