Add align prop to SubNavigation component

This commit is contained in:
Ray Schamp 2016-08-01 12:18:25 -04:00
parent 00c7dc9257
commit 025958fc24
2 changed files with 27 additions and 2 deletions

View file

@ -9,10 +9,21 @@ require('./subnavigation.scss');
*/ */
var SubNavigation = React.createClass({ var SubNavigation = React.createClass({
type: 'SubNavigation', type: 'SubNavigation',
getDefaultProps: function () {
return {
align: 'middle'
};
},
render: function () { render: function () {
var classes = classNames( var classes = classNames(
'sub-nav', [
this.props.className 'sub-nav',
this.props.className
],
{
'sub-nav-align-left': this.props.align === 'left',
'sub-nav-align-right': this.props.align === 'right'
}
); );
return ( return (
<div className={classes}> <div className={classes}>

View file

@ -53,4 +53,18 @@
} }
} }
} }
&.sub-nav-align-left {
justify-content: flex-start;
li {
&:first-child {
margin-left: 0;
}
}
}
&.sub-nav-align-right {
justify-content: flex-end;
}
} }