-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Convert the Snackbar
component to TypeScript
#45472
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Hi @ciampo, Thanks, Marco! |
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.
THank you @kienstra for your work here!
I've left a few comments, I'll take another look at the code (including Storybook) once they've been addressed
Let's leave the work on the README last, so that we can sync it with whatever updates have been made to the component.
Thanks a lot for reviewing this, Marco! I'll apply your suggestions today. |
…dex.tsx Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
…pes.ts Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
Thanks to Marco's suggestion, as spokenMessage comes from getNotices(), not React.
Move Snackbar to the bottom of CHANGELOG > Internal
Hi @ciampo, |
Also, I'll be out until Tuesday, November 8th. |
Hi @ciampo, Thanks for your huge amount of patience on my PRs 😄 |
Hey @kienstra , I've been partially AFK last week and will be a bit slow to respond this week too — but I'll definitely get back to you! |
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.
Just a few tweaks, and then we're good to merge! Thank you 🙏
…ADME.md Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
…ADME.md Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
Thanks, @ciampo! Just applied your suggestions. No hurry responding, thanks for responding when you're AFK. |
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.
LGTM 🚀
Thank you for your work on this one!
Thanks so much, Marco! You're so patient. |
What?
Convert the
Snackbar
component to TypeScriptWhy?
As part of an effort to convert
@wordpress/components
to TypeScriptHow?
Mainly by adding types to the
Snackbar
andSnackbarList
componentsTesting Instructions
npm run storybook:dev
Screenshots or screencast
Follow-up
SnackbarList
is not very well-documented (it doesn't even have a README) and prior to this PR, didn't have Storybook examples either. We should re-organize the folder structure, improve the docs and come up with a better Storybook strategy (e.g. use subcomponents and mergeSnackbar
andSnackbarList
in the same file)Notice
component to TypeScript and re-use its types inSnackbar
Snackbar
s in a list — the secondSnackbar
goes transparent but doesn't get fully removedSnackbar
to be dismissed works in a bit of an unexpected way (snackbar items don't get dismissed in orderisDismissible
prop from notice data is not taken into account bySnackbar
(although this could be on purpose)Snackbar
icon (passed through its icon prop) is not vertically centered, doesn't seem to work well with WordPress icons