2016-06-04 00:44:33 +03:00
|
|
|
import React, { PropTypes } 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-29 20:59:17 +03:00
|
|
|
import { LAYOUT } from '../identifiers.js';
|
2016-02-09 01:07:12 +03:00
|
|
|
|
2016-10-11 15:23:36 +03:00
|
|
|
const Panel = ({ children, className, onScroll, scrollY, theme }) => {
|
2016-05-22 19:11:27 +03:00
|
|
|
const _className = classnames(theme.panel, {
|
|
|
|
[theme.scrollY]: scrollY
|
2016-04-10 21:45:37 +03:00
|
|
|
}, className);
|
2016-02-09 01:07:12 +03:00
|
|
|
|
2016-04-10 21:45:37 +03:00
|
|
|
return (
|
2016-10-11 15:23:36 +03:00
|
|
|
<div data-react-toolbox='panel' onScroll={onScroll} className={_className}>
|
2016-04-10 21:45:37 +03:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
2016-02-09 01:07:12 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
Panel.propTypes = {
|
2016-06-04 00:44:33 +03:00
|
|
|
children: PropTypes.any,
|
|
|
|
className: PropTypes.string,
|
2016-10-11 15:23:36 +03:00
|
|
|
onScroll: PropTypes.func,
|
2016-06-04 00:44:33 +03:00
|
|
|
scrollY: PropTypes.bool,
|
|
|
|
theme: PropTypes.shape({
|
|
|
|
panel: PropTypes.string,
|
|
|
|
scrollY: PropTypes.string
|
2016-05-22 19:11:27 +03:00
|
|
|
})
|
2016-02-09 01:07:12 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
Panel.defaultProps = {
|
2016-04-10 21:45:37 +03:00
|
|
|
className: '',
|
|
|
|
scrollY: false
|
2016-02-09 01:07:12 +03:00
|
|
|
};
|
|
|
|
|
2016-05-29 20:59:17 +03:00
|
|
|
export default themr(LAYOUT)(Panel);
|
|
|
|
export { Panel };
|