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 // click handler
onClick: () => void; onClick: () => void;
// The badge to display above the icon // The badge to display above the icon
badge: React.ReactNode; badge?: React.ReactNode;
// The parameters to track the click event // The parameters to track the click event
analytics: string[]; analytics: string[];

View File

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

View File

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