-
Notifications
You must be signed in to change notification settings - Fork 58
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
Image set via parent media library picker #220
Conversation
* Wire up the "MEDIA LIBRARY" Image block button * Relay to the parent via the bridge, to launch the media picker * Listen for parent's response * Broadcast an action to set the focused image's URL * Reducer set's the focused image's URL
Which also removes the Store/Reducer action to update the image url. This now gets us closer to the way Gutenberg-web does the update.
37497a8
to
2d7a7b6
Compare
cc @etoledom as you might want to have a peak at the Bridge change proposal here. Check out https://github.com/wordpress-mobile/gutenberg-mobile/pull/220/files#diff-0ae1e2c19a7a43836c4694c61985e963R6 |
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.
Tested via WordPress-Android app
- Open a post
- Create image block
- Tap "Media Library"
- Pick an image from WP media library
- Verify that image block is updated with the selected image
- Set a caption for the image
- Repeat these steps multiple times to see if multiple image blocks can be added&updated
Using the JS callback looks like a good approach! I checked out the Android side to compare with iOS and it seems like the Media Pickers work in a similar way: providing the selected image via "delegate" callback. So I believe that the WPiOS side implementation will be quite similar too. ✅ |
Addresses #192 for the Android side of the Bridge.
This PR adds a function to the bridge interface to trigger the media library image picker on the parent native app. The function provides a callback for the Bridge to invoke to send the selected image URL back into RN.
Depends on the GB repo PR (needs merge first): WordPress/gutenberg#11511
To test (Android):
feature/integrate-gutenberg-image-set
branch from https://github.com/wordpress-mobile/WordPress-Android. PR here.yarn wpandroid
at the wpandroid root to compile the native app, run Metro, install and run the mobile app in a single command