-
Notifications
You must be signed in to change notification settings - Fork 2k
Add a wrapper for premium blocks #33723
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
Conversation
| padding: 10px; | ||
| } | ||
|
|
||
| .upgrade-nudge { |
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 styles are duplicated from the component in Calypso :(
| @@ -0,0 +1,28 @@ | |||
| /** | |||
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.
This is essentially a duplicate of https://wpcalypso.wordpress.com/devdocs/blocks/upgrade-nudge
| { translate( 'To gain access to this block.' ) } | ||
| </span> | ||
| </div> | ||
| <button className="upgrade-nudge__button">{ translate( 'Upgrade' ) }</button> |
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.
We should reuse the component at the very least.
| if ( name === 'jetpack/simple-payments' ) { | ||
| return { | ||
| ...settings, | ||
| edit: wrapPremiumBlocks( settings.edit ), |
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.
Wrapping the block in another component seems like an elegant way of creating a consistent experience for all premium blocks.
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.
Yep, I like that approach 👍
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
|
Merged this work in Automattic/jetpack#12823 |
Changes proposed in this Pull Request
Testing instructions
This is tricky to test