...
|
...
|
@@ -30,6 +30,7 @@ export default class ListCell extends React.Component { |
|
|
isOwner: React.PropTypes.bool,
|
|
|
isTop: React.PropTypes.bool,
|
|
|
isLike: React.PropTypes.bool,
|
|
|
id: React.PropTypes.number,
|
|
|
title: React.PropTypes.string,
|
|
|
desc: React.PropTypes.string,
|
|
|
thumbs: ImmutablePropTypes.listOf(
|
...
|
...
|
@@ -58,7 +59,7 @@ export default class ListCell extends React.Component { |
|
|
|
|
|
render() {
|
|
|
let data = this.props.data.toJS();
|
|
|
let {author, timeago, isOwner, isTop, isLike, title, desc, thumbs, section, commentCount, likeCount} = data;
|
|
|
let {author, timeago, isOwner, isTop, isLike, id, title, desc, thumbs, section, commentCount, likeCount} = data;
|
|
|
let likeImage = isLike ? require('../../images/home/like.png') : require('../../images/home/unlike.png');
|
|
|
|
|
|
return (
|
...
|
...
|
@@ -66,10 +67,9 @@ export default class ListCell extends React.Component { |
|
|
style={styles.row}
|
|
|
activeOpacity={0.8}
|
|
|
onPress={() => {
|
|
|
this.props.onPressPost && this.props.onPressPost();
|
|
|
this.props.onPressPost && this.props.onPressPost(id);
|
|
|
}}
|
|
|
>
|
|
|
|
|
|
<View style={styles.top}>
|
|
|
<UserBrief
|
|
|
avatar={author.avatar}
|
...
|
...
|
@@ -77,7 +77,7 @@ export default class ListCell extends React.Component { |
|
|
timeago={timeago}
|
|
|
isOwner={isOwner}
|
|
|
onPressAvatar={() => {
|
|
|
this.props.onPressAvatar && this.props.onPressAvatar();
|
|
|
this.props.onPressAvatar && this.props.onPressAvatar(author.uid);
|
|
|
}}
|
|
|
/>
|
|
|
{isTop ? <Text style={styles.topTag}>置顶</Text> : null}
|
...
|
...
|
@@ -89,7 +89,7 @@ export default class ListCell extends React.Component { |
|
|
<SectionItem
|
|
|
name={section.name}
|
|
|
onPressSection={() => {
|
|
|
this.props.onPressSectionTag && this.props.onPressSectionTag();
|
|
|
this.props.onPressSectionTag && this.props.onPressSectionTag(section);
|
|
|
}}
|
|
|
/>
|
|
|
<View style={styles.buttonContainer}>
|
...
|
...
|
@@ -97,7 +97,7 @@ export default class ListCell extends React.Component { |
|
|
source={require('../../images/home/mes.png')}
|
|
|
number={commentCount}
|
|
|
onPressButton={() => {
|
|
|
this.props.onPressComment && this.props.onPressComment();
|
|
|
this.props.onPressComment && this.props.onPressComment(id);
|
|
|
}}
|
|
|
/>
|
|
|
<NumberButton
|
...
|
...
|
@@ -105,7 +105,7 @@ export default class ListCell extends React.Component { |
|
|
source={likeImage}
|
|
|
number={likeCount}
|
|
|
onPressButton={() => {
|
|
|
this.props.onPressLike && this.props.onPressLike();
|
|
|
this.props.onPressLike && this.props.onPressLike(data);
|
|
|
}}
|
|
|
/>
|
|
|
</View>
|
...
|
...
|
|