From 2ec42aad2637bdb1bde1f96d06792ec2d890d6ce Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 7 Aug 2016 18:13:17 -0400 Subject: [PATCH] basic nav design, new title scheme, light page clean up --- js/app.js | 53 +++++++++++++++++++++++++++--------------- js/component/drawer.js | 19 ++++++++------- js/component/header.js | 15 +++++++++++- js/page/help.js | 23 +++++++++++++----- js/page/my_files.js | 4 +++- js/page/publish.js | 4 +++- js/page/settings.js | 1 - scss/_canvas.scss | 18 ++++++++++++-- scss/_global.scss | 2 ++ scss/_gui.scss | 10 +------- 10 files changed, 100 insertions(+), 49 deletions(-) diff --git a/js/app.js b/js/app.js index 53475dde9..7c59307e6 100644 --- a/js/app.js +++ b/js/app.js @@ -59,30 +59,45 @@ var App = React.createClass({ sessionStorage.setItem('drawerOpen', false); this.setState({ drawerOpen: false }); }, + getMainContent: function() + { + switch(this.state.viewingPage) + { + case 'home': + return ; + case 'settings': + return ; + case 'help': + return ; + case 'watch': + return ; + case 'report': + return ; + case 'files': + return ; + case 'start': + return ; + case 'claim': + return ; + case 'wallet': + return ; + case 'show': + return ; + case 'wallet': + return ; + case 'publish': + return ; + } + }, render: function() { - console.log(this.state); + var mainContent = this.getMainContent(); + return (
- +
- {(() => { - switch(this.state.viewingPage) - { - case 'home': return ; - case 'settings': return ; - case 'help': return ; - case 'watch': return ; - case 'report': return ; - case 'files': return ; - case 'start': return ; - case 'claim': return ; - case 'wallet': return ; - case 'show': return ; - case 'wallet': return ; - case 'publish': return ; - } - })()} + {mainContent}
); diff --git a/js/component/drawer.js b/js/component/drawer.js index d2c2de6f2..1d39640c7 100644 --- a/js/component/drawer.js +++ b/js/component/drawer.js @@ -1,6 +1,7 @@ var DrawerItem = React.createClass({ render: function() { - return + var isSelected = this.props.viewingPage == this.props.href.substr(2); + return } }); @@ -26,16 +27,16 @@ var Drawer = React.createClass({ return ( ); } diff --git a/js/component/header.js b/js/component/header.js index 217f0f755..084d122f7 100644 --- a/js/component/header.js +++ b/js/component/header.js @@ -1,9 +1,22 @@ var Header = React.createClass({ + getInitialState: function() { + return { + title: "LBRY" + }; + }, + componentWillMount: function() { + new MutationObserver(function(mutations) { + this.setState({ title: mutations[0].target.innerHTML }); + }.bind(this)).observe( + document.querySelector('title'), + { subtree: true, characterData: true, childList: true } + ); + }, render: function() { return ( ); } diff --git a/js/page/help.js b/js/page/help.js index af5d43a60..e60ca7df5 100644 --- a/js/page/help.js +++ b/js/page/help.js @@ -1,21 +1,32 @@ //@TODO: Customize advice based on OS var HelpPage = React.createClass({ + componentDidMount: function() { + document.title = "Help"; + }, render: function() { return (
-

Troubleshooting

-

Here are the most commonly encountered problems and what to try doing about them.

- -

Nothing seems to start downloading.

+

Read the FAQ

+

Our FAQ answers many common questions.

+

+

Get Live Help

+

+ Live help is available most hours in the #help channel of our Slack chat room. +

+

+ +

+

Common Issues

+

Nothing seems to start downloading.

If you can't download anything, including 'wonderfullife', try forwarding ports 4444 and 3333 on your firewall or router. If you can access 'wonderfullife' but not other content, it's possible the content is not longer hosted on the network.

-

Videos have trouble playing.

+

Videos have trouble playing.

Sometimes your video player will start the file while it's still empty. Try reloading the page after a few seconds and it may work. You should also see the file appear in your downloads folder (configured in settings).

A real fix for this is underway!

-

How do I turn LBRY off?

+

How do I turn LBRY off?

If you're on OS X you can find the app running in the notification area at the top right of your screen. Click the LBRY icon and choose Quit.

On Linux, you'll find a close button in the menu at the top right of LBRY.

diff --git a/js/page/my_files.js b/js/page/my_files.js index b6beb0b62..60c82fdb7 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -131,6 +131,9 @@ var MyFilesPage = React.createClass({ filesInfo: null, }; }, + componentDidMount: function() { + document.title = "My Files"; + }, componentWillMount: function() { this.updateFilesInfo(); }, @@ -185,7 +188,6 @@ var MyFilesPage = React.createClass({ } return (
-

My Files

{content}
diff --git a/js/page/publish.js b/js/page/publish.js index b7d2c0671..60a6a7184 100644 --- a/js/page/publish.js +++ b/js/page/publish.js @@ -241,6 +241,9 @@ var PublishPage = React.createClass({ isFee: feeEnabled }); }, + componentDidMount: function() { + document.title = "Publish"; + }, componentDidUpdate: function() { if (this.state.fileInfo && !this.state.tempFileReady) { // A file was chosen but the daemon hasn't finished processing it yet, i.e. it's loading, so @@ -261,7 +264,6 @@ var PublishPage = React.createClass({ render: function() { return (
-

Publish Content

LBRY Name

lbry:// diff --git a/js/page/settings.js b/js/page/settings.js index b8ef78cef..848b00e2a 100644 --- a/js/page/settings.js +++ b/js/page/settings.js @@ -77,7 +77,6 @@ var SettingsPage = React.createClass({ return (
-

Settings

Run on startup