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
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import * as React from 'react';
|
|
import Button from '@mui/joy/Button';
|
|
import Stack from '@mui/joy/Stack';
|
|
import Modal from '@mui/joy/Modal';
|
|
import ModalClose from '@mui/joy/ModalClose';
|
|
import ModalDialog from '@mui/joy/ModalDialog';
|
|
import DialogTitle from '@mui/joy/DialogTitle';
|
|
import DialogContent from '@mui/joy/DialogContent';
|
|
|
|
export default function LayoutModalDialog() {
|
|
const [layout, setLayout] = React.useState(undefined);
|
|
return (
|
|
<React.Fragment>
|
|
<Stack direction="row" spacing={1}>
|
|
<Button
|
|
variant="outlined"
|
|
color="neutral"
|
|
onClick={() => {
|
|
setLayout('center');
|
|
}}
|
|
>
|
|
Center
|
|
</Button>
|
|
<Button
|
|
variant="outlined"
|
|
color="neutral"
|
|
onClick={() => {
|
|
setLayout('fullscreen');
|
|
}}
|
|
>
|
|
Full screen
|
|
</Button>
|
|
</Stack>
|
|
<Modal open={!!layout} onClose={() => setLayout(undefined)}>
|
|
<ModalDialog layout={layout}>
|
|
<ModalClose />
|
|
<DialogTitle>Modal Dialog</DialogTitle>
|
|
<DialogContent>
|
|
<div>
|
|
This is a <code>{layout}</code> modal dialog. Press <code>esc</code> to
|
|
close it.
|
|
</div>
|
|
</DialogContent>
|
|
</ModalDialog>
|
|
</Modal>
|
|
</React.Fragment>
|
|
);
|
|
}
|