-
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, web-twig, web-react): Hide close button in Modal
- Loading branch information
1 parent
86ba5ff
commit 1f30daa
Showing
17 changed files
with
373 additions
and
53 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
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
Oops, something went wrong.