Add pinnedpost count to channel info screen (#3290)
This commit is contained in:
parent
0f3728a185
commit
2ebe516296
2 changed files with 5 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ export default class ChannelInfo extends PureComponent {
|
|||
currentChannelCreatorName: PropTypes.string,
|
||||
currentChannelMemberCount: PropTypes.number,
|
||||
currentChannelGuestCount: PropTypes.number,
|
||||
currentChannelPinnedPostCount: PropTypes.number,
|
||||
currentUserId: PropTypes.string,
|
||||
currentUserIsGuest: PropTypes.bool,
|
||||
status: PropTypes.string,
|
||||
|
|
@ -414,6 +415,7 @@ export default class ChannelInfo extends PureComponent {
|
|||
actionsRows = (style, channelIsArchived) => {
|
||||
const {
|
||||
currentChannelMemberCount,
|
||||
currentChannelPinnedPostCount,
|
||||
canManageUsers,
|
||||
canEditChannel,
|
||||
theme,
|
||||
|
|
@ -475,6 +477,7 @@ export default class ChannelInfo extends PureComponent {
|
|||
<ChannelInfoRow
|
||||
action={this.goToPinnedPosts}
|
||||
defaultMessage='Pinned Posts'
|
||||
detail={currentChannelPinnedPostCount}
|
||||
image={pinIcon}
|
||||
textId={t('channel_header.pinnedPosts')}
|
||||
theme={theme}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ function mapStateToProps(state) {
|
|||
const currentChannelCreatorName = currentChannelCreator && currentChannelCreator.username;
|
||||
const currentChannelStats = getCurrentChannelStats(state);
|
||||
const currentChannelMemberCount = currentChannelStats && currentChannelStats.member_count;
|
||||
const currentChannelPinnedPostCount = currentChannelStats && currentChannelStats.pinnedpost_count;
|
||||
let currentChannelGuestCount = (currentChannelStats && currentChannelStats.guest_count) || 0;
|
||||
const currentChannelMember = getMyCurrentChannelMembership(state);
|
||||
const currentUserId = getCurrentUserId(state);
|
||||
|
|
@ -108,6 +109,7 @@ function mapStateToProps(state) {
|
|||
currentChannelCreatorName,
|
||||
currentChannelMemberCount,
|
||||
currentChannelGuestCount,
|
||||
currentChannelPinnedPostCount,
|
||||
currentUserId,
|
||||
currentUserIsGuest,
|
||||
isChannelMuted: isChannelMuted(currentChannelMember),
|
||||
|
|
|
|||
Loading…
Reference in a new issue