-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate and simplify the modal API #949
Conversation
🦋 Changeset detectedLatest commit: 00e30a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/A1qRoirkF8aN3CbD6CTNqg6Vy7CS |
87a1bc5
to
e72cdc8
Compare
e72cdc8
to
0e6909e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! 🤩
Just added a few initial comments as I went through the code. It looks good generally, I like that this will be streamlining how we use modals and ensure accessibility 🙌
packages/circuit-ui/components/NotificationModal/NotificationModal.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/NotificationModal/NotificationModal.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/NotificationModal/NotificationModal.tsx
Outdated
Show resolved
Hide resolved
cbd432c
to
ae9d371
Compare
ae9d371
to
dc17cc7
Compare
dc17cc7
to
b23b472
Compare
Codecov Report
@@ Coverage Diff @@
## next #949 +/- ##
==========================================
+ Coverage 90.68% 90.81% +0.13%
==========================================
Files 162 160 -2
Lines 2610 2647 +37
Branches 749 766 +17
==========================================
+ Hits 2367 2404 +37
Misses 218 218
Partials 25 25
|
b23b472
to
8918435
Compare
a4939de
to
6040eda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! Just a few tiny comments 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it this way! And it's such an incredible improvement ❤️
I'm super sorry about the merge conflicts, and happy to handle them if you'd like.
9c76ce2
to
00e30a1
Compare
Addresses DS-162.
Purpose
Circuit UI Web currently exports a number of modal-related components. Not all of these should be publicly exposed.
react-modal
to apply custom styles and add tracking. It is not accessible when used by itself and thus should be removed from the exports.useModal
). The ModalProvider keeps track of the open modals (we need to add support for multiple, stacked modals), prevents scrolling of the page when a modal is open, sets the app element and renders it, and takes care of any other global logic.Approach and changes
Modal
,ModalWrapper
,ModalHeader
,ModalFooter
,ModalContext
, andModalConsumer
componentsuseStack
hook to support multiple, stacked modals (this can be reused by the NotificationToast component)useModal
hooks to render different types of modals (such as the upcoming NotificationModal Add notification modal #994)Definition of done