Migrate InlineSpinner to TypeScript

This commit is contained in:
Germain Souquet 2021-05-24 14:33:31 +01:00
parent 153d0ae66d
commit d6bc1861ae

View file

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