react-toolbox/components/layout/Panel.js

33 lines
734 B
JavaScript
Raw Normal View History

import React from 'react';
2016-04-10 21:45:37 +03:00
import classnames from 'classnames';
2016-05-22 19:11:27 +03:00
import { themr } from 'react-css-themr';
2016-05-22 19:11:27 +03:00
const Panel = ({ children, className, scrollY, theme }) => {
const _className = classnames(theme.panel, {
[theme.scrollY]: scrollY
2016-04-10 21:45:37 +03:00
}, className);
2016-04-10 21:45:37 +03:00
return (
<div data-react-toolbox='panel' className={_className}>
{children}
</div>
);
};
Panel.propTypes = {
2016-04-10 21:45:37 +03:00
children: React.PropTypes.any,
className: React.PropTypes.string,
2016-05-22 19:11:27 +03:00
scrollY: React.PropTypes.bool,
theme: React.PropTypes.shape({
panel: React.PropTypes.string.isRequired,
scrollY: React.PropTypes.string.isRequired
})
};
Panel.defaultProps = {
2016-04-10 21:45:37 +03:00
className: '',
scrollY: false
};
2016-05-22 19:11:27 +03:00
export default themr('ToolboxLayout')(Panel);