-
Notifications
You must be signed in to change notification settings - Fork 0
/
Card.js
64 lines (62 loc) · 1.35 KB
/
Card.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
import React from "react";
import {
View,
StyleSheet,
Text,
Image,
Animated,
TouchableOpacity,
} from "react-native";
export default class Card extends React.Component {
render() {
const { removeItem, item } = this.props;
const { uri, title, description, key } = item;
return (
<Animated.View style={{ alignItems: "center" }}>
<TouchableOpacity
onPress={() => removeItem(key)}
style={styles.container}
>
<Image style={styles.thumbnail} source={{ uri }} />
<View style={styles.metaDataContainer}>
<View style={styles.metaDataContent}>
<Text style={styles.title}>{title}</Text>
<Text style={styles.description}>{description}</Text>
</View>
</View>
</TouchableOpacity>
</Animated.View>
);
}
}
const styles = StyleSheet.create({
container: {
height: 80,
elevation: 3,
borderColor: "gray",
borderRadius: 5,
flexDirection: "row",
marginHorizontal: 20,
},
metaDataContainer: {
flex: 1,
},
thumbnail: {
width: 100,
},
metaDataContent: {
marginTop: 5,
marginLeft: 15,
},
title: {
color: "#444",
fontSize: 18,
fontWeight: "bold",
fontFamily: "serif",
},
description: {
fontSize: 16,
color: "#888",
fontWeight: "700",
},
});