-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReviewScreen.js
91 lines (81 loc) · 2.22 KB
/
ReviewScreen.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
import React, { Component } from 'react';
import { View, Text, Platform, ScrollView, Linking } from 'react-native';
import { Card, Button, Icon } from 'react-native-elements';
import { connect } from 'react-redux';
import { MapView } from 'expo';
class ReviewScreen extends Component {
static navigationOptions = ({ navigation }) => ({
headerRight: (
<Button
title="Settings"
onPress={() => navigation.navigate('settings')}
backgroundColor="rgba(0,0,0,0)"
color="rgba(0, 122, 255, 1)"
/>
),
headerStyle: {
marginTop: Platform.os === 'android' ? 24 : 0
},
tabBarLabel: 'Review Jobs',
tabBarIcon: ({ tintColor }) => {
return <Icon name='favorite' size={30} color={tintColor} />;
}
});
renderLikedJobs() {
return this.props.likedJobs.map(job => {
const {
company, formattedRelativeTime, url,
longitude, latitude, jobtitle, jobkey
} = job;
const initialRegion = {
longitude,
latitude,
latitudeDelta: 0.045,
longitudeDelta: 0.02
};
return (
<Card title={jobtitle} key={jobkey}>
<View style={{ height: 200 }}>
<MapView
scrollEnabled={false}
style={{ flex: 1 }}
cacheEnabled={Platform.os === 'android'}
initialRegion={initialRegion}
/>
<View style={styles.detailWrapper}>
<Text style={styles.italics}>{job.company}</Text>
<Text style={styles.italics}>{job.formattedRelativeTime}</Text>
</View>
<Button
title='Apply Now!'
backgroundColor='#0389F4'
onPress={() => Linking.openURL(url)}
/>
</View>
</Card>
);
});
}
render() {
return (
<ScrollView>
{this.renderLikedJobs()}
</ScrollView>
);
}
}
const styles = {
detailWrapper: {
marginTop: 10,
marginBottom: 10,
flexDirection: 'row',
justifyContent: 'space-around'
},
italics: {
fontStyle: 'italic'
},
};
function mapStateToProps(state) {
return { likedJobs: state.likedJobs || [] };
}
export default connect(mapStateToProps, null)(ReviewScreen);