-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment: Allow SVG icons to be modified for premium blocks
Related to issue #44048. This approach is to change simple JSX icons into stateless functional components rendering an extra `svgExtra` prop. This allows extra SVG drawing commands to be injected into each icon. In this experimental commit, I've only modified 2 icons to take the new `svgExtra` prop, but we would want to modify all jetpack icons. The main code in register-jetpack-block.js, when registering each block, checks to see if it's a paid block using requiresPaidPlan(). If it's a paid block, then we "render" the icon by calling the callback, and providing a premium star as the `svgExtra` prop. NOTE: In my testing, requiresPaidPlan was always returning false, so I shortcircuited the test to always return true in this experimental commit. This is a way to add the star to any icon we please, while only using one SVG element; but we have to make each icon a bit more extensible first.
- Loading branch information
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters