Hid View Members option when viewing direct/group channels (#716)
This commit is contained in:
parent
4db267ff61
commit
fd977df9e3
1 changed files with 33 additions and 21 deletions
|
|
@ -196,7 +196,15 @@ class ChannelInfo extends PureComponent {
|
|||
toggleFavorite(currentChannel.id);
|
||||
};
|
||||
|
||||
renderLeaveOrDeleteChannelRow() {
|
||||
renderViewOrManageMembersRow = () => {
|
||||
const channel = this.props.currentChannel;
|
||||
const isDirectMessage = channel.type === General.DM_CHANNEL;
|
||||
const isGroupMessage = channel.type === General.GM_CHANNEL;
|
||||
|
||||
return !isDirectMessage && !isGroupMessage;
|
||||
}
|
||||
|
||||
renderLeaveOrDeleteChannelRow = () => {
|
||||
const channel = this.props.currentChannel;
|
||||
const isDefaultChannel = channel.name === General.DEFAULT_CHANNEL;
|
||||
const isDirectMessage = channel.type === General.DM_CHANNEL;
|
||||
|
|
@ -205,7 +213,7 @@ class ChannelInfo extends PureComponent {
|
|||
return !isDefaultChannel && !isDirectMessage && !isGroupMessage;
|
||||
}
|
||||
|
||||
renderCloseDirect() {
|
||||
renderCloseDirect = () => {
|
||||
const channel = this.props.currentChannel;
|
||||
const isDirectMessage = channel.type === General.DM_CHANNEL;
|
||||
const isGroupMessage = channel.type === General.GM_CHANNEL;
|
||||
|
|
@ -265,28 +273,32 @@ class ChannelInfo extends PureComponent {
|
|||
togglable={true}
|
||||
theme={theme}
|
||||
/>
|
||||
<View style={style.separator}/>
|
||||
{
|
||||
|
||||
/**
|
||||
<ChannelInfoRow
|
||||
action={() => true}
|
||||
defaultMessage='Notification Preferences'
|
||||
icon='bell-o'
|
||||
textId='channel_header.notificationPreferences'
|
||||
theme={theme}
|
||||
/>
|
||||
<View style={style.separator}/>
|
||||
**/
|
||||
/**
|
||||
<ChannelInfoRow
|
||||
action={() => true}
|
||||
defaultMessage='Notification Preferences'
|
||||
icon='bell-o'
|
||||
textId='channel_header.notificationPreferences'
|
||||
theme={theme}
|
||||
/>
|
||||
<View style={style.separator}/>
|
||||
**/
|
||||
}
|
||||
{this.renderViewOrManageMembersRow() &&
|
||||
<View>
|
||||
<View style={style.separator}/>
|
||||
<ChannelInfoRow
|
||||
action={() => preventDoubleTap(this.goToChannelMembers)}
|
||||
defaultMessage={canManageUsers ? 'Manage Members' : 'View Members'}
|
||||
detail={currentChannelMemberCount}
|
||||
icon='users'
|
||||
textId={canManageUsers ? 'channel_header.manageMembers' : 'channel_header.viewMembers'}
|
||||
theme={theme}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
<ChannelInfoRow
|
||||
action={() => preventDoubleTap(this.goToChannelMembers)}
|
||||
defaultMessage={canManageUsers ? 'Manage Members' : 'View Members'}
|
||||
detail={currentChannelMemberCount}
|
||||
icon='users'
|
||||
textId={canManageUsers ? 'channel_header.manageMembers' : 'channel_header.viewMembers'}
|
||||
theme={theme}
|
||||
/>
|
||||
{canManageUsers &&
|
||||
<View>
|
||||
<View style={style.separator}/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue