-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Enable rendering a block's SVG icon directly from an XML string #55742
Conversation
Size Change: 0 B Total Size: 1.7 MB ℹ️ View Unchanged
|
Flaky tests detected in ca132d2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6783027745
|
For native, we're updating the logic for parsing a block icon if it's a string. See: WordPress/gutenberg#55742 Given those changes, we can now pass the "metadata.icon" string directly when registering a block on native.
Co-Authored-By: Carlos Garcia <14905380+fluiddot@users.noreply.github.com>
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 🎊 !
Gutenberg Mobile PR: wordpress-mobile/gutenberg-mobile#6342
What?
This PR enables rendering a block's SVG icon directly from an XML string.
Why?
When a block's registered, especially if it's registered via metadata, it's possible for the icon to be passed as a string beginning with
"<svg"
. In such cases, the icon would not be displayed, as such a string is not encountered for when registering a block on native.How?
react-native-svg
includes a function,SvgXml
, that is useful for parsing XML strings. This function is now exported as part of the@wordpress/primitives
package.In addition a
SvgXml
mock has been added, following the same pattern as other mocked components.Testing Instructions
Testing Instructions for Keyboard
N/A