react-toolbox/components/app_bar/AppBar.js

37 lines
855 B
JavaScript
Raw Normal View History

import React from 'react';
2016-05-15 14:23:55 +03:00
import { themr } from 'react-css-themr';
import classnames from 'classnames';
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);
return (
2015-10-30 17:38:15 +03:00
<header className={className} data-react-toolbox='app-bar'>
{props.children}
</header>
);
};
AppBar.propTypes = {
children: React.PropTypes.node,
2015-10-28 13:23:45 +03:00
className: React.PropTypes.string,
fixed: React.PropTypes.bool,
2016-05-15 14:23:55 +03:00
flat: React.PropTypes.bool,
theme: React.PropTypes.shape({
appBar: React.PropTypes.string.isRequired,
fixed: React.PropTypes.string.isRequired,
flat: React.PropTypes.string.isRequired
})
};
AppBar.defaultProps = {
2015-10-28 13:23:45 +03:00
className: '',
fixed: false,
flat: false
};
2016-05-15 14:23:55 +03:00
export default themr('ToolboxAppBar')(AppBar);