-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(web-react): ModalHeader hide close button prop DS-1063
- New prop for ModalHeader to hide the close button - New prop for disable escape key to close the modal - Added new demo with those new props
- Loading branch information
1 parent
8e6e93a
commit 3e1cd5d
Showing
10 changed files
with
185 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/web-react/src/components/Modal/demo/ModalHiddenCloseButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useState } from 'react'; | ||
import { Button } from '../../Button'; | ||
import Modal from '../Modal'; | ||
import ModalBody from '../ModalBody'; | ||
import ModalDialog from '../ModalDialog'; | ||
import ModalFooter from '../ModalFooter'; | ||
import ModalHeader from '../ModalHeader'; | ||
|
||
const ModalHiddenCloseButton = () => { | ||
const [isOpen, setOpen] = useState(false); | ||
const toggleModal = () => setOpen(!isOpen); | ||
const handleClose = () => setOpen(false); | ||
|
||
return ( | ||
<> | ||
<Button onClick={toggleModal}>Open Modal</Button> | ||
|
||
<Modal | ||
id="example-hidden-close-button" | ||
isOpen={isOpen} | ||
onClose={handleClose} | ||
closeOnBackdropClick={false} | ||
closeOnEscapeKeyDown={false} | ||
> | ||
<ModalDialog> | ||
<ModalHeader id="example-hidden-close-button" hideCloseButton> | ||
Modal Title | ||
</ModalHeader> | ||
<ModalBody> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam at excepturi laudantium magnam mollitia | ||
perferendis reprehenderit, voluptate. Cum delectus dicta ducimus eligendi excepturi natus perferendis | ||
provident unde. Eveniet, iste, molestiae? | ||
</p> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button onClick={handleClose}>Primary action</Button> | ||
<Button color="secondary" onClick={handleClose}> | ||
Secondary action | ||
</Button> | ||
</ModalFooter> | ||
</ModalDialog> | ||
</Modal> | ||
</> | ||
); | ||
}; | ||
|
||
export default ModalHiddenCloseButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters