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
30
js/gui.js
30
js/gui.js
|
@ -118,14 +118,6 @@ var topBarStyle = {
|
||||||
'float': 'right'
|
'float': 'right'
|
||||||
};
|
};
|
||||||
|
|
||||||
var menuStyle = {
|
|
||||||
position: 'relative',
|
|
||||||
top: '3px',
|
|
||||||
marginLeft: '2px'
|
|
||||||
}, menuItemStyle = {
|
|
||||||
marginLeft: '3px'
|
|
||||||
};
|
|
||||||
|
|
||||||
var TopBar = React.createClass({
|
var TopBar = React.createClass({
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
|
@ -146,14 +138,30 @@ var TopBar = React.createClass({
|
||||||
<span style={balanceStyle}>
|
<span style={balanceStyle}>
|
||||||
<CreditAmount amount={this.state.balance}/>
|
<CreditAmount amount={this.state.balance}/>
|
||||||
</span>
|
</span>
|
||||||
<span className='menu' style={menuStyle}>
|
<Menu />
|
||||||
<Link href='#' icon="icon-gear" fadeIn={true} style={menuItemStyle} />
|
|
||||||
</span>
|
|
||||||
</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
|
//component/discover.js
|
||||||
|
|
Loading…
Add table
Reference in a new issue