-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
index.jsx
65 lines (55 loc) · 1.19 KB
/
index.jsx
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
// Externals
import PropTypes from 'prop-types';
import classNames from 'classnames';
// Material helpers
import { withStyles } from '@material-ui/core';
// Material components
import { Paper } from '@material-ui/core';
// Component styles
const styles = theme => {
return {
root: {
borderRadius: '4px'
},
squared: {
borderRadius: 0
},
outlined: {
border: `1px solid ${theme.palette.border}`
}
};
};
const CustomPaper = props => {
const { classes, className, outlined, squared, children, ...rest } = props;
const rootClassName = classNames(
{
[classes.root]: true,
[classes.squared]: squared,
[classes.outlined]: outlined
},
className
);
return (
<Paper
{...rest}
className={rootClassName}
>
{children}
</Paper>
);
};
CustomPaper.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
classes: PropTypes.object.isRequired,
elevation: PropTypes.number,
outlined: PropTypes.bool,
squared: PropTypes.bool
};
CustomPaper.defaultProps = {
squared: false,
outlined: true,
elevation: 0
};
export default withStyles(styles)(CustomPaper);