From a4f02c8ae9a458a8714035856b666e7d044b3d4e Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Wed, 20 Apr 2016 07:51:31 -0400 Subject: [PATCH] Add "close" button on Linux with landing page to restart --- dist/index.html | 1 + js/app.js | 4 +++- js/component/common.js | 3 ++- js/page/home.js | 15 ++++++++++++--- js/page/start.js | 13 +++++++++++++ 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 js/page/start.js diff --git a/dist/index.html b/dist/index.html index d84b127cb..2fb646c71 100644 --- a/dist/index.html +++ b/dist/index.html @@ -27,6 +27,7 @@ + diff --git a/js/app.js b/js/app.js index f17c68ec4..10eba31e6 100644 --- a/js/app.js +++ b/js/app.js @@ -6,7 +6,7 @@ var appStyles = { var App = React.createClass({ getInitialState: function() { var query = window.location.search.slice(1); - if (query == 'settings' || query == 'help') { + if (['settings', 'help', 'start'].indexOf(query) != -1) { var viewingPage = query; } else { var viewingPage = 'home'; @@ -54,6 +54,8 @@ var App = React.createClass({ var content = ; } else if (this.state.viewingPage == 'help') { var content = ; + } else if (this.state.viewingPage == 'start') { + var content = ; } return (
diff --git a/js/component/common.js b/js/component/common.js index 43433638b..968c7505c 100644 --- a/js/component/common.js +++ b/js/component/common.js @@ -15,7 +15,8 @@ var Link = React.createClass({ console.log(this.props); var href = this.props.href ? this.props.href : 'javascript:;', icon = this.props.icon ? : '', - className = (this.props.button ? 'button-block button-' + this.props.button : 'button-text'); + className = (this.props.button ? 'button-block button-' + this.props.button : 'button-text') + + (this.props.hidden ? ' hidden' : ''); return ( {this.props.icon ? icon : '' } diff --git a/js/page/home.js b/js/page/home.js index 081dca888..a99543a84 100644 --- a/js/page/home.js +++ b/js/page/home.js @@ -202,7 +202,7 @@ var Header = React.createClass({ render: function() { return (
- +
@@ -216,12 +216,19 @@ var topBarStyle = { }, balanceStyle = { 'marginRight': '5px' +}, +closeIconStyle = { + 'color': '#ff5155' }; var TopBar = React.createClass({ + onClose: function() { + window.location.href = "?start"; + }, getInitialState: function() { return { - balance: 0 + balance: 0, + showClose: /linux/i.test(navigator.userAgent) // @TODO: find a way to use getVersionInfo() here without messy state management }; }, componentDidMount: function() { @@ -241,6 +248,8 @@ var TopBar = React.createClass({ { ' ' } + { ' ' } + ); } @@ -255,4 +264,4 @@ var HomePage = React.createClass({
); } -}); \ No newline at end of file +}); diff --git a/js/page/start.js b/js/page/start.js new file mode 100644 index 000000000..86092bb76 --- /dev/null +++ b/js/page/start.js @@ -0,0 +1,13 @@ +var StartPage = React.createClass({ + componentWillMount: function() { + lbry.stop(); + }, + render: function() { + return ( +
+

LBRY is not running

+ +
+ ); + } +}); \ No newline at end of file