-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add Confirm Dialog component #5361
Conversation
Mimicking the Gutenberg's experimental Confirm Dialog component, so it's easier to replace later.
Exporting the new component and the new related hook.
Codecov Report
@@ Coverage Diff @@
## trunk #5361 +/- ##
=========================================
Coverage 40.81% 40.81%
- Complexity 8638 8639 +1
=========================================
Files 285 285
Lines 29119 29131 +12
=========================================
+ Hits 11885 11891 +6
- Misses 17234 17240 +6
Continue to review full report at Codecov.
|
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.
Great PR! I just added some small suggestions.
assets/blocks/editor-components/confirm-dialog/confirm-dialog.js
Outdated
Show resolved
Hide resolved
assets/blocks/editor-components/confirm-dialog/confirm-dialog.js
Outdated
Show resolved
Hide resolved
assets/blocks/editor-components/confirm-dialog/confirm-dialog.js
Outdated
Show resolved
Hide resolved
onConfirm, | ||
onCancel, | ||
} ) => { | ||
useConfirmOnEnter( isOpen, onConfirm ); |
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.
Nice code separation here! 😀
*/ | ||
import ConfirmDialog from './confirm-dialog'; | ||
|
||
describe( '<ConfirmDialog />', () => { |
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.
Great tests!
Co-authored-by: Renatho De Carli Rosa <renatho@gmail.com>
…o add/confirm-dialog
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.
The changes look great to me!
I just added a small comment about the hook, but I'm already approving it in case you don't agree.
About the styles, maybe we could merge it and tweak the styles in another PR. Unless you really prefer to wait and fix the styles before merging it. 😉
assets/blocks/editor-components/confirm-dialog/use-confirm-dialog-props.js
Outdated
Show resolved
Hide resolved
… to ConfirmDialog
Inspired by the Gutenberg's experimental Confirm Dialog component.
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.
🚀
Changes proposed in this Pull Request
confirm()
native function;Testing instructions
Check "Testing Instructions" on the PR 1537-gh-Automattic/sensei-pro