fix: image view 적용중
parent
bee57926ad
commit
0f1d8705ca
@ -0,0 +1,60 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import Modal from '@mui/material/Modal';
|
||||
import { Grid, 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: 1050,
|
||||
minHeight: 500,
|
||||
bgcolor: 'background.paper',
|
||||
border: '2px solid #000',
|
||||
boxShadow: 24,
|
||||
p: 3
|
||||
};
|
||||
|
||||
const CmmImgViewModal = ({ isBackdrop = false, open, setOpen, title, imgUrl, imgName }) => {
|
||||
const handleClose = () => {
|
||||
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>
|
||||
}
|
||||
>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item xs={12}>
|
||||
<img src={imgUrl} srcSet={`${imgUrl}?w=400&h=400&fit=crop&auto=format&dpr=2 2x`} alt={imgName} loading="lazy" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</MainCard>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
CmmImgViewModal.propTypes = {
|
||||
isBackdrop: PropTypes.bool,
|
||||
open: PropTypes.bool,
|
||||
setOpen: PropTypes.func,
|
||||
title: PropTypes.string,
|
||||
imgUrl: PropTypes.object,
|
||||
imgName: PropTypes.string
|
||||
};
|
||||
|
||||
export default CmmImgViewModal;
|
Loading…
Reference in New Issue