Migrate InlineSpinner to TypeScript

pull/21833/head
Germain Souquet 2021-05-24 14:33:31 +01:00
parent 153d0ae66d
commit d6bc1861ae
1 changed files with 14 additions and 7 deletions

View File

@ -18,19 +18,26 @@ import React from "react";
import {_t} from "../../../languageHandler"; import {_t} from "../../../languageHandler";
import {replaceableComponent} from "../../../utils/replaceableComponent"; import {replaceableComponent} from "../../../utils/replaceableComponent";
@replaceableComponent("views.elements.InlineSpinner") interface IProps {
export default class InlineSpinner extends React.Component { w?: number,
render() { h?: number,
const w = this.props.w || 16; }
const h = this.props.h || 16;
@replaceableComponent("views.elements.InlineSpinner")
export default class InlineSpinner extends React.PureComponent<IProps> {
static defaultProps = {
w: 16,
h: 16,
}
render() {
return ( return (
<div className="mx_InlineSpinner"> <div className="mx_InlineSpinner">
<div <div
className="mx_InlineSpinner_icon mx_Spinner_icon" className="mx_InlineSpinner_icon mx_Spinner_icon"
style={{width: w, height: h}} style={{width: this.props.w, height: this.props.h}}
aria-label={_t("Loading...")} aria-label={_t("Loading...")}
></div> />
</div> </div>
); );
} }