-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathPushDetailHeader.js
121 lines (112 loc) · 4.79 KB
/
PushDetailHeader.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
/**
* Created by guoshuyu on 2017/11/11.
*/
import React, {
Component,
} from 'react'
import {
View, Text, TouchableOpacity
} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../../style'
import * as Constant from '../../style/constant'
import TimeText from './TimeText'
import UserImage from './UserImage'
import Icon from 'react-native-vector-icons/FontAwesome'
import IconC from 'react-native-vector-icons/Octicons'
import resolveTime from '../../utils/timeUtil'
/**
* Push详情Header
*/
class PushDetailHeader extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
let {actionUser, actionUserPic, pushTime, pushDes} = this.props;
return (
<View
style={[{
marginTop: Constant.normalMarginEdge,
marginLeft: Constant.normalMarginEdge,
marginRight: Constant.normalMarginEdge,
paddingHorizontal: Constant.normalMarginEdge,
paddingTop: Constant.normalMarginEdge,
borderRadius: 4,
}, styles.shadowCard, {backgroundColor: Constant.primaryColor}]}
onPress={() => {
this.props.onPressItem && this.props.onPressItem();
}}>
<View style={[styles.flexDirectionRowNotFlex,]}>
<UserImage uri={actionUserPic}
loginUser={actionUser}
resizeMethod="scale"
style={[{
height: Constant.bigIconSize, width: Constant.bigIconSize,
marginTop: 5,
borderRadius: Constant.bigIconSize / 2
}]}/>
<View style={{flex: 1, marginLeft: Constant.normalMarginEdge}}>
<View
style={[styles.flexDirectionRowNotFlex, styles.centerH, {marginVertical: Constant.normalMarginEdge / 2}]}>
<Icon name={'edit'}
backgroundColor={Constant.transparentColor}
color={Constant.miWhite} size={13}
style={styles.centerH}>
<Text style={[styles.miLightSmallText]}>
{" " + this.props.editCount + " "}
</Text>
</Icon>
<IconC name={'diff-added'}
backgroundColor={Constant.transparentColor}
color={Constant.miWhite} size={13}
style={styles.centerH}>
<Text style={[styles.miLightSmallText]}>
{" " + this.props.addCount + " "}
</Text>
</IconC>
<Icon name="minus-square-o"
iconStyle={{marginRight: 3}}
backgroundColor={Constant.transparentColor}
color={Constant.miWhite} size={13}
style={styles.centerH}>
<Text style={[styles.miLightSmallText]}>
{" " + this.props.deleteCount}
</Text>
</Icon>
</View>
<View
style={[styles.flexDirectionRowNotFlex, {
marginBottom: Constant.normalMarginEdge,
marginTop: Constant.normalMarginEdge / 2
}]}>
<Text style={[styles.miLightSmallText,]}>{resolveTime(pushTime)}</Text>
</View>
<View
style={[styles.flexDirectionRowNotFlex, {
marginBottom: Constant.normalMarginEdge
}]}>
<Text style={[styles.miLightSmallText,]}
selectable={true}>{pushDes}</Text>
</View>
</View>
</View>
</View>
)
}
}
const propTypes = {
actionUser: PropTypes.string,
actionUserPic: PropTypes.string,
pushDes: PropTypes.string,
pushTime: PropTypes.string,
editCount: PropTypes.string,
addCount: PropTypes.string,
deleteCount: PropTypes.string,
};
PushDetailHeader.propTypes = propTypes;
export default PushDetailHeader