0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 12:52:42 +00:00

Merge branch 'collaspeNav' into snippets

This commit is contained in:
Scott Tolksdorf
2017-03-21 00:15:34 -04:00
6 changed files with 42 additions and 11 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

@@ -3,6 +3,7 @@ var Nav = require('naturalcrit/nav/nav.jsx');
module.exports = function(props){ module.exports = function(props){
return <Nav.item return <Nav.item
{...props}
className='patreon' className='patreon'
newTab={true} newTab={true}
href='https://www.patreon.com/stolksdorf' href='https://www.patreon.com/stolksdorf'

View File

@@ -24,10 +24,10 @@ const HomePage = React.createClass({
renderNavbar : function(){ renderNavbar : function(){
return <Navbar> return <Navbar>
<Nav.section> <Nav.section>
<PatreonNavItem /> <PatreonNavItem collaspe={true} />
<IssueNavItem /> <IssueNavItem collaspe={true} />
<Nav.item newTab={true} href='/changelog' color='purple' icon='fa-file-text-o'> <Nav.item newTab={true} href='/changelog' color='purple' icon='fa-star' collaspe={true}>
Changelog What's new
</Nav.item> </Nav.item>
<RecentNavItem.both /> <RecentNavItem.both />
<AccountNavItem /> <AccountNavItem />

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

@@ -1,3 +1,4 @@
nav{ nav{
background-color : #333; background-color : #333;
.navContent{ .navContent{
@@ -41,6 +42,7 @@ nav{
} }
.navItem{ .navItem{
.animate(background-color); .animate(background-color);
display : inline-block;
padding : 8px 12px; padding : 8px 12px;
cursor : pointer; cursor : pointer;
background-color : #333; background-color : #333;
@@ -53,6 +55,28 @@ nav{
margin-left : 5px; margin-left : 5px;
font-size : 13px; font-size : 13px;
} }
&.collaspe{
overflow : hidden;
i{
margin-left : 0px;
}
span{
display : inline-block;
visibility : hidden;
overflow : hidden;
width : 0px;
white-space : nowrap;
}
&:hover{
span{
visibility : visible;
width : auto;
}
i{
margin-left : 5px;
}
}
}
&.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 };