mattermost-mobile/app/components/post/post_container.js
Chris Duarte e6a1c1a433 Plt 6044 plt 5971 plt 5934 (#405)
* Update post textbox design

* Hide team selection

* Added channel loader

* Update post textbox to new design

* Add channel loader animation

* Remove error bar

* Made image preview fullscreen

* Fix channel loader gradient

* Fix status icon

* Adjust loaded and profile

* Fix channel header wrap

* Add reply count icon

* Fix android styling

* Hide send button

* Fix thread header

* Fix thumbnail upload preview

* Fix preview retry and design
2017-03-27 16:47:52 -03:00

54 lines
2.2 KiB
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {deletePost, flagPost, unflagPost} from 'mattermost-redux/actions/posts';
import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {makeGetCommentCountForPost} from 'mattermost-redux/selectors/entities/posts';
import {getCurrentUserId, getCurrentUserRoles, getUser} from 'mattermost-redux/selectors/entities/users';
import {isPostFlagged} from 'mattermost-redux/utils/post_utils';
import {displayUsername} from 'mattermost-redux/utils/user_utils';
import {goToUserProfile, openEditPostModal} from 'app/actions/navigation';
import {getTheme} from 'app/selectors/preferences';
import Post from './post';
function makeMapStateToProps() {
const getCommentCountForPost = makeGetCommentCountForPost();
return function mapStateToProps(state, ownProps) {
const commentedOnUser = ownProps.commentedOnPost ? getUser(state, ownProps.commentedOnPost.user_id) : null;
const user = getUser(state, ownProps.post.user_id);
const myPreferences = getMyPreferences(state);
return {
...ownProps,
config: state.entities.general.config,
commentCount: getCommentCountForPost(state, ownProps),
commentedOnDisplayName: displayUsername(commentedOnUser, myPreferences),
currentTeamId: getCurrentTeamId(state),
currentUserId: getCurrentUserId(state),
displayName: displayUsername(user, myPreferences),
isFlagged: isPostFlagged(ownProps.post.id, myPreferences),
roles: getCurrentUserRoles(state),
theme: getTheme(state),
user
};
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
deletePost,
flagPost,
goToUserProfile,
openEditPostModal,
unflagPost
}, dispatch)
};
}
export default connect(makeMapStateToProps, mapDispatchToProps)(Post);