* 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
20 lines
550 B
JavaScript
20 lines
550 B
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {createSelector} from 'reselect';
|
|
|
|
export function getAllPosts(state) {
|
|
return state.entities.posts.posts;
|
|
}
|
|
|
|
function getPostIdsInCurrentChannel(state) {
|
|
return state.entities.posts.postsByChannel[state.entities.channels.currentId] || [];
|
|
}
|
|
|
|
export const getPostsInCurrentChannel = createSelector(
|
|
getAllPosts,
|
|
getPostIdsInCurrentChannel,
|
|
(posts, postIds) => {
|
|
return postIds.map((id) => posts[id]);
|
|
}
|
|
);
|