refactor: 디자인 작업 반영
parent
2fbc85bfa2
commit
012dd9c69c
@ -0,0 +1,59 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import Modal from '@mui/material/Modal';
|
||||
import { IconButton } from '@mui/material';
|
||||
import CloseOutlined from '@mui/icons-material/CloseOutlined';
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
const style = {
|
||||
position: 'relative',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
width: 650,
|
||||
minHeight: 530,
|
||||
bgcolor: 'background.paper',
|
||||
border: '2px solid #000',
|
||||
boxShadow: 24,
|
||||
p: 3
|
||||
};
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
const CmmModalB = ({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) => {
|
||||
const handleClose = () => {
|
||||
if (callback) callback();
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="modalGroup">
|
||||
{/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */}
|
||||
<Modal hideBackdrop={isBackdrop} open={open} aria-labelledby="modal-modal-title" aria-describedby="modal-modal-description">
|
||||
<MainCard
|
||||
sx={style}
|
||||
title={title}
|
||||
content
|
||||
secondary={
|
||||
<IconButton size="small" variant="rounded" onClick={handleClose}>
|
||||
<CloseOutlined fontSize="small" />
|
||||
</IconButton>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</MainCard>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
CmmModalB.propTypes = {
|
||||
isBackdrop: PropTypes.bool,
|
||||
open: PropTypes.bool,
|
||||
title: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
setOpen: PropTypes.func,
|
||||
callback: PropTypes.func
|
||||
};
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
export default CmmModalB;
|
Loading…
Reference in New Issue