forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanel.js
More file actions
34 lines (29 loc) · 787 Bytes
/
Panel.js
File metadata and controls
34 lines (29 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import classnames from 'classnames';
import { themr } from 'react-css-themr';
import { LAYOUT } from '../identifiers.js';
const Panel = ({ children, className, scrollY, theme }) => {
const _className = classnames(theme.panel, {
[theme.scrollY]: scrollY
}, className);
return (
<div data-react-toolbox='panel' className={_className}>
{children}
</div>
);
};
Panel.propTypes = {
children: React.PropTypes.any,
className: React.PropTypes.string,
scrollY: React.PropTypes.bool,
theme: React.PropTypes.shape({
panel: React.PropTypes.string.isRequired,
scrollY: React.PropTypes.string.isRequired
})
};
Panel.defaultProps = {
className: '',
scrollY: false
};
export default themr(LAYOUT)(Panel);
export { Panel };