call togglePhase from header buttons

This commit is contained in:
Bruno Windels 2019-04-10 13:21:07 +02:00
parent 5fb9276ef3
commit 2b4b6feba2
3 changed files with 6 additions and 10 deletions

View file

@ -68,13 +68,13 @@ export default class GroupHeaderButtons extends HeaderButtons {
<HeaderButton key="groupMembersButton" name="groupMembersButton"
title={_t('Members')}
isHighlighted={this.isPhase(groupPhases)}
clickPhase={RightPanel.Phase.GroupMemberList}
onClick={() => this.togglePhase(RightPanel.Phase.GroupMemberList)}
analytics={['Right Panel', 'Group Member List Button', 'click']}
/>,
<HeaderButton key="roomsButton" name="roomsButton"
title={_t('Rooms')}
isHighlighted={this.isPhase(roomPhases)}
clickPhase={RightPanel.Phase.GroupRoomList}
onClick={() => this.togglePhase(RightPanel.Phase.GroupRoomList)}
analytics={['Right Panel', 'Group Room List Button', 'click']}
/>,
];

View file

@ -32,11 +32,7 @@ export default class HeaderButton extends React.Component {
onClick(ev) {
Analytics.trackEvent(...this.props.analytics);
dis.dispatch({
action: 'view_right_panel_phase',
phase: this.props.clickPhase,
fromHeader: true,
});
this.props.onClick();
}
render() {

View file

@ -62,19 +62,19 @@ export default class RoomHeaderButtons extends HeaderButtons {
<HeaderButton key="membersButton" name="membersButton"
title={_t('Members')}
isHighlighted={this.isPhase(membersPhases)}
clickPhase={RightPanel.Phase.RoomMemberList}
onClick={() => this.togglePhase(RightPanel.Phase.RoomMemberList)}
analytics={['Right Panel', 'Member List Button', 'click']}
/>,
<HeaderButton key="filesButton" name="filesButton"
title={_t('Files')}
isHighlighted={this.isPhase(RightPanel.Phase.FilePanel)}
clickPhase={RightPanel.Phase.FilePanel}
onClick={() => this.togglePhase(RightPanel.Phase.FilePanel)}
analytics={['Right Panel', 'File List Button', 'click']}
/>,
<HeaderButton key="notifsButton" name="notifsButton"
title={_t('Notifications')}
isHighlighted={this.isPhase(RightPanel.Phase.NotificationPanel)}
clickPhase={RightPanel.Phase.NotificationPanel}
onClick={() => this.togglePhase(RightPanel.Phase.NotificationPanel)}
analytics={['Right Panel', 'Notification List Button', 'click']}
/>,
];