From 57eb2feeb638589f44fa65e973a1e8546ff3f378 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 15 Aug 2017 13:18:16 +0100 Subject: [PATCH] Make right panel collpasing work in GroupView --- src/components/structures/RightPanel.js | 101 +++++++++++------- src/i18n/strings/en_EN.json | 3 +- .../structures/_GroupView.scss | 4 + 3 files changed, 70 insertions(+), 38 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 18adcda6..acd92e3f 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -98,11 +98,15 @@ module.exports = React.createClass({ return; } - // call ChatInviteDialog - dis.dispatch({ - action: 'view_invite', - roomId: this.props.roomId, - }); + if (this.state.phase === this.Phase.GroupMemberList) { + // TODO: display UserPickeDialog + } else { + // call UserPickerDialog + dis.dispatch({ + action: 'view_invite', + roomId: this.props.roomId, + }); + } }, onRoomStateMember: function(ev, state, member) { @@ -169,7 +173,6 @@ module.exports = React.createClass({ const NotificationPanel = sdk.getComponent('structures.NotificationPanel'); const FilePanel = sdk.getComponent('structures.FilePanel'); const TintableSvg = sdk.getComponent("elements.TintableSvg"); - let buttonGroup; let inviteGroup; let panel; @@ -212,50 +215,72 @@ module.exports = React.createClass({ } + let headerButtons = []; if (this.props.roomId) { - buttonGroup = -
- -
{ membersBadge ? membersBadge :  }
- - { membersHighlight } -
- -
 
- - { filesHighlight } -
- -
 
- - { notificationsHighlight } -
-
- -
-
; + headerButtons.push( + +
{ membersBadge ? membersBadge :  }
+ + { membersHighlight } +
+ ); + headerButtons.push( + +
 
+ + { filesHighlight } +
+ ); + headerButtons.push( + +
 
+ + { notificationsHighlight } +
+ ); + } + + if (this.props.roomId || this.props.groupId) { + // Hiding the right panel hides it completely and relies on an 'expand' button + // being put in the RoomHeader or GroupView header, so only show the minimise + // button on these 2 screens or you won't be able to re-expand the panel. + headerButtons.push( +
+ +
+ ); } if (!this.props.collapsed) { if (this.props.roomId && this.state.phase == this.Phase.RoomMemberList) { panel = } else if (this.props.groupId && this.state.phase == this.Phase.GroupMemberList) { - panel = + panel = ; + inviteGroup = ( + +
+ +
+
{ _t('Invite to this group') }
+
+ ); } else if (this.state.phase == this.Phase.RoomMemberInfo) { const MemberInfo = sdk.getComponent('rooms.MemberInfo'); panel = } else if (this.state.phase == this.Phase.GroupMemberInfo) { const GroupMemberInfo = sdk.getComponent('groups.GroupMemberInfo'); - panel = + panel = ; } else if (this.state.phase == this.Phase.NotificationPanel) { - panel = + panel = ; } else if (this.state.phase == this.Phase.FilePanel) { - panel = + panel = ; } } @@ -271,7 +296,9 @@ module.exports = React.createClass({ return (