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