* 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
28 lines
913 B
JavaScript
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);
|
|
|