...
|
...
|
@@ -9,8 +9,9 @@ import {bindActionCreators} from 'redux'; |
|
|
import {connect} from 'react-redux';
|
|
|
|
|
|
import MessageCenter from '../components/message/MessageCenter';
|
|
|
import * as homeActions from '../reducers/home/homeActions';
|
|
|
import * as messageActions from '../reducers/message/messageActions';
|
|
|
|
|
|
import * as userThatNotMeActions from '../reducers/userThatNotMe/userThatNotMeActions';
|
|
|
|
|
|
const {
|
|
|
Text,
|
...
|
...
|
@@ -23,6 +24,8 @@ const { |
|
|
|
|
|
const actions = [
|
|
|
messageActions,
|
|
|
userThatNotMeActions,
|
|
|
homeActions,
|
|
|
];
|
|
|
|
|
|
function mapStateToProps(state) {
|
...
|
...
|
@@ -47,8 +50,9 @@ class MessageCenterContainer extends React.Component { |
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
|
|
|
this._onPressAvatar = this._onPressAvatar.bind(this);
|
|
|
this._onPressSystemMsg = this._onPressSystemMsg.bind(this);
|
|
|
this._onPressLike = this._onPressLike.bind(this);
|
|
|
this._onPressPost = this._onPressPost.bind(this);
|
|
|
this._onPressSection = this._onPressSection.bind(this);
|
|
|
this._onRefresh = this._onRefresh.bind(this);
|
|
|
this._onEndReached = this._onEndReached.bind(this);
|
...
|
...
|
@@ -57,18 +61,24 @@ class MessageCenterContainer extends React.Component { |
|
|
}
|
|
|
|
|
|
|
|
|
_onPressLike() {
|
|
|
console.log('on press like');
|
|
|
_onPressAvatar(uid) {
|
|
|
console.log('avatar');
|
|
|
this.props.actions.goToUserNotMe(uid);
|
|
|
}
|
|
|
|
|
|
_onPressPost(id) {
|
|
|
console.log('post id = ' + id);
|
|
|
if (id) {
|
|
|
this.props.actions.goToPost(id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_onPressSystemMsg() {
|
|
|
console.log('on press system message');
|
|
|
}
|
|
|
|
|
|
_onPressSection(id) {
|
|
|
console.log('section id =' + id);
|
|
|
// this.props.actions.goToPost(id);
|
|
|
_onPressSection(section) {
|
|
|
this.props.actions.goToSection(section, this.props.navigationState.name);
|
|
|
}
|
|
|
|
|
|
_onRefresh() {
|
...
|
...
|
@@ -105,18 +115,19 @@ class MessageCenterContainer extends React.Component { |
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<MessageCenter
|
|
|
sysMsg={Immutable.fromJS([sysMsg])}
|
|
|
likeMsg={Immutable.fromJS([likeMsg])}
|
|
|
ptr={ptr}
|
|
|
list={list}
|
|
|
onRefresh={this._onRefresh}
|
|
|
onPressSystemMsg={this._onPressSystemMsg}
|
|
|
onPressLike={this._onPressLike}
|
|
|
onPressSection={this._onPressSection}
|
|
|
isFetching={isFetching}
|
|
|
ptr={ptr}
|
|
|
endReached={endReached}
|
|
|
isRefreshing={isRefreshing}
|
|
|
isLoadingMore={isLoadingMore}
|
|
|
sysMsg={Immutable.fromJS([sysMsg])}
|
|
|
likeMsg={Immutable.fromJS([likeMsg])}
|
|
|
onPressPost={this._onPressPost}
|
|
|
onRefresh={this._onRefresh}
|
|
|
onPressSystemMsg={this._onPressSystemMsg}
|
|
|
onPressAvatar={this._onPressAvatar}
|
|
|
onPressSection={this._onPressSection}
|
|
|
onPressSystemCell={this._onPressSystemCell}
|
|
|
onPressLikeCell={this._onPressLikeCell}
|
|
|
/>
|
...
|
...
|
|