2017-06-06 23:19:12 +02:00
|
|
|
import React from "react";
|
|
|
|
import lbry from "../lbry.js";
|
|
|
|
import { BusyMessage, Icon } from "./common.js";
|
|
|
|
import Link from "component/link";
|
2016-11-22 21:19:08 +01:00
|
|
|
|
2017-06-08 06:42:19 +02:00
|
|
|
class LoadScreen extends React.PureComponent {
|
2017-05-17 10:10:25 +02:00
|
|
|
static propTypes = {
|
2016-09-21 07:19:23 +02:00
|
|
|
message: React.PropTypes.string.isRequired,
|
|
|
|
details: React.PropTypes.string,
|
|
|
|
isWarning: React.PropTypes.bool,
|
2017-06-06 23:19:12 +02:00
|
|
|
};
|
2017-05-17 10:10:25 +02:00
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
2016-09-21 07:19:23 +02:00
|
|
|
message: null,
|
|
|
|
details: null,
|
|
|
|
isLagging: false,
|
2017-05-17 10:10:25 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
isWarning: false,
|
2017-06-06 23:19:12 +02:00
|
|
|
};
|
2017-05-17 10:10:25 +02:00
|
|
|
|
|
|
|
render() {
|
2017-06-06 23:19:12 +02:00
|
|
|
const imgSrc = lbry.imagePath("lbry-white-485x160.png");
|
2016-09-21 07:19:23 +02:00
|
|
|
return (
|
2017-01-31 07:58:25 +01:00
|
|
|
<div className="load-screen">
|
2017-06-06 23:19:12 +02:00
|
|
|
<img src={imgSrc} alt="LBRY" />
|
2017-01-31 07:58:25 +01:00
|
|
|
<div className="load-screen__message">
|
2016-09-21 07:19:23 +02:00
|
|
|
<h3>
|
2017-06-06 23:19:12 +02:00
|
|
|
{!this.props.isWarning
|
|
|
|
? <BusyMessage message={this.props.message} />
|
|
|
|
: <span>
|
|
|
|
<Icon icon="icon-warning" />{" " + this.props.message}
|
|
|
|
</span>}
|
2016-09-21 07:19:23 +02:00
|
|
|
</h3>
|
2017-06-06 23:19:12 +02:00
|
|
|
<span
|
|
|
|
className={
|
|
|
|
"load-screen__details " +
|
|
|
|
(this.props.isWarning ? "load-screen__details--warning" : "")
|
|
|
|
}
|
|
|
|
>
|
|
|
|
{this.props.details}
|
|
|
|
</span>
|
2016-09-21 07:19:23 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-05-17 10:10:25 +02:00
|
|
|
}
|
2016-11-22 21:19:08 +01:00
|
|
|
|
|
|
|
export default LoadScreen;
|