dont create functions in render
parent
49e96dc404
commit
02792132e1
|
@ -26,6 +26,8 @@ import RightPanel from '../../structures/RightPanel';
|
||||||
export default class GroupHeaderButtons extends HeaderButtons {
|
export default class GroupHeaderButtons extends HeaderButtons {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props, RightPanel.Phase.GroupMemberList);
|
super(props, RightPanel.Phase.GroupMemberList);
|
||||||
|
this._onMembersClicked = this._onMembersClicked.bind(this);
|
||||||
|
this._onRoomsClicked = this._onRoomsClicked.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload) {
|
onAction(payload) {
|
||||||
|
@ -50,6 +52,14 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onMembersClicked() {
|
||||||
|
this.togglePhase(RightPanel.Phase.GroupMemberList);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onRoomsClicked() {
|
||||||
|
this.togglePhase(RightPanel.Phase.GroupRoomList);
|
||||||
|
}
|
||||||
|
|
||||||
renderButtons() {
|
renderButtons() {
|
||||||
const groupPhases = [
|
const groupPhases = [
|
||||||
RightPanel.Phase.GroupMemberInfo,
|
RightPanel.Phase.GroupMemberInfo,
|
||||||
|
@ -64,13 +74,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)}
|
||||||
onClick={() => this.togglePhase(RightPanel.Phase.GroupMemberList)}
|
onClick={this._onMembersClicked}
|
||||||
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)}
|
||||||
onClick={() => this.togglePhase(RightPanel.Phase.GroupRoomList)}
|
onClick={this._onRoomsClicked}
|
||||||
analytics={['Right Panel', 'Group Room List Button', 'click']}
|
analytics={['Right Panel', 'Group Room List Button', 'click']}
|
||||||
/>,
|
/>,
|
||||||
];
|
];
|
||||||
|
|
|
@ -26,6 +26,9 @@ import RightPanel from '../../structures/RightPanel';
|
||||||
export default class RoomHeaderButtons extends HeaderButtons {
|
export default class RoomHeaderButtons extends HeaderButtons {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props, RightPanel.Phase.RoomMemberList);
|
super(props, RightPanel.Phase.RoomMemberList);
|
||||||
|
this._onMembersClicked = this._onMembersClicked.bind(this);
|
||||||
|
this._onFilesClicked = this._onFilesClicked.bind(this);
|
||||||
|
this._onNotificationsClicked = this._onNotificationsClicked.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload) {
|
onAction(payload) {
|
||||||
|
@ -47,6 +50,18 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onMembersClicked() {
|
||||||
|
this.togglePhase(RightPanel.Phase.RoomMemberList);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onFilesClicked() {
|
||||||
|
this.togglePhase(RightPanel.Phase.FilePanel);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onNotificationsClicked() {
|
||||||
|
this.togglePhase(RightPanel.Phase.NotificationPanel);
|
||||||
|
}
|
||||||
|
|
||||||
renderButtons() {
|
renderButtons() {
|
||||||
const membersPhases = [
|
const membersPhases = [
|
||||||
RightPanel.Phase.RoomMemberList,
|
RightPanel.Phase.RoomMemberList,
|
||||||
|
@ -58,19 +73,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)}
|
||||||
onClick={() => this.togglePhase(RightPanel.Phase.RoomMemberList)}
|
onClick={this._onMembersClicked}
|
||||||
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)}
|
||||||
onClick={() => this.togglePhase(RightPanel.Phase.FilePanel)}
|
onClick={this._onFilesClicked}
|
||||||
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)}
|
||||||
onClick={() => this.togglePhase(RightPanel.Phase.NotificationPanel)}
|
onClick={this._onNotificationsClicked}
|
||||||
analytics={['Right Panel', 'Notification List Button', 'click']}
|
analytics={['Right Panel', 'Notification List Button', 'click']}
|
||||||
/>,
|
/>,
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue