Break out menu into its own component
This commit is contained in:
parent
d6a432fe75
commit
2f8e5873f4
1 changed files with 22 additions and 14 deletions
36
js/gui.js
36
js/gui.js
|
@ -118,14 +118,6 @@ var topBarStyle = {
|
|||
'float': 'right'
|
||||
};
|
||||
|
||||
var menuStyle = {
|
||||
position: 'relative',
|
||||
top: '3px',
|
||||
marginLeft: '2px'
|
||||
}, menuItemStyle = {
|
||||
marginLeft: '3px'
|
||||
};
|
||||
|
||||
var TopBar = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {
|
||||
|
@ -143,17 +135,33 @@ var TopBar = React.createClass({
|
|||
render: function() {
|
||||
return (
|
||||
<span className='top-bar' style={topBarStyle}>
|
||||
<span style={balanceStyle}>
|
||||
<CreditAmount amount={this.state.balance}/>
|
||||
<span style={balanceStyle}>
|
||||
<CreditAmount amount={this.state.balance}/>
|
||||
</span>
|
||||
<Menu />
|
||||
</span>
|
||||
<span className='menu' style={menuStyle}>
|
||||
<Link href='#' icon="icon-gear" fadeIn={true} style={menuItemStyle} />
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var menuStyle = {
|
||||
position: 'relative',
|
||||
top: '3px',
|
||||
marginLeft: '2px'
|
||||
}, menuItemStyle = {
|
||||
marginLeft: '3px'
|
||||
};
|
||||
|
||||
|
||||
var Menu = React.createClass({
|
||||
render: function() {
|
||||
return (
|
||||
<span className='menu' style={menuStyle}>
|
||||
<Link href='#' icon="icon-gear" fadeIn={true} style={menuItemStyle} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//component/discover.js
|
||||
|
|
Loading…
Reference in a new issue