All files / src/CollapseButtons Paper.js

50% Statements 3/6
100% Branches 0/0
0% Functions 0/2
60% Lines 3/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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              12x                         12x                         12x            
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import cx from 'classnames';
 
const useStyles = makeStyles(theme => ({
  paper: {
    padding: theme.spacing(2.5),
    margin: theme.spacing(1.25),
    borderRadius: 'unset',
  },
  mobileView: {
    display: 'flex',
    flexDirection: 'column',
    columnCount: 'unset',
  },
}));
 
const CustomPaper = ({ isMobileView, children }) => {
  const classes = useStyles();
  return (
    <Paper
      classes={{
        root: cx(classes.paper, { [classes.mobileView]: isMobileView }),
      }}
    >
      <Grid container>{children}</Grid>
    </Paper>
  );
};
 
CustomPaper.propTypes = {
  isMobileView: PropTypes.bool,
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
};
 
export default CustomPaper;