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" <HeaderButton key="groupMembersButton" name="groupMembersButton"
title={_t('Members')} title={_t('Members')}
isHighlighted={this.isPhase(groupPhases)} isHighlighted={this.isPhase(groupPhases)}
clickPhase={RightPanel.Phase.GroupMemberList} onClick={() => this.togglePhase(RightPanel.Phase.GroupMemberList)}
analytics={['Right Panel', 'Group Member List Button', 'click']} analytics={['Right Panel', 'Group Member List Button', 'click']}
/>, />,
<HeaderButton key="roomsButton" name="roomsButton" <HeaderButton key="roomsButton" name="roomsButton"
title={_t('Rooms')} title={_t('Rooms')}
isHighlighted={this.isPhase(roomPhases)} isHighlighted={this.isPhase(roomPhases)}
clickPhase={RightPanel.Phase.GroupRoomList} onClick={() => this.togglePhase(RightPanel.Phase.GroupRoomList)}
analytics={['Right Panel', 'Group Room List Button', 'click']} analytics={['Right Panel', 'Group Room List Button', 'click']}
/>, />,
]; ];

View file

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

View file

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