Add Cancel link when loading screen is lagging
This commit is contained in:
parent
34d04255de
commit
810b94fa77
1 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import lbry from '../lbry.js';
|
||||
import {BusyMessage, Icon} from './common.js';
|
||||
import {Link} from '../component/link.js'
|
||||
|
||||
var LoadScreen = React.createClass({
|
||||
propTypes: {
|
||||
|
@ -8,6 +9,9 @@ var LoadScreen = React.createClass({
|
|||
details: React.PropTypes.string,
|
||||
isWarning: React.PropTypes.bool,
|
||||
},
|
||||
handleCancelClick: function() {
|
||||
history.back();
|
||||
},
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
isWarning: false,
|
||||
|
@ -21,7 +25,7 @@ var LoadScreen = React.createClass({
|
|||
}
|
||||
},
|
||||
render: function() {
|
||||
var imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
||||
const imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
||||
return (
|
||||
<div className="load-screen">
|
||||
<img src={imgSrc} alt="LBRY"/>
|
||||
|
@ -29,7 +33,10 @@ var LoadScreen = React.createClass({
|
|||
<h3>
|
||||
<BusyMessage message={this.props.message} />
|
||||
</h3>
|
||||
{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 ? <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}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue