0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 15:12:43 +00:00

Trying to get it working

This commit is contained in:
Scott Tolksdorf
2017-03-21 00:09:37 -04:00
parent 20371a8b3d
commit ee1827eab0
4 changed files with 33 additions and 7 deletions

View File

@@ -2,7 +2,12 @@ var React = require('react');
var Nav = require('naturalcrit/nav/nav.jsx'); var Nav = require('naturalcrit/nav/nav.jsx');
module.exports = function(props){ module.exports = function(props){
return <Nav.item newTab={true} href='https://github.com/stolksdorf/homebrewery/issues' color='red' icon='fa-bug'> return <Nav.item
{...props}
newTab={true}
href='https://github.com/stolksdorf/homebrewery/issues'
color='red'
icon='fa-bug'>
report issue report issue
</Nav.item> </Nav.item>
}; };

View File

@@ -47,7 +47,7 @@ const NewPage = React.createClass({
<Nav.item color='purple' icon='fa-file-pdf-o' onClick={Actions.localPrint}> <Nav.item color='purple' icon='fa-file-pdf-o' onClick={Actions.localPrint}>
get PDF get PDF
</Nav.item> </Nav.item>
<Items.Issue /> <Items.Issue collaspe={true} />
<Items.Account /> <Items.Account />
</Nav.section> </Nav.section>
</Navbar> </Navbar>

View File

@@ -38,28 +38,29 @@ var Nav = {
href : null, href : null,
newTab : false, newTab : false,
onClick : function(){}, onClick : function(){},
color : null color : null,
collaspe : false
}; };
}, },
handleClick : function(){ handleClick : function(){
this.props.onClick(); this.props.onClick();
}, },
render : function(){ render : function(){
var classes = cx('navItem', this.props.color, this.props.className); var classes = cx('navItem', this.props.color, this.props.className, {collaspe : this.props.collaspe});
var icon; var icon;
if(this.props.icon) icon = <i className={'fa ' + this.props.icon} />; if(this.props.icon) icon = <i className={'fa ' + this.props.icon} />;
const props = _.omit(this.props, ['newTab']); const props = _.omit(this.props, ['newTab', 'collaspe']);
if(this.props.href){ if(this.props.href){
return <a {...props} className={classes} target={this.props.newTab ? '_blank' : '_self'} > return <a {...props} className={classes} target={this.props.newTab ? '_blank' : '_self'} >
{this.props.children} <span>{this.props.children}</span>
{icon} {icon}
</a> </a>
}else{ }else{
return <div {...props} className={classes} onClick={this.handleClick} > return <div {...props} className={classes} onClick={this.handleClick} >
{this.props.children} <span>{this.props.children}</span>
{icon} {icon}
</div> </div>
} }

View File

@@ -49,10 +49,30 @@ nav{
color : white; color : white;
text-decoration : none; text-decoration : none;
text-transform : uppercase; text-transform : uppercase;
display: inline-block;
i{ i{
margin-left : 5px; margin-left : 5px;
font-size : 13px; font-size : 13px;
} }
&.collaspe{
//width : 60px;
overflow: hidden;
background-color: red;
span{
white-space: nowrap;
width : 0%;
display: inline-block;
overflow: hidden;
visibility: hidden;
}
&:hover{
span{
visibility: visible;
width : auto;
}
}
}
&.tealLight:hover{ background-color : @tealLight }; &.tealLight:hover{ background-color : @tealLight };
&.teal:hover{ background-color : @teal }; &.teal:hover{ background-color : @teal };
&.greenLight:hover{ background-color : @greenLight }; &.greenLight:hover{ background-color : @greenLight };