From 920f55b4f5bc6232c876de90f8509de411f8803a Mon Sep 17 00:00:00 2001 From: Sonata Green Date: Fri, 19 Aug 2016 20:48:08 -0500 Subject: [PATCH 1/3] add loading message to the My Files page --- js/page/my_files.js | 6 +++++- js/page/wallet.js | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/js/page/my_files.js b/js/page/my_files.js index c368cda48..fb207f9ac 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -158,7 +158,11 @@ var MyFilesPage = React.createClass({ }, render: function() { if (this.state.filesInfo === null) { - return null; + return ( +
+ Loading... +
+ ); } if (!this.state.filesInfo.length) { diff --git a/js/page/wallet.js b/js/page/wallet.js index acfd5e67b..b9cbd9cab 100644 --- a/js/page/wallet.js +++ b/js/page/wallet.js @@ -117,6 +117,7 @@ var WalletPage = React.createClass({ getInitialState: function() { return { balance: "Checking balance...", + txlog: "Loading transactions...", } }, componentWillMount: function() { @@ -125,6 +126,21 @@ var WalletPage = React.createClass({ balance: results, }); }); + console.log('Trying to get transaction history...') + lbry.call('get_transaction_history', {}, (results) => { + console.log('Got transaction history:') + console.log(results) + var out = 'Transaction history loaded.' + if (results.length == 0) { + out = 'No transactions yet.' + } else { + out = JSON.stringify(results) + } + console.log(out) + this.setState({ + txlog: out, + }) + }); }, render: function() { return ( @@ -139,6 +155,10 @@ var WalletPage = React.createClass({

Claim Invite Code

+
+

Transaction History

+ {this.state.txlog} +
); } From f9a1bd99c0a62896fec0ba9dc35f03882cbd870e Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 21 Aug 2016 10:55:32 -0400 Subject: [PATCH 2/3] component for busy indicator, use in my_files --- js/component/common.js | 9 +++++++++ js/component/splash.js | 3 +-- js/page/discover.js | 3 +-- js/page/my_files.js | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/js/component/common.js b/js/component/common.js index f767e8a1b..9a5fd57e4 100644 --- a/js/component/common.js +++ b/js/component/common.js @@ -27,6 +27,15 @@ var TruncatedText = React.createClass({ } }); +var BusyMessage = React.createClass({ + propTypes: { + message: React.PropTypes.string + }, + render: function() { + return {this.props.message} + } +}); + var toolTipStyle = { position: 'absolute', zIndex: '1', diff --git a/js/component/splash.js b/js/component/splash.js index e07478971..c6aaf87df 100644 --- a/js/component/splash.js +++ b/js/component/splash.js @@ -52,8 +52,7 @@ var SplashScreen = React.createClass({ LBRY

- {this.props.message} - +

{this.state.details}
diff --git a/js/page/discover.js b/js/page/discover.js index ce3a8657c..c76b92827 100644 --- a/js/page/discover.js +++ b/js/page/discover.js @@ -8,8 +8,7 @@ var SearchActive = React.createClass({ render: function() { return (
- Looking up the Dewey Decimals - +
); } diff --git a/js/page/my_files.js b/js/page/my_files.js index fb207f9ac..14cef41d8 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -160,7 +160,7 @@ var MyFilesPage = React.createClass({ if (this.state.filesInfo === null) { return (
- Loading... +
); } From 3554d34c5384cd4c9025cb44a390d3dbba84a419 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 21 Aug 2016 10:57:11 -0400 Subject: [PATCH 3/3] revert wallet changes --- js/page/wallet.js | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/js/page/wallet.js b/js/page/wallet.js index b9cbd9cab..cca61907e 100644 --- a/js/page/wallet.js +++ b/js/page/wallet.js @@ -99,7 +99,7 @@ var SendToAddressSection = React.createClass({

Results

{this.state.results} - : '' + : '' } ); @@ -111,13 +111,12 @@ var WalletPage = React.createClass({ document.title = "My Wallet"; }, /* - 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? + 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? */ getInitialState: function() { return { balance: "Checking balance...", - txlog: "Loading transactions...", } }, componentWillMount: function() { @@ -126,21 +125,6 @@ var WalletPage = React.createClass({ balance: results, }); }); - console.log('Trying to get transaction history...') - lbry.call('get_transaction_history', {}, (results) => { - console.log('Got transaction history:') - console.log(results) - var out = 'Transaction history loaded.' - if (results.length == 0) { - out = 'No transactions yet.' - } else { - out = JSON.stringify(results) - } - console.log(out) - this.setState({ - txlog: out, - }) - }); }, render: function() { return ( @@ -155,11 +139,7 @@ var WalletPage = React.createClass({

Claim Invite Code

-
-

Transaction History

- {this.state.txlog} -
); } -}); +}); \ No newline at end of file