From d6a432fe75128e2a2c48409af905bc33234525ed Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Sun, 27 Mar 2016 01:41:36 -0400 Subject: [PATCH] Move top bar into its own component --- js/gui.js | 65 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/js/gui.js b/js/gui.js index 2d45c49ee..067af2e21 100644 --- a/js/gui.js +++ b/js/gui.js @@ -69,12 +69,6 @@ var creditAmountStyle = { }, estimateStyle = { marginLeft : '5px', color: '#aaa', -}, menuStyle = { - position: 'relative', - top: '3px', - marginLeft: '2px' -}, menuItemStyle = { - marginLeft: '3px' }; var CreditAmount = React.createClass({ @@ -84,20 +78,14 @@ var CreditAmount = React.createClass({ render: function() { var formattedAmount = lbry.formatCredits(this.props.amount); return ( - - - {formattedAmount} - { this.props.isEstimate ? (est) : null } - - - - + + {formattedAmount} + { this.props.isEstimate ? (est) : null } ); } }); - //component/header.js var logoStyle = { padding: '48px 12px', @@ -105,7 +93,7 @@ var logoStyle = { maxHeight: '80px', }, balanceStyle = { - float: 'right', +// float: 'right', marginTop: '3px' }, imgStyle = { //@TODO: remove this, img should be properly scaled once size is settled @@ -113,6 +101,32 @@ var logoStyle = { }; var Header = React.createClass({ + render: function() { + return ( +
+ +
+ +
+
+ ); + } +}); + + +var topBarStyle = { + 'float': 'right' +}; + +var menuStyle = { + position: 'relative', + top: '3px', + marginLeft: '2px' +}, menuItemStyle = { + marginLeft: '3px' +}; + +var TopBar = React.createClass({ getInitialState: function() { return { balance: 0 @@ -125,20 +139,23 @@ var Header = React.createClass({ }); }.bind(this)); }, + render: function() { return ( -
- - - -
- -
-
+ + + + + + + + ); } }); + + //component/discover.js var searchInputStyle = {