Conversation
Also fix curly apostrophe syntax error in component strings.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
26758cf to
b2fb54b
Compare
There was a problem hiding this comment.
Pull request overview
This PR extracts the block theme notice from the ShareButtons component into a reusable BlockThemeNotice component and applies it to both the Sharing and Likes settings cards. The refactoring follows the DRY principle while also fixing a typo in the original text.
Changes:
- Created a new reusable
BlockThemeNoticecomponent with accompanying tests - Added
isLikeBlockAvailableto Redux state management (mirroring the existingisSharingBlockAvailablepattern) - Applied the block theme notice to the Likes settings card for users on block-based themes
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/plugins/jetpack/changelog/extract-block-theme-notice | Adds changelog entry for the enhancement |
| projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php | Adds isLikeBlockAvailable to Redux initial state following existing pattern |
| projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js | Adds isLikeBlockAvailable selector function |
| projects/plugins/jetpack/_inc/client/sharing/share-buttons.jsx | Refactors to use new BlockThemeNotice component, removes duplicated code |
| projects/plugins/jetpack/_inc/client/sharing/likes.jsx | Adds block theme notice to Likes settings |
| projects/plugins/jetpack/_inc/client/sharing/index.jsx | Connects isLikeBlockAvailable state to component props |
| projects/plugins/jetpack/_inc/client/components/block-theme-notice/test/component.js | Adds comprehensive tests for the new component |
| projects/plugins/jetpack/_inc/client/components/block-theme-notice/index.jsx | New reusable component for displaying block theme notices |
812a60e to
d800883
Compare
Code Coverage SummaryCoverage changed in 5 files.
1 file is newly checked for coverage.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
…tice/index.jsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
When a block theme is active and the Like block is available, show a "Configure your Like buttons" link that directs users to the site editor where they can add the block to their templates.
arcangelini
left a comment
There was a problem hiding this comment.
Settings in Jetpack are hard for me because they are not 1 for 1 across self-hosted, atomic, and simple sites so please correct me if I missed something.
Simple
I was not able to find Jetpack ⇢ Settings ⇢ Sharing instead I ended up in /wp-admin ⇢ Settings ⇢ Sharing where I didn't see the changes reflected. This probably needs a wpcom patch? If this is the only way to toggle this setting on Simple sites it should be accounted for I believe. I guess we would just put it below the selector?
Atomic
Tested with block theme and without and it worked well. Not sure if its supposed to show up in the same place as Simple, but it says nothing about Like buttons in wp-admin/options-general.php?page=sharing... not related to this PR I think.
Yes, the screens are different ; the Jetpack > Settings > Sharing screen is Jetpack-only, and has no equivalent on simple sites. Settings > Sharing is available in all environments, includes some notices and logic for block themes, but would also benefit from a redesign. That's for another PR though, it's outside of the scope of the problem I'm addressing here. I'll merge this for now, we can revisit the Settings > Sharing screen improvements in the future. |
Part of #46671
Proposed changes:
BlockThemeNoticecomponentBefore
After
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No changes to tracking or data usage.
Testing instructions: