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
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { withStyles } from '@material-ui/core/styles';
import { Paper, Typography } from '@material-ui/core';
import styles from './papperStyle-jss';
function PaperSheet(props) {
const {
classes,
title,
desc,
children,
whiteBg,
noMargin,
colorMode,
overflowX
} = props;
return (
<div>
<Paper className={classNames(classes.root, noMargin && classes.noMargin, colorMode && classes.colorMode)} elevation={4}>
<Typography variant="h6" component="h2" className={classes.title}>
{title}
</Typography>
<Typography component="p" className={classes.description}>
{desc}
</Typography>
<section className={classNames(classes.content, whiteBg && classes.whiteBg, overflowX && classes.overflowX)}>
{children}
</section>
</Paper>
</div>
);
}
PaperSheet.propTypes = {
classes: PropTypes.object.isRequired,
title: PropTypes.string.isRequired,
desc: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
whiteBg: PropTypes.bool,
colorMode: PropTypes.bool,
noMargin: PropTypes.bool,
overflowX: PropTypes.bool,
};
PaperSheet.defaultProps = {
whiteBg: false,
noMargin: false,
colorMode: false,
overflowX: false
};
export default withStyles(styles)(PaperSheet);
|