Support Theme Colors and Gradients#2241
Conversation
|
Hey @dratwas I made some changes to update the settings with colors and gradients loaded from themes. When you get time will you take a look and see if this will conflict with anything you're working on for the color picker? |
I should have the Android side of this done today or tomorrow, so I'll have an Android build available for testing then. |
|
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
I was able to get the Android side up and included it in this PR since it kind of went stale. @dratwas Would you be able to re-review with those changes? The iOS side was reviewed and tested by @SergioEstevao and I reached out to @mchowning to request his review on the Android side |
.../src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergBridgeJS2Parent.java
Outdated
Show resolved
Hide resolved
...java/org/wordpress/mobile/ReactNativeGutenbergBridge/RNReactNativeGutenbergBridgeModule.java
Outdated
Show resolved
Hide resolved
...nberg-bridge/android/src/main/java/org/wordpress/mobile/WPAndroidGlue/WPAndroidGlueCode.java
Show resolved
Hide resolved
|
I'm not sure if the update of bundles should be a part of that PR but the code looks good! Awesome work @chipsnyder 🎉 |
Thanks for the review @dratwas. I included the bundle update here so the Native App Prs can be merged to the after_1.29.0 branches with the merged commit. That way we don't have a PR sitting stale until the official Gutenberg release merge. |
| <Editor | ||
| initialHtml={ initialData } | ||
| initialHtmlModeEnabled={ initialHtmlModeEnabled } | ||
| initialHtmlModeEnabled={ this.props.initialHtmlModeEnabled } |
There was a problem hiding this comment.
Not suggesting a change here, just curious if there is a rationale for why initialHtmlModeEnabled was removed from a destructuring while the other three props were added to it?
There was a problem hiding this comment.
I think this came about as just a resolution to a merge conflict. For the other const declarations it was suggested to use this.props.whatever which I had converted to on a previous merge then I think just ran into issues when resolving it later
Fixes: #1744
Related PRs
gutenbergWordPress/gutenberg#22197WordPress-Androidwordpress-mobile/WordPress-Android#12041WordPress-FluxC-Androidwordpress-mobile/WordPress-FluxC-Android#1593WordPress-iOSwordpress-mobile/WordPress-iOS#14085Description
Adds support for theme defined colors and gradients to be injected into the editor from the mobile apps.
Colors can then be displayed by the same mechanisms that utilize the settings lookup for colors and gradients. This is currently supported on Cover and Button blocks
How has this been tested?
Note Atomic sites don't seem to support the
wp/v2/themesAPI changes yet so this can be tested with a free site or a self-hosted siteTo help with testing this theme can be added to a self-hosted site: twentytwenty-copy.zip
Colors
1.) Select a theme with custom colors (such as TwentyTwenty)
2.) Create a post with blocks that have a custom color set (such as Cover or Button)
3.) Load editor on mobile
Expect to see the custom color on the block
Gradients
1.) Select a theme with custom gradients or add gradients to a theme
2.) Create a post with blocks that have a custom gradient set (such as Cover or Button)
3.) Load editor on mobile
Expect to see the custom gradient on the block
No Wifi
1.) Set up blocks for custom color and gradient
2.) View the post on mobile to cache the theme
3.) Turn off wifi to the device
4.) Reload the editor
Expect to see the custom colors on the blocks
No Wifi - Force kill the app
1.) Set up blocks for custom color and gradient
2.) View the post on mobile to cache the theme
3.) Turn off wifi to the device
4.) Stop the app from running in the background
5.) Reload the editor
Expect to see the custom colors on the blocks
Screenshots
PR submission checklist:
RELEASE-NOTES.txtif necessary.