0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 04:12:47 +00:00

Added conditional partial page rendering

This commit is contained in:
Scott Tolksdorf
2016-12-03 14:49:00 -05:00
parent bec417a325
commit 9285e53e55
6 changed files with 103 additions and 25 deletions

View File

@@ -50,13 +50,15 @@ var Nav = {
var icon;
if(this.props.icon) icon = <i className={'fa ' + this.props.icon} />;
const props = _.omit(this.props, ['newTab']);
if(this.props.href){
return <a {...this.props} className={classes} target={this.props.newTab ? '_blank' : '_self'} >
return <a {...props} className={classes} target={this.props.newTab ? '_blank' : '_self'} >
{this.props.children}
{icon}
</a>
}else{
return <div {...this.props} className={classes} onClick={this.handleClick} >
return <div {...props} className={classes} onClick={this.handleClick} >
{this.props.children}
{icon}
</div>