mirror of https://github.com/vector-im/riot-web
Add access specifier to class methods
parent
fbc341a2f5
commit
d0e2695114
|
@ -41,11 +41,11 @@ interface IProps {}
|
||||||
export default class GroupHeaderButtons extends HeaderButtons {
|
export default class GroupHeaderButtons extends HeaderButtons {
|
||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props, HeaderKind.Group);
|
super(props, HeaderKind.Group);
|
||||||
this._onMembersClicked = this._onMembersClicked.bind(this);
|
this.onMembersClicked = this.onMembersClicked.bind(this);
|
||||||
this._onRoomsClicked = this._onRoomsClicked.bind(this);
|
this.onRoomsClicked = this.onRoomsClicked.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload: ActionPayload) {
|
public onAction(payload: ActionPayload) {
|
||||||
super.onAction(payload);
|
super.onAction(payload);
|
||||||
|
|
||||||
if (payload.action === Action.ViewUser) {
|
if (payload.action === Action.ViewUser) {
|
||||||
|
@ -70,7 +70,7 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onMembersClicked() {
|
private onMembersClicked() {
|
||||||
if (this.state.phase === RightPanelPhases.GroupMemberInfo) {
|
if (this.state.phase === RightPanelPhases.GroupMemberInfo) {
|
||||||
// send the active phase to trigger a toggle
|
// send the active phase to trigger a toggle
|
||||||
this.setPhase(RightPanelPhases.GroupMemberInfo);
|
this.setPhase(RightPanelPhases.GroupMemberInfo);
|
||||||
|
@ -80,7 +80,7 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRoomsClicked() {
|
private onRoomsClicked() {
|
||||||
// This toggles for us, if needed
|
// This toggles for us, if needed
|
||||||
this.setPhase(RightPanelPhases.GroupRoomList);
|
this.setPhase(RightPanelPhases.GroupRoomList);
|
||||||
}
|
}
|
||||||
|
@ -90,13 +90,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(GROUP_PHASES)}
|
isHighlighted={this.isPhase(GROUP_PHASES)}
|
||||||
onClick={this._onMembersClicked}
|
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(ROOM_PHASES)}
|
isHighlighted={this.isPhase(ROOM_PHASES)}
|
||||||
onClick={this._onRoomsClicked}
|
onClick={this.onRoomsClicked}
|
||||||
analytics={['Right Panel', 'Group Room List Button', 'click']}
|
analytics={['Right Panel', 'Group Room List Button', 'click']}
|
||||||
/>,
|
/>,
|
||||||
];
|
];
|
||||||
|
|
|
@ -45,12 +45,12 @@ export default class HeaderButton extends React.Component<IProps> {
|
||||||
this.onClick = this.onClick.bind(this);
|
this.onClick = this.onClick.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onClick(_ev: React.KeyboardEvent) {
|
private onClick() {
|
||||||
Analytics.trackEvent(...this.props.analytics);
|
Analytics.trackEvent(...this.props.analytics);
|
||||||
this.props.onClick();
|
this.props.onClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
public render() {
|
||||||
const classes = classNames({
|
const classes = classNames({
|
||||||
mx_RightPanel_headerButton: true,
|
mx_RightPanel_headerButton: true,
|
||||||
mx_RightPanel_headerButton_highlight: this.props.isHighlighted,
|
mx_RightPanel_headerButton_highlight: this.props.isHighlighted,
|
||||||
|
|
|
@ -52,21 +52,21 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
public componentDidMount() {
|
||||||
this.storeToken = RightPanelStore.getSharedInstance().addListener(this.onRightPanelUpdate.bind(this));
|
this.storeToken = RightPanelStore.getSharedInstance().addListener(this.onRightPanelUpdate.bind(this));
|
||||||
this.dispatcherRef = dis.register(this.onAction.bind(this)); // used by subclasses
|
this.dispatcherRef = dis.register(this.onAction.bind(this)); // used by subclasses
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
if (this.storeToken) this.storeToken.remove();
|
if (this.storeToken) this.storeToken.remove();
|
||||||
if (this.dispatcherRef) dis.unregister(this.dispatcherRef);
|
if (this.dispatcherRef) dis.unregister(this.dispatcherRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload) {
|
public onAction(payload) {
|
||||||
// Ignore - intended to be overridden by subclasses
|
// Ignore - intended to be overridden by subclasses
|
||||||
}
|
}
|
||||||
|
|
||||||
setPhase(phase: RightPanelPhases, extras?: Partial<SetRightPanelPhaseRefireParams>) {
|
public setPhase(phase: RightPanelPhases, extras?: Partial<SetRightPanelPhaseRefireParams>) {
|
||||||
dis.dispatch<SetRightPanelPhasePayload>({
|
dis.dispatch<SetRightPanelPhasePayload>({
|
||||||
action: Action.SetRightPanelPhase,
|
action: Action.SetRightPanelPhase,
|
||||||
phase: phase,
|
phase: phase,
|
||||||
|
@ -74,7 +74,7 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
isPhase(phases: string | string[]) {
|
public isPhase(phases: string | string[]) {
|
||||||
if (Array.isArray(phases)) {
|
if (Array.isArray(phases)) {
|
||||||
return phases.includes(this.state.phase);
|
return phases.includes(this.state.phase);
|
||||||
} else {
|
} else {
|
||||||
|
@ -82,7 +82,7 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRightPanelUpdate() {
|
private onRightPanelUpdate() {
|
||||||
const rps = RightPanelStore.getSharedInstance();
|
const rps = RightPanelStore.getSharedInstance();
|
||||||
if (this.state.headerKind === HeaderKind.Room) {
|
if (this.state.headerKind === HeaderKind.Room) {
|
||||||
this.setState({phase: rps.visibleRoomPanelPhase});
|
this.setState({phase: rps.visibleRoomPanelPhase});
|
||||||
|
@ -92,7 +92,7 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: Make renderButtons a prop
|
// XXX: Make renderButtons a prop
|
||||||
renderButtons(): JSX.Element[] {
|
public renderButtons(): JSX.Element[] {
|
||||||
// Ignore - intended to be overridden by subclasses
|
// Ignore - intended to be overridden by subclasses
|
||||||
// Return empty fragment to satisfy the type
|
// Return empty fragment to satisfy the type
|
||||||
return [
|
return [
|
||||||
|
@ -101,7 +101,7 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
public render() {
|
||||||
// inline style as this will be swapped around in future commits
|
// inline style as this will be swapped around in future commits
|
||||||
return <div className="mx_HeaderButtons" role="tablist">
|
return <div className="mx_HeaderButtons" role="tablist">
|
||||||
{this.renderButtons()}
|
{this.renderButtons()}
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
||||||
this.onNotificationsClicked = this.onNotificationsClicked.bind(this);
|
this.onNotificationsClicked = this.onNotificationsClicked.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAction(payload: ActionPayload) {
|
public onAction(payload: ActionPayload) {
|
||||||
super.onAction(payload);
|
super.onAction(payload);
|
||||||
if (payload.action === Action.ViewUser) {
|
if (payload.action === Action.ViewUser) {
|
||||||
if (payload.member) {
|
if (payload.member) {
|
||||||
|
@ -79,7 +79,7 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
||||||
this.setPhase(RightPanelPhases.NotificationPanel);
|
this.setPhase(RightPanelPhases.NotificationPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderButtons() {
|
public renderButtons() {
|
||||||
return [
|
return [
|
||||||
<HeaderButton key="membersButton" name="membersButton"
|
<HeaderButton key="membersButton" name="membersButton"
|
||||||
title={_t('Members')}
|
title={_t('Members')}
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
this.hasVerifier = false;
|
this.hasVerifier = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderQRPhase() {
|
private renderQRPhase() {
|
||||||
const {member, request} = this.props;
|
const {member, request} = this.props;
|
||||||
const showSAS: boolean = request.otherPartySupportsMethod(verificationMethods.SAS);
|
const showSAS: boolean = request.otherPartySupportsMethod(verificationMethods.SAS);
|
||||||
const showQR: boolean = request.otherPartySupportsMethod(SCAN_QR_CODE_METHOD);
|
const showQR: boolean = request.otherPartySupportsMethod(SCAN_QR_CODE_METHOD);
|
||||||
|
@ -191,7 +191,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
return MatrixClientPeg.get().getStoredDevice(MatrixClientPeg.get().getUserId(), deviceId);
|
return MatrixClientPeg.get().getStoredDevice(MatrixClientPeg.get().getUserId(), deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderQRReciprocatePhase() {
|
private renderQRReciprocatePhase() {
|
||||||
const {member, request} = this.props;
|
const {member, request} = this.props;
|
||||||
let Button;
|
let Button;
|
||||||
// a bit of a hack, but the FormButton should only be used in the right panel
|
// a bit of a hack, but the FormButton should only be used in the right panel
|
||||||
|
@ -235,7 +235,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderVerifiedPhase() {
|
private renderVerifiedPhase() {
|
||||||
const {member, request} = this.props;
|
const {member, request} = this.props;
|
||||||
|
|
||||||
let text: string;
|
let text: string;
|
||||||
|
@ -281,7 +281,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCancelledPhase() {
|
private renderCancelledPhase() {
|
||||||
const {member, request} = this.props;
|
const {member, request} = this.props;
|
||||||
|
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
||||||
|
@ -321,7 +321,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
public render() {
|
||||||
const {member, phase, request} = this.props;
|
const {member, phase, request} = this.props;
|
||||||
|
|
||||||
const displayName = member.displayName || member.name || member.userId;
|
const displayName = member.displayName || member.name || member.userId;
|
||||||
|
@ -405,7 +405,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
public componentDidMount() {
|
||||||
const {request} = this.props;
|
const {request} = this.props;
|
||||||
request.on("change", this.onRequestChange);
|
request.on("change", this.onRequestChange);
|
||||||
if (request.verifier) {
|
if (request.verifier) {
|
||||||
|
@ -415,7 +415,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||||
this.onRequestChange();
|
this.onRequestChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
const {request} = this.props;
|
const {request} = this.props;
|
||||||
if (request.verifier) {
|
if (request.verifier) {
|
||||||
request.verifier.off('show_sas', this.updateVerifierState);
|
request.verifier.off('show_sas', this.updateVerifierState);
|
||||||
|
|
Loading…
Reference in New Issue