2016-05-28 18:00:42 +03:00
|
|
|
import React, { PropTypes } from 'react';
|
2016-05-15 14:23:55 +03:00
|
|
|
import classnames from 'classnames';
|
2016-05-15 14:36:13 +03:00
|
|
|
import { themr } from 'react-css-themr';
|
2016-05-28 18:00:42 +03:00
|
|
|
import { APP_BAR } from '../identifiers.js';
|
2015-10-28 03:49:22 +03:00
|
|
|
|
2016-05-15 14:23:55 +03:00
|
|
|
const AppBar = ({ theme, ...props }) => {
|
|
|
|
const className = classnames(theme.appBar, {
|
|
|
|
[theme.fixed]: props.fixed,
|
|
|
|
[theme.flat]: props.flat
|
2015-11-25 22:30:28 +03:00
|
|
|
}, props.className);
|
2015-10-28 03:49:22 +03:00
|
|
|
|
|
|
|
return (
|
2015-10-30 17:38:15 +03:00
|
|
|
<header className={className} data-react-toolbox='app-bar'>
|
2015-10-28 03:49:22 +03:00
|
|
|
{props.children}
|
|
|
|
</header>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
AppBar.propTypes = {
|
2016-05-28 18:00:42 +03:00
|
|
|
children: PropTypes.node,
|
|
|
|
className: PropTypes.string,
|
|
|
|
fixed: PropTypes.bool,
|
|
|
|
flat: PropTypes.bool,
|
|
|
|
theme: PropTypes.shape({
|
|
|
|
appBar: PropTypes.string,
|
|
|
|
fixed: PropTypes.string,
|
|
|
|
flat: PropTypes.string
|
2016-05-15 14:23:55 +03:00
|
|
|
})
|
2015-10-28 03:49:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
AppBar.defaultProps = {
|
2015-10-28 13:23:45 +03:00
|
|
|
className: '',
|
|
|
|
fixed: false,
|
|
|
|
flat: false
|
2015-10-28 03:49:22 +03:00
|
|
|
};
|
|
|
|
|
2016-05-28 18:00:42 +03:00
|
|
|
export default themr(APP_BAR)(AppBar);
|
|
|
|
export { AppBar };
|