2018-04-11 23:58:04 +01:00
|
|
|
/*
|
|
|
|
|
Copyright 2017 New Vector Ltd.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-09-06 18:35:52 +01:00
|
|
|
import React from "react";
|
2020-04-24 22:14:41 +01:00
|
|
|
import {_t} from "../../../languageHandler";
|
2020-06-26 00:00:30 +01:00
|
|
|
import SettingsStore from "../../../settings/SettingsStore";
|
2021-03-08 19:59:41 -07:00
|
|
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
2018-04-11 23:58:04 +01:00
|
|
|
|
2021-03-08 19:59:41 -07:00
|
|
|
@replaceableComponent("views.elements.InlineSpinner")
|
2020-08-29 12:14:16 +01:00
|
|
|
export default class InlineSpinner extends React.Component {
|
|
|
|
|
render() {
|
2018-10-26 22:50:35 -05:00
|
|
|
const w = this.props.w || 16;
|
|
|
|
|
const h = this.props.h || 16;
|
|
|
|
|
const imgClass = this.props.imgClassName || "";
|
2018-04-11 23:58:04 +01:00
|
|
|
|
2021-02-23 19:41:23 -05:00
|
|
|
let icon;
|
2020-08-17 13:12:18 -06:00
|
|
|
if (SettingsStore.getValue('feature_new_spinner')) {
|
2021-02-23 19:41:23 -05:00
|
|
|
icon = (
|
2020-04-24 22:14:41 +01:00
|
|
|
<img
|
2021-02-23 19:41:23 -05:00
|
|
|
src={require("../../../../res/img/logo-spinner.svg")}
|
2020-04-24 22:14:41 +01:00
|
|
|
width={w}
|
|
|
|
|
height={h}
|
|
|
|
|
className={imgClass}
|
2020-06-26 01:18:02 +01:00
|
|
|
aria-label={_t("Loading...")}
|
2020-04-24 22:14:41 +01:00
|
|
|
/>
|
2021-02-23 19:41:23 -05:00
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
icon = (
|
|
|
|
|
<div
|
|
|
|
|
className="mx_InlineSpinner_icon"
|
|
|
|
|
style={{width: w, height: h}}
|
|
|
|
|
aria-label={_t("Loading...")}
|
|
|
|
|
></div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="mx_InlineSpinner">{ icon }</div>
|
2018-04-11 23:58:04 +01:00
|
|
|
);
|
2020-08-29 12:14:16 +01:00
|
|
|
}
|
|
|
|
|
}
|