Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import * as React from 'react';
|
|
import Box from '@mui/material/Box';
|
|
import Button from '@mui/material/Button';
|
|
import Typography from '@mui/material/Typography';
|
|
import Modal from '@mui/material/Modal';
|
|
|
|
const style = {
|
|
position: 'absolute',
|
|
top: '50%',
|
|
left: '50%',
|
|
transform: 'translate(-50%, -50%)',
|
|
width: 400,
|
|
bgcolor: 'background.paper',
|
|
border: '2px solid #000',
|
|
boxShadow: 24,
|
|
p: 4,
|
|
};
|
|
|
|
export default function BasicModal() {
|
|
const [open, setOpen] = React.useState(false);
|
|
const handleOpen = () => setOpen(true);
|
|
const handleClose = () => setOpen(false);
|
|
|
|
return (
|
|
<div>
|
|
<Button onClick={handleOpen}>Open modal</Button>
|
|
<Modal
|
|
open={open}
|
|
onClose={handleClose}
|
|
aria-labelledby="modal-modal-title"
|
|
aria-describedby="modal-modal-description"
|
|
>
|
|
<Box sx={style}>
|
|
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
Text in a modal
|
|
</Typography>
|
|
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
|
|
</Typography>
|
|
</Box>
|
|
</Modal>
|
|
</div>
|
|
);
|
|
}
|