UNPKG

materialuiupgraded

Version:

Material-UI's workspace package

40 lines (34 loc) 1.11 kB
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { withStyles } from '@material-ui/core/styles'; const styles = theme => ({ root: { paddingTop: 80, flex: '1 1 100%', maxWidth: '100%', margin: '0 auto', paddingLeft: theme.spacing.unit * 2, paddingRight: theme.spacing.unit * 2, [theme.breakpoints.up('sm')]: { paddingLeft: theme.spacing.unit * 4, paddingRight: theme.spacing.unit * 4, maxWidth: 'calc(100% - 162px)', }, [theme.breakpoints.up('lg')]: { paddingLeft: theme.spacing.unit * 5, paddingRight: theme.spacing.unit * 9, maxWidth: 'calc(100% - 240px - 162px)', }, }, }); function AppContent(props) { const { className, classes, children } = props; return <main className={classNames(classes.root, className)}>{children}</main>; } AppContent.propTypes = { children: PropTypes.node.isRequired, classes: PropTypes.object.isRequired, className: PropTypes.string, }; export default withStyles(styles)(AppContent);