Merge pull request #33 from lbryio/sonatagreen-myfiles-loading

Sonatagreen myfiles loading
This commit is contained in:
Jeremy Kauffman 2016-08-21 10:57:43 -04:00 committed by GitHub
commit 0221761a5a
5 changed files with 20 additions and 9 deletions

View file

@ -27,6 +27,15 @@ var TruncatedText = React.createClass({
} }
}); });
var BusyMessage = React.createClass({
propTypes: {
message: React.PropTypes.string
},
render: function() {
return <span>{this.props.message} <span className="busy-indicator"></span></span>
}
});
var toolTipStyle = { var toolTipStyle = {
position: 'absolute', position: 'absolute',
zIndex: '1', zIndex: '1',

View file

@ -52,8 +52,7 @@ var SplashScreen = React.createClass({
<img src={imgSrc} alt="LBRY"/> <img src={imgSrc} alt="LBRY"/>
<div style={splashMessageStyle}> <div style={splashMessageStyle}>
<h3> <h3>
{this.props.message} <BusyMessage message={this.props.message} />
<span className="busy-indicator"></span>
</h3> </h3>
<Icon icon='icon-warning' style={this.state.isLagging ? {} : { display: 'none' }}/> <span style={ this.state.isLagging ? {} : {'color': '#c3c3c3'} }>{this.state.details}</span> <Icon icon='icon-warning' style={this.state.isLagging ? {} : { display: 'none' }}/> <span style={ this.state.isLagging ? {} : {'color': '#c3c3c3'} }>{this.state.details}</span>
</div> </div>

View file

@ -8,8 +8,7 @@ var SearchActive = React.createClass({
render: function() { render: function() {
return ( return (
<div style={fetchResultsStyle}> <div style={fetchResultsStyle}>
Looking up the Dewey Decimals <BusyMessage message="Looking up the Dewey Decimals" />
<span className="busy-indicator"></span>
</div> </div>
); );
} }

View file

@ -158,7 +158,11 @@ var MyFilesPage = React.createClass({
}, },
render: function() { render: function() {
if (this.state.filesInfo === null) { if (this.state.filesInfo === null) {
return null; return (
<main className="page">
<BusyMessage message="Loading" />
</main>
);
} }
if (!this.state.filesInfo.length) { if (!this.state.filesInfo.length) {

View file

@ -99,7 +99,7 @@ var SendToAddressSection = React.createClass({
<h4>Results</h4> <h4>Results</h4>
{this.state.results} {this.state.results}
</div> </div>
: '' : ''
} }
</section> </section>
); );
@ -111,8 +111,8 @@ var WalletPage = React.createClass({
document.title = "My Wallet"; document.title = "My Wallet";
}, },
/* /*
Below should be refactored so that balance is shared all of wallet page. Or even broader? Below should be refactored so that balance is shared all of wallet page. Or even broader?
What is the proper React pattern for sharing a global state like balance? What is the proper React pattern for sharing a global state like balance?
*/ */
getInitialState: function() { getInitialState: function() {
return { return {
@ -142,4 +142,4 @@ var WalletPage = React.createClass({
</main> </main>
); );
} }
}); });