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 {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>
);
}