-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathFeedDetail.js
83 lines (74 loc) · 1.62 KB
/
FeedDetail.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
'use strict';
var React = require('react-native');
var EntryDetail = require('./EntryDetail');
var {
ScrollView,
StyleSheet,
Text,
TouchableHighlight,
View,
} = React;
class FeedDetail extends React.Component {
_showEntryDetails(entry:any) {
this.props.navigator.push({
component: EntryDetail,
title: entry.title,
passProps: {
entry: entry
}
})
}
_renderEntries(entry:any) {
return (
<TouchableHighlight
underlayColor="rgba(0,0,0,.1)"
onPress={() => { this._showEntryDetails(entry) }} >
<View style={styles.wrapper}>
<View style={styles.header}>
<Text style={styles.title}>{entry.title}</Text>
<Text style={styles.description}>{new Date(entry.publishedDate).toDateString()}</Text>
</View>
</View>
</TouchableHighlight>
);
}
render() {
return (
<ScrollView style={styles.scrollView}>
{this.props.entries.map((entry) => { return this._renderEntries(entry) })}
</ScrollView>
);
}
};
var styles = StyleSheet.create({
scrollView: {
flex: 1,
backgroundColor: '#F5FCFF'
},
wrapper: {
paddingTop: 20,
paddingBottom: 15,
paddingLeft: 10,
paddingRight: 10,
borderBottomWidth: 1,
borderBottomColor: '#e9e9e9',
},
title: {
paddingTop: 2,
paddingBottom: 3,
paddingRight: 15,
fontWeight: 'bold',
fontSize: 16,
},
description: {
color: "#B4AEAE",
fontSize: 12,
marginBottom: 5,
},
smallText: {
fontSize: 11,
textAlign: 'right',
color: "#B4AEAE",
}
});
module.exports = FeedDetail;