Convert HeaderButton to TS

pull/21833/head
Swapnil Raj 2020-07-18 17:14:20 +05:30
parent 0f59e34a3a
commit 23e4b67a69
4 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,7 @@ interface IProps {
// click handler
onClick: () => void;
// The badge to display above the icon
badge: React.ReactNode;
badge?: React.ReactNode;
// The parameters to track the click event
analytics: string[];

View File

@ -23,7 +23,7 @@ import dis from '../../../dispatcher/dispatcher';
import RightPanelStore from "../../../stores/RightPanelStore";
import {RightPanelPhases} from "../../../stores/RightPanelStorePhases";
import {Action} from '../../../dispatcher/actions';
import {SetRightPanelPhasePayload} from '../../../dispatcher/payloads/SetRightPanelPhasePayload';
import {SetRightPanelPhasePayload, SetRightPanelPhaseRefireParams} from '../../../dispatcher/payloads/SetRightPanelPhasePayload';
export enum HeaderKind {
Room = "room",
@ -65,7 +65,7 @@ export default class HeaderButtons extends React.Component<IProps, IState> {
// Ignore - intended to be overridden by subclasses
}
setPhase(phase: RightPanelPhases, extras) {
setPhase(phase: RightPanelPhases, extras?: Partial<SetRightPanelPhaseRefireParams>) {
dis.dispatch<SetRightPanelPhasePayload>({
action: Action.SetRightPanelPhase,
phase: phase,

View File

@ -29,8 +29,10 @@ export interface SetRightPanelPhasePayload extends ActionPayload {
export interface SetRightPanelPhaseRefireParams {
// XXX: Fix after the types are defiend in matrix-js-sdk
// No appropriate types exist yet for the fields
members: any;
verificationRequest: typeof VerificationRequest;
groudId: string;
groupRoomId: string;
members?: any;
verificationRequest?: typeof VerificationRequest;
groudId?: string;
groupRoomId?: string;
// XXX: 'view_3pid_invite' action's payload
event?: any;
}