@@ -98,11 +98,15 @@ module.exports = React.createClass({
9898 return ;
9999 }
100100
101- // call ChatInviteDialog
102- dis . dispatch ( {
103- action : 'view_invite' ,
104- roomId : this . props . roomId ,
105- } ) ;
101+ if ( this . state . phase === this . Phase . GroupMemberList ) {
102+ // TODO: display UserPickeDialog
103+ } else {
104+ // call UserPickerDialog
105+ dis . dispatch ( {
106+ action : 'view_invite' ,
107+ roomId : this . props . roomId ,
108+ } ) ;
109+ }
106110 } ,
107111
108112 onRoomStateMember : function ( ev , state , member ) {
@@ -169,7 +173,6 @@ module.exports = React.createClass({
169173 const NotificationPanel = sdk . getComponent ( 'structures.NotificationPanel' ) ;
170174 const FilePanel = sdk . getComponent ( 'structures.FilePanel' ) ;
171175 const TintableSvg = sdk . getComponent ( "elements.TintableSvg" ) ;
172- let buttonGroup ;
173176 let inviteGroup ;
174177 let panel ;
175178
@@ -212,50 +215,72 @@ module.exports = React.createClass({
212215
213216 }
214217
218+ let headerButtons = [ ] ;
215219 if ( this . props . roomId ) {
216- buttonGroup =
217- < div className = "mx_RightPanel_headerButtonGroup" >
218- < AccessibleButton className = "mx_RightPanel_headerButton"
219- title = { _t ( 'Members' ) } onClick = { this . onMemberListButtonClick } >
220- < div className = "mx_RightPanel_headerButton_badge" > { membersBadge ? membersBadge : < span > </ span > } </ div >
221- < TintableSvg src = "img/icons-people.svg" width = "25" height = "25" />
222- { membersHighlight }
223- </ AccessibleButton >
224- < AccessibleButton
225- className = "mx_RightPanel_headerButton mx_RightPanel_filebutton"
226- title = { _t ( 'Files' ) } onClick = { this . onFileListButtonClick } >
227- < div className = "mx_RightPanel_headerButton_badge" > </ div >
228- < TintableSvg src = "img/icons-files.svg" width = "25" height = "25" />
229- { filesHighlight }
230- </ AccessibleButton >
231- < AccessibleButton
232- className = "mx_RightPanel_headerButton mx_RightPanel_notificationbutton"
233- title = { _t ( 'Notifications' ) } onClick = { this . onNotificationListButtonClick } >
234- < div className = "mx_RightPanel_headerButton_badge" > </ div >
235- < TintableSvg src = "img/icons-notifications.svg" width = "25" height = "25" />
236- { notificationsHighlight }
237- </ AccessibleButton >
238- < div className = "mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title = { _t ( "Hide panel" ) } onClick = { this . onCollapseClick } >
239- < TintableSvg src = "img/minimise.svg" width = "10" height = "16" />
240- </ div >
241- </ div > ;
220+ headerButtons . push (
221+ < AccessibleButton className = "mx_RightPanel_headerButton" key = "_membersButton"
222+ title = { _t ( 'Members' ) } onClick = { this . onMemberListButtonClick } >
223+ < div className = "mx_RightPanel_headerButton_badge" > { membersBadge ? membersBadge : < span > </ span > } </ div >
224+ < TintableSvg src = "img/icons-people.svg" width = "25" height = "25" />
225+ { membersHighlight }
226+ </ AccessibleButton >
227+ ) ;
228+ headerButtons . push (
229+ < AccessibleButton
230+ className = "mx_RightPanel_headerButton mx_RightPanel_filebutton" key = "_filesButton"
231+ title = { _t ( 'Files' ) } onClick = { this . onFileListButtonClick } >
232+ < div className = "mx_RightPanel_headerButton_badge" > </ div >
233+ < TintableSvg src = "img/icons-files.svg" width = "25" height = "25" />
234+ { filesHighlight }
235+ </ AccessibleButton >
236+ ) ;
237+ headerButtons . push (
238+ < AccessibleButton
239+ className = "mx_RightPanel_headerButton mx_RightPanel_notificationbutton" key = "_notifsButton"
240+ title = { _t ( 'Notifications' ) } onClick = { this . onNotificationListButtonClick } >
241+ < div className = "mx_RightPanel_headerButton_badge" > </ div >
242+ < TintableSvg src = "img/icons-notifications.svg" width = "25" height = "25" />
243+ { notificationsHighlight }
244+ </ AccessibleButton >
245+ ) ;
246+ }
247+
248+ if ( this . props . roomId || this . props . groupId ) {
249+ // Hiding the right panel hides it completely and relies on an 'expand' button
250+ // being put in the RoomHeader or GroupView header, so only show the minimise
251+ // button on these 2 screens or you won't be able to re-expand the panel.
252+ headerButtons . push (
253+ < div className = "mx_RightPanel_headerButton mx_RightPanel_collapsebutton" key = "_minimizeButton"
254+ title = { _t ( "Hide panel" ) } onClick = { this . onCollapseClick }
255+ >
256+ < TintableSvg src = "img/minimise.svg" width = "10" height = "16" />
257+ </ div >
258+ ) ;
242259 }
243260
244261 if ( ! this . props . collapsed ) {
245262 if ( this . props . roomId && this . state . phase == this . Phase . RoomMemberList ) {
246263 panel = < MemberList roomId = { this . props . roomId } key = { this . props . roomId } />
247264 } else if ( this . props . groupId && this . state . phase == this . Phase . GroupMemberList ) {
248- panel = < GroupMemberList groupId = { this . props . groupId } key = { this . props . groupId } />
265+ panel = < GroupMemberList groupId = { this . props . groupId } key = { this . props . groupId } /> ;
266+ inviteGroup = (
267+ < AccessibleButton className = "mx_RightPanel_invite" onClick = { this . onInviteButtonClick } >
268+ < div className = "mx_RightPanel_icon" >
269+ < TintableSvg src = "img/icon-invite-people.svg" width = "35" height = "35" />
270+ </ div >
271+ < div className = "mx_RightPanel_message" > { _t ( 'Invite to this group' ) } </ div >
272+ </ AccessibleButton >
273+ ) ;
249274 } else if ( this . state . phase == this . Phase . RoomMemberInfo ) {
250275 const MemberInfo = sdk . getComponent ( 'rooms.MemberInfo' ) ;
251276 panel = < MemberInfo member = { this . state . member } key = { this . props . roomId || this . state . member . userId } />
252277 } else if ( this . state . phase == this . Phase . GroupMemberInfo ) {
253278 const GroupMemberInfo = sdk . getComponent ( 'groups.GroupMemberInfo' ) ;
254- panel = < GroupMemberInfo member = { this . state . member } groupId = { this . props . groupId } key = { this . state . member . user_id } />
279+ panel = < GroupMemberInfo member = { this . state . member } groupId = { this . props . groupId } key = { this . state . member . user_id } /> ;
255280 } else if ( this . state . phase == this . Phase . NotificationPanel ) {
256- panel = < NotificationPanel />
281+ panel = < NotificationPanel /> ;
257282 } else if ( this . state . phase == this . Phase . FilePanel ) {
258- panel = < FilePanel roomId = { this . props . roomId } />
283+ panel = < FilePanel roomId = { this . props . roomId } /> ;
259284 }
260285 }
261286
@@ -271,7 +296,9 @@ module.exports = React.createClass({
271296 return (
272297 < aside className = { classes } style = { { opacity : this . props . opacity } } >
273298 < div className = "mx_RightPanel_header" >
274- { buttonGroup }
299+ < div className = "mx_RightPanel_headerButtonGroup" >
300+ { headerButtons }
301+ </ div >
275302 </ div >
276303 { panel }
277304 < div className = "mx_RightPanel_footer" >
0 commit comments