-
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): Introduce optional uniform appearance of
Modal
#DS…
…-1091 Add `spirit-feature-modal-enable-uniform-dialog` feature class to enable uniform appearance of `Modal` across all breakpoints. Current mobile design is then accessible using the `isDockedOnMobile` property.
- Loading branch information
1 parent
23ccda6
commit 531a9d9
Showing
12 changed files
with
126 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
64 changes: 64 additions & 0 deletions
64
packages/web-react/src/components/Modal/demo/ModalUniformModalOnMobile.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,64 @@ | ||
import React, { useState } from 'react'; | ||
import { Button, Modal, ModalBody, ModalDialog, ModalFooter, ModalHeader } from '../..'; | ||
|
||
const ModalDefault = () => { | ||
const [isFirstOpen, setFirstOpen] = useState(false); | ||
const [isSecondOpen, setSecondOpen] = useState(false); | ||
|
||
const toggleFirstModal = () => setFirstOpen(!isFirstOpen); | ||
const toggleSecondModal = () => setSecondOpen(!isSecondOpen); | ||
|
||
const handleFirstClose = () => setFirstOpen(false); | ||
const handleSecondClose = () => setSecondOpen(false); | ||
|
||
return ( | ||
<> | ||
{/* Set `display: contents` to enable parent stack layout. */} | ||
<div className="spirit-feature-modal-enable-uniform-dialog" style={{ display: 'contents' }}> | ||
<Button onClick={toggleFirstModal}>Open Modal</Button> | ||
|
||
<Modal id="example-uniform" isOpen={isFirstOpen} onClose={handleFirstClose}> | ||
<ModalDialog> | ||
<ModalHeader>Modal Title</ModalHeader> | ||
<ModalBody> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam at excepturi laudantium magnam | ||
mollitia mollitia perferendis reprehenderit, voluptate. Cum delectus dicta ducimus eligendi excepturi | ||
natus provident unde. Eveniet, iste, molestiae? | ||
</p> | ||
</ModalBody> | ||
<ModalFooter description="Optional description"> | ||
<Button onClick={handleFirstClose}>Primary action</Button> | ||
<Button color="secondary" onClick={handleFirstClose}> | ||
Secondary action | ||
</Button> | ||
</ModalFooter> | ||
</ModalDialog> | ||
</Modal> | ||
|
||
<Button onClick={toggleSecondModal}>Open Docked Modal (mobile only)</Button> | ||
|
||
<Modal id="example-docked" isOpen={isSecondOpen} onClose={handleSecondClose}> | ||
<ModalDialog isDockedOnMobile isExpandedOnMobile> | ||
<ModalHeader>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 description="Optional description"> | ||
<Button onClick={handleSecondClose}>Primary action</Button> | ||
<Button color="secondary" onClick={handleSecondClose}> | ||
Secondary action | ||
</Button> | ||
</ModalFooter> | ||
</ModalDialog> | ||
</Modal> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ModalDefault; |
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
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