Convert load screens to use CSS
This commit is contained in:
parent
e97a81e7d5
commit
34d04255de
4 changed files with 32 additions and 19 deletions
|
@ -2,22 +2,6 @@ import React from 'react';
|
|||
import lbry from '../lbry.js';
|
||||
import {BusyMessage, Icon} from './common.js';
|
||||
|
||||
var loadScreenStyle = {
|
||||
color: 'white',
|
||||
backgroundImage: 'url(' + lbry.imagePath('lbry-bg.png') + ')',
|
||||
backgroundSize: 'cover',
|
||||
minHeight: '100vh',
|
||||
minWidth: '100vw',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}, loadScreenMessageStyle = {
|
||||
marginTop: '24px',
|
||||
width: '325px',
|
||||
textAlign: 'center',
|
||||
};
|
||||
|
||||
var LoadScreen = React.createClass({
|
||||
propTypes: {
|
||||
message: React.PropTypes.string.isRequired,
|
||||
|
@ -39,13 +23,13 @@ var LoadScreen = React.createClass({
|
|||
render: function() {
|
||||
var imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
||||
return (
|
||||
<div className="load-screen" style={loadScreenStyle}>
|
||||
<div className="load-screen">
|
||||
<img src={imgSrc} alt="LBRY"/>
|
||||
<div style={loadScreenMessageStyle}>
|
||||
<div className="load-screen__message">
|
||||
<h3>
|
||||
<BusyMessage message={this.props.message} />
|
||||
</h3>
|
||||
<Icon icon='icon-warning' style={this.props.isWarning ? {} : { display: 'none' }}/> <span style={ this.state.isWarning ? {} : {'color': '#c3c3c3'} }>{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>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -10,6 +10,7 @@ $color-light-alt: hsl(hue($color-primary), 15, 85);
|
|||
$color-text-dark: #000;
|
||||
$color-help: rgba(0,0,0,.6);
|
||||
$color-notice: #921010;
|
||||
$color-warning: #c3c3c3;
|
||||
$color-canvas: #f5f5f5;
|
||||
$color-bg: #ffffff;
|
||||
$color-bg-alt: #D9D9D9;
|
||||
|
|
|
@ -9,4 +9,5 @@
|
|||
@import "component/_file-tile.scss";
|
||||
@import "component/_menu.scss";
|
||||
@import "component/_tooltip.scss";
|
||||
@import "component/_load-screen.scss";
|
||||
@import "page/_developer.scss";
|
27
scss/component/_load-screen.scss
Normal file
27
scss/component/_load-screen.scss
Normal file
|
@ -0,0 +1,27 @@
|
|||
@import "../global";
|
||||
|
||||
.load-screen {
|
||||
color: white;
|
||||
background-image: url("/img/lbry-bg.png");
|
||||
background-size: cover;
|
||||
min-height: 100vh;
|
||||
min-width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.load-screen__message {
|
||||
margin-top: 24px;
|
||||
width: 325px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.load-screen__details--warning {
|
||||
color: $color-warning;
|
||||
}
|
||||
|
||||
.load-screen__cancel-link {
|
||||
color: white;
|
||||
}
|
Loading…
Reference in a new issue