-
Notifications
You must be signed in to change notification settings - Fork 8
/
ReplyCell.js
81 lines (72 loc) · 1.39 KB
/
ReplyCell.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
'use strict';
var React = require('react-native');
var Util = require('./Util');
var {
StyleSheet,
Text,
View,
Image,
PixelRatio,
ListView
} = React;
var {
formatTime
} = Util;
var ReplyCell = React.createClass({
render () {
var item = this.props.item;
return (
<View style={[styles.container, styles.item]}>
<Image
source={{uri: `http:${ item.member.avatar_normal }`}}
style={styles.thumbnail}
/>
<View style={styles.itemDetail}>
<Text>
<Text style={styles.username}>{ item.member.username }</Text>
{' '}
<Text style={styles.datetime}>{ formatTime(item.last_modified) }</Text>
</Text>
<View style={styles.contentWrapper}>
<Text style={styles.content}>{ item.content }</Text>
</View>
</View>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
},
item: {
paddingTop: 10,
paddingBottom: 10
},
thumbnail: {
width: 30,
height: 30
},
itemDetail: {
flex: 1,
marginLeft: 10
},
username: {
fontSize: 12,
color: 'rgb(119, 128, 135)',
fontWeight: '700'
},
datetime: {
fontSize: 12,
color: '#999',
marginLeft: 8
},
contentWrapper: {
marginTop: 4
},
content: {
lineHeight: 20
}
});
module.exports = ReplyCell;