Merge pull request #5432 from vector-im/luke/fix-group-members-info-icon-highlight

Highlight group members icon in group member info
This commit is contained in:
Luke Barnard 2017-10-25 15:41:09 +01:00 committed by GitHub
commit a627784c41
1 changed files with 7 additions and 5 deletions

View File

@ -249,6 +249,11 @@ module.exports = React.createClass({
} }
} }
const isPhaseGroup = [
this.Phase.GroupMemberInfo,
this.Phase.GroupMemberList
].includes(this.state.phase);
let headerButtons = []; let headerButtons = [];
if (this.props.roomId) { if (this.props.roomId) {
headerButtons = [ headerButtons = [
@ -272,7 +277,7 @@ module.exports = React.createClass({
} else if (this.props.groupId) { } else if (this.props.groupId) {
headerButtons = [ headerButtons = [
<HeaderButton key="_groupMembersButton" title={_t('Members')} iconSrc="img/icons-people.svg" <HeaderButton key="_groupMembersButton" title={_t('Members')} iconSrc="img/icons-people.svg"
isHighlighted={this.state.phase === this.Phase.GroupMemberList} isHighlighted={isPhaseGroup}
clickPhase={this.Phase.GroupMemberList} clickPhase={this.Phase.GroupMemberList}
analytics={['Right Panel', 'Group Member List Button', 'click']} analytics={['Right Panel', 'Group Member List Button', 'click']}
/>, />,
@ -326,10 +331,7 @@ module.exports = React.createClass({
if (this.props.groupId && if (this.props.groupId &&
GroupStoreCache.getGroupStore(this.context.matrixClient, this.props.groupId).isUserPrivileged() GroupStoreCache.getGroupStore(this.context.matrixClient, this.props.groupId).isUserPrivileged()
) { ) {
inviteGroup = [ inviteGroup = isPhaseGroup ? (
this.Phase.GroupMemberInfo,
this.Phase.GroupMemberList,
].includes(this.state.phase) ? (
<AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } > <AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
<div className="mx_RightPanel_icon" > <div className="mx_RightPanel_icon" >
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" /> <TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />