2016-11-22 21:19:08 +01:00
|
|
|
import React from 'react';
|
|
|
|
import lbry from '../lbry.js';
|
|
|
|
import {BusyMessage, Icon} from './common.js';
|
2017-01-31 08:02:15 +01:00
|
|
|
import {Link} from '../component/link.js'
|
2016-11-22 21:19:08 +01:00
|
|
|
|
2016-09-21 07:19:23 +02:00
|
|
|
var LoadScreen = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
message: React.PropTypes.string.isRequired,
|
|
|
|
details: React.PropTypes.string,
|
|
|
|
isWarning: React.PropTypes.bool,
|
|
|
|
},
|
2017-01-31 08:02:15 +01:00
|
|
|
handleCancelClick: function() {
|
|
|
|
history.back();
|
|
|
|
},
|
2016-09-21 07:19:23 +02:00
|
|
|
getDefaultProps: function() {
|
|
|
|
return {
|
|
|
|
isWarning: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
getInitialState: function() {
|
|
|
|
return {
|
|
|
|
message: null,
|
|
|
|
details: null,
|
|
|
|
isLagging: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
render: function() {
|
2017-01-31 08:02:15 +01: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">
|
2016-09-21 07:19:23 +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>
|
|
|
|
<BusyMessage message={this.props.message} />
|
|
|
|
</h3>
|
2017-01-31 08:02:15 +01:00
|
|
|
{!this.props.isWarning ? <Icon icon="icon-warning" /> : null} <span className={'load-screen__details ' + (!this.props.isWarning ? 'load-screen__details--warning' : '')}>{this.props.details}</span>
|
|
|
|
{!this.props.isWarning
|
|
|
|
? <div><Link label="Cancel" onClick={this.handleCancelClick} className='load-screen__cancel-link button-text' /></div>
|
|
|
|
: null}
|
2016-09-21 07:19:23 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-11-22 21:19:08 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default LoadScreen;
|