Repository navigation
UpgradeNudge: Extract generic BlockNudge component - #13437
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
c37c3d8 to
65aac98
Compare
This is an automated check which relies on |
|
ockham, Your synced wpcom patch D32559-code has been updated. |
839d7ef to
860a6f8
Compare
| autosaveAndRedirect: async event => { | ||
| event.preventDefault(); // Don't follow the href before autosaving | ||
| onClick( blockName ); | ||
| await dispatch( 'core/editor' ).autosave(); |
There was a problem hiding this comment.
One bit of UX I'm missing here is an indication that it's doing something while it autosaves. It's very strange to click a button/link and have the browser not apparently navigating.
We get the save indicator for the editor, but there's nothing that obviously links the actions together.
We can explore that in a future PR, this provides a good base.
Related to the above, we can end up awaiting many promises here… Along with a loading state, we can prevent entering this block repeatedly. Again, this is not a regression and moving this will allow us to iterate on the nudge while other work proceeds in parallel.
| } | ||
| .jetpack-upgrade-nudge__icon { | ||
| align-self: center; | ||
| background: var( --color-plan-premium ); |
There was a problem hiding this comment.
Interestingly for recurring payments this could be --color-plan-personal but I think we can instead just figure out plan icons later down the road than complicate this too much now.
jeherve
left a comment
There was a problem hiding this comment.
This works well in my tests, and makes sense. 👍
Extracted from #13394, to make that PR smaller.
Changes proposed in this Pull Request:
BlockNudgecomponent fromUpgradeNudge, and implement the latter by using it.Is this a new feature or does it add/remove features to an existing part of Jetpack?
Nope.
Testing instructions:
Use the Simple Payments block to verify that the Upgrade Nudge works as before:
yarn build), and start Docker (yarn docker:up)docker/mu-plugins, e.g. a newly created0-blocks-upgrade.php(needs to start with<?php):add_filter( 'jetpack_block_editor_enable_upgrade_nudge', '__return_true' );Proposed changelog entry for your changes:
BlockNudgecomponent fromUpgradeNudge, and implement the latter by using it.