diff --git a/src/components/views/right_panel/GroupHeaderButtons.js b/src/components/views/right_panel/GroupHeaderButtons.js index af54787b2c..6fcba1d815 100644 --- a/src/components/views/right_panel/GroupHeaderButtons.js +++ b/src/components/views/right_panel/GroupHeaderButtons.js @@ -55,23 +55,23 @@ export default class GroupHeaderButtons extends HeaderButtons { } renderButtons() { - const isPhaseGroup = [ + const groupPhases = [ RightPanel.Phase.GroupMemberInfo, RightPanel.Phase.GroupMemberList, - ].includes(this.state.phase); - const isPhaseRoom = [ + ]; + const roomPhases = [ RightPanel.Phase.GroupRoomList, RightPanel.Phase.GroupRoomInfo, - ].includes(this.state.phase); + ]; return [ , , diff --git a/src/components/views/right_panel/HeaderButtons.js b/src/components/views/right_panel/HeaderButtons.js index 18ec2bd941..3e3bbd3cd2 100644 --- a/src/components/views/right_panel/HeaderButtons.js +++ b/src/components/views/right_panel/HeaderButtons.js @@ -48,6 +48,17 @@ export default class HeaderButtons extends React.Component { }, extras)); } + isPhase(phases) { + if (this.props.collapsedRhs) { + return false; + } + if (Array.isArray(phases)) { + return phases.includes(this.state.phase); + } else { + return phases === this.state.phase; + } + } + onAction(payload) { if (payload.action === "view_right_panel_phase") { // only actions coming from header buttons should collapse the right panel diff --git a/src/components/views/right_panel/RoomHeaderButtons.js b/src/components/views/right_panel/RoomHeaderButtons.js index ba06bd9953..ff97fc5f4f 100644 --- a/src/components/views/right_panel/RoomHeaderButtons.js +++ b/src/components/views/right_panel/RoomHeaderButtons.js @@ -46,24 +46,24 @@ export default class RoomHeaderButtons extends HeaderButtons { } renderButtons() { - const isMembersPhase = [ + const membersPhases = [ RightPanel.Phase.RoomMemberList, RightPanel.Phase.RoomMemberInfo, - ].includes(this.state.phase); + ]; return [ , , ,