mattermost-mobile/app/components/post/post_container.js
Harrison Healey c28d64c8da #96/#112/PLT-5370/PLT-5372 Styling posts and channel view (#213)
* Updated post rendering in center channel to include dates, display names, themeing, profile pictures, and threads

* Added status to ProfilePicture component

* Changed MemberListRow to use a ProfilePicture

* Removed unused prop

* Fixed incorrect copyright year on new file

* Removed unnecessary ref
2017-02-02 13:53:42 -03:00

28 lines
913 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {getMyPreferences, getTheme} from 'service/selectors/entities/preferences';
import {getUser} from 'service/selectors/entities/users';
import {displayUsername} from 'service/utils/user_utils';
import Post from './post';
function mapStateToProps(state, ownProps) {
const user = getUser(state, ownProps.post.user_id);
const commentedOnUser = ownProps.commentedOnPost ? getUser(state, ownProps.commentedOnPost.user_id) : null;
const myPreferences = getMyPreferences(state);
return {
user,
displayName: displayUsername(user, myPreferences),
commentedOnDisplayName: displayUsername(commentedOnUser, myPreferences),
theme: getTheme(state),
...ownProps
};
}
export default connect(mapStateToProps)(Post);