Convert Tooltip to TypeScript

This commit is contained in:
Germain Souquet 2021-05-24 15:01:59 +01:00
parent b5295b03ce
commit 19569f3897
2 changed files with 15 additions and 4 deletions

View file

@ -19,8 +19,9 @@ import {_t} from "../../../languageHandler";
import {replaceableComponent} from "../../../utils/replaceableComponent"; import {replaceableComponent} from "../../../utils/replaceableComponent";
interface IProps { interface IProps {
w?: number, w?: number;
h?: number, h?: number;
children?: React.ReactNode;
} }
@replaceableComponent("views.elements.InlineSpinner") @replaceableComponent("views.elements.InlineSpinner")
@ -37,7 +38,9 @@ export default class InlineSpinner extends React.PureComponent<IProps> {
className="mx_InlineSpinner_icon mx_Spinner_icon" className="mx_InlineSpinner_icon mx_Spinner_icon"
style={{width: this.props.w, height: this.props.h}} style={{width: this.props.w, height: this.props.h}}
aria-label={_t("Loading...")} aria-label={_t("Loading...")}
/> >
{this.props.children}
</div>
</div> </div>
); );
} }

View file

@ -19,8 +19,16 @@ import React from 'react';
import * as sdk from '../../../index'; import * as sdk from '../../../index';
import {replaceableComponent} from "../../../utils/replaceableComponent"; import {replaceableComponent} from "../../../utils/replaceableComponent";
interface IProps {
helpText: string;
}
interface IState {
hover: boolean;
}
@replaceableComponent("views.elements.TooltipButton") @replaceableComponent("views.elements.TooltipButton")
export default class TooltipButton extends React.Component { export default class TooltipButton extends React.Component<IProps, IState> {
state = { state = {
hover: false, hover: false,
}; };