forked from AkshayWarrier/Volunteer-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FeedCard.js
130 lines (122 loc) · 3.74 KB
/
FeedCard.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import Icon from 'react-native-vector-icons/FontAwesome';
export const FeedCard = (props) => {
// console.log(props);
const imgsrc = {
"Environmental": require("./assets/images/environment.png"),
"Community": require("./assets/images/community.png"),
"Animal": require("./assets/images/animal.png"),
"Education": require("./assets/images/education.png"),
"Health": require("./assets/images/health.png"),
}
const navigation = useNavigation();
return (
<View style={styles.feed}>
<TouchableOpacity style={styles.container} activeOpacity={0.7} onPress={() => navigation.navigate("TaskDescription", {data:props})}>
<View style={styles.card}>
<Image source={imgsrc[props.type]} style={styles.image}/>
<View style={styles.textContainer}>
{/* Name */}
<Text style={styles.name}>
{props.name}
</Text>
{/* Organisation Name */}
<Text style={styles.organisation}>
{props.organisation}
</Text>
{/* Type and Location */}
<View>
<Text style={styles.text}>
{`${props.type} `}
{props.type === "Environmental" && <Icon name="tree" size={13} color="#1A535C"/>}
{props.type === "Community" && <Icon name="user" size={13} color="#1A535C"/>}
{props.type === "Animal" && <Icon name="paw" size={13} color="#1A535C"/>}
{props.type === "Education" && <Icon name="book" size={13} color="#1A535C"/>}
{props.type === "Health" && <Icon name="medkit" size={13} color="#1A535C"/>}
</Text>
<Text style={styles.text}>
{
props.remote ? "Remote " : props.location
}
<Icon name="map-marker" size={13} color="#1A535C"/>
</Text>
</View>
<View style={styles.dateContainer}>
<Text style={styles.date}>
{props.startDate}
</Text>
</View>
</View>
</View>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
feed: {
},
container: {
},
card: {
flexDirection: 'row',
width: '100%',
height: 90,
borderRadius: 10,
backgroundColor: "#F7FFF7",
elevation: 5,
overflow: 'hidden',
marginBottom: 10,
},
textContainer: {
flex: 2.5,
color: "1A535C",
// paddingLeft: 10,
// paddingRight: 10,
borderBottomLeftRadius: 10,
borderBottomRightRadius: 10,
backgroundColor: "#F7FFF7",
},
image: {
flex: 1,
height: 100,
width: 50,
borderTopLeftRadius: 10,
borderBottomLeftRadius: 10,
},
name: {
fontSize: 15,
color: "#1A535C",
fontWeight: "500",
paddingLeft: 10,
},
organisation: {
fontSize: 11,
color: "#1A535C",
paddingBottom: 2,
fontWeight: "500",
paddingLeft: 10,
},
text: {
fontSize: 11,
color: "#1A535C",
paddingLeft: 10,
},
dateContainer: {
// position: 'absolute',
// bottom: 0,
// left: 0,
// width: '100%',
// height: 15,
flex: 1,
backgroundColor: "#FF6B6B",
justifyContent: 'center',
borderBottomRightRadius: 10,
paddingLeft: 10,
},
date: {
fontSize: 10,
fontWeight: "300",
color: "#F7FFF7",
},
});