2018-01-30 11:53:12 -05:00
|
|
|
const classNames = require('classnames');
|
|
|
|
const PropTypes = require('prop-types');
|
|
|
|
const React = require('react');
|
2015-10-29 12:35:33 -04:00
|
|
|
|
|
|
|
require('./subnavigation.scss');
|
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
/*
|
2016-01-14 10:25:03 -05:00
|
|
|
* Container for a custom, horizontal list of navigation elements
|
|
|
|
* that can be displayed within a view or component.
|
|
|
|
*/
|
2018-01-30 11:53:12 -05:00
|
|
|
const SubNavigation = props => (
|
|
|
|
<div
|
|
|
|
className={classNames(
|
2016-08-01 12:18:25 -04:00
|
|
|
[
|
|
|
|
'sub-nav',
|
2018-01-30 11:53:12 -05:00
|
|
|
props.className
|
2016-08-01 12:18:25 -04:00
|
|
|
],
|
|
|
|
{
|
2018-01-30 11:53:12 -05:00
|
|
|
'sub-nav-align-left': props.align === 'left',
|
|
|
|
'sub-nav-align-right': props.align === 'right'
|
2016-08-01 12:18:25 -04:00
|
|
|
}
|
2018-01-30 11:53:12 -05:00
|
|
|
)}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
SubNavigation.propTypes = {
|
|
|
|
align: PropTypes.string,
|
|
|
|
children: PropTypes.node,
|
|
|
|
className: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
SubNavigation.defaultProps = {
|
|
|
|
align: 'middle'
|
|
|
|
};
|
2015-10-29 12:35:33 -04:00
|
|
|
|
|
|
|
module.exports = SubNavigation;
|