| 1 |
import { Fragment, useState } from 'react'; |
| 2 |
import { Button, Modal, ModalBody, ModalVariant } from '@patternfly/react-core'; |
| 3 |
|
| 4 |
export const ModalNoHeaderFooter: React.FunctionComponent = () => { |
| 5 |
const [isModalOpen, setIsModalOpen] = useState(false); |
| 6 |
|
| 7 |
const handleModalToggle = (_event: KeyboardEvent | React.MouseEvent) => { |
| 8 |
setIsModalOpen(!isModalOpen); |
| 9 |
}; |
| 10 |
|
| 11 |
return ( |
| 12 |
<Fragment> |
| 13 |
<Button variant="primary" onClick={handleModalToggle}> |
| 14 |
Show no header/footer modal |
| 15 |
</Button> |
| 16 |
<Modal |
| 17 |
variant={ModalVariant.large} |
| 18 |
isOpen={isModalOpen} |
| 19 |
aria-label="No header/footer modal" |
| 20 |
aria-describedby="modal-no-header-description" |
| 21 |
onClose={handleModalToggle} |
| 22 |
> |
| 23 |
<ModalBody> |
| 24 |
<span id="modal-no-header-description"> |
| 25 |
When static text describing the modal is available outside of the modal header, it can be given an ID that |
| 26 |
is then passed in as the modal's aria-describedby value. |
| 27 |
</span> |
| 28 |
<br /> |
| 29 |
<br /> |
| 30 |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore |
| 31 |
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo |
| 32 |
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla |
| 33 |
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id |
| 34 |
est laborum. |
| 35 |
</ModalBody> |
| 36 |
</Modal> |
| 37 |
</Fragment> |
| 38 |
); |
| 39 |
}; |