Add basics of Help page

This commit is contained in:
Alex Liebowitz 2016-04-20 06:28:13 -04:00
parent 5f64e0dbae
commit b5fcb77e22
4 changed files with 31 additions and 3 deletions

1
dist/index.html vendored
View file

@ -26,6 +26,7 @@
<script src="./js/component/splash.js"></script> <script src="./js/component/splash.js"></script>
<script src="./js/page/home.js"></script> <script src="./js/page/home.js"></script>
<script src="./js/page/settings.js"></script> <script src="./js/page/settings.js"></script>
<script src="./js/page/help.js"></script>
<script src="./js/app.js"></script> <script src="./js/app.js"></script>
<script src="./js/main.js"></script> <script src="./js/main.js"></script>
</body> </body>

View file

@ -5,9 +5,16 @@ var appStyles = {
}; };
var App = React.createClass({ var App = React.createClass({
getInitialState: function() { getInitialState: function() {
return { var query = window.location.search.slice(1);
viewingPage: window.location.search === '?settings' ? 'settings' : 'home' if (query == 'settings' || query == 'help') {
var viewingPage = query;
} else {
var viewingPage = 'home';
} }
return {
viewingPage: viewingPage
};
}, },
componentWillMount: function() { componentWillMount: function() {
lbry.checkNewVersionAvailable(function(isAvailable) { lbry.checkNewVersionAvailable(function(isAvailable) {
@ -45,6 +52,8 @@ var App = React.createClass({
var content = <HomePage />; var content = <HomePage />;
} else if (this.state.viewingPage == 'settings') { } else if (this.state.viewingPage == 'settings') {
var content = <SettingsPage />; var content = <SettingsPage />;
} else if (this.state.viewingPage == 'help') {
var content = <HelpPage />;
} }
return ( return (
<div style={appStyles}> <div style={appStyles}>

16
js/page/help.js Normal file
View file

@ -0,0 +1,16 @@
var HelpPage = React.createClass({
render: function() {
return (
<main>
<h1>Help</h1>
<p>Content will go here</p>
<h3>Subsection</h3>
<p>More content</p>
<p>Even more content</p>
<section>
<Link href="/" label="<< Return"/>
</section>
</main>
);
}
});

View file

@ -238,7 +238,9 @@ var TopBar = React.createClass({
<span style={balanceStyle}> <span style={balanceStyle}>
<CreditAmount amount={this.state.balance}/> <CreditAmount amount={this.state.balance}/>
</span> </span>
<Link href='/?settings' icon="icon-gear" /> <Link href='/?settings' icon='icon-gear' />
{ ' ' }
<Link href='/?help' icon='icon-question-circle' />
</span> </span>
); );
} }