Move HeaderButtons to an abstract class
This commit is contained in:
parent
c7e40d0751
commit
ad9be61477
3 changed files with 1 additions and 9 deletions
|
@ -46,8 +46,6 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
|||
}
|
||||
|
||||
protected onAction(payload: ActionPayload) {
|
||||
super.onAction(payload);
|
||||
|
||||
if (payload.action === Action.ViewUser) {
|
||||
if ((payload as ViewUserPayload).member) {
|
||||
this.setPhase(RightPanelPhases.RoomMemberInfo, {member: payload.member});
|
||||
|
|
|
@ -65,9 +65,7 @@ export default abstract class HeaderButtons extends React.Component<IProps, ISta
|
|||
if (this.dispatcherRef) dis.unregister(this.dispatcherRef);
|
||||
}
|
||||
|
||||
protected onAction(payload) {
|
||||
// Ignore - intended to be overridden by subclasses
|
||||
}
|
||||
protected abstract onAction(payload);
|
||||
|
||||
public setPhase(phase: RightPanelPhases, extras?: Partial<SetRightPanelPhaseRefireParams>) {
|
||||
dis.dispatch<SetRightPanelPhasePayload>({
|
||||
|
|
|
@ -36,13 +36,9 @@ const MEMBER_PHASES = [
|
|||
export default class RoomHeaderButtons extends HeaderButtons {
|
||||
constructor(props) {
|
||||
super(props, HeaderKind.Room);
|
||||
this.onMembersClicked = this.onMembersClicked.bind(this);
|
||||
this.onFilesClicked = this.onFilesClicked.bind(this);
|
||||
this.onNotificationsClicked = this.onNotificationsClicked.bind(this);
|
||||
}
|
||||
|
||||
protected onAction(payload: ActionPayload) {
|
||||
super.onAction(payload);
|
||||
if (payload.action === Action.ViewUser) {
|
||||
if (payload.member) {
|
||||
this.setPhase(RightPanelPhases.RoomMemberInfo, {member: payload.member});
|
||||
|
|
Loading…
Reference in a new issue