Skip to content
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] Gallery - Native gallery component draft #18176

Merged
merged 19 commits into from
Dec 4, 2019

Conversation

mkevins
Copy link
Contributor

@mkevins mkevins commented Oct 30, 2019

Description

This PR introduces a native Gallery component for the semi-cross-platform Gallery block. The purpose of this component is to render a list of images passed via the images prop.

PR Hierarchy

This PR is part of the PR hierarchy described here. This PR can be tested with the aggregate changeset and integration of components within the related PRs by checking out the branch of the "top level" PR: #18265 via the gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#1498.

MediaPlaceholder

Changes to MediaPlaceholder from this PR: #18262 have been merged for review here. The MediaPlaceholder component has been modified to append media for the native Gallery implementation.

On web, when new media is added to a gallery, the current selection of items in the gallery is available to the media selection interface, and can be presented as such to the user. The selector behaves more like a "gallery editor", in the sense that the selection is modified (users can add and / or remove items). On mobile, the interface for selecting media items is handled by the "parent apps", and does not "know" about what is currently selected as part of the gallery.

This PR adds the addToGallery prop to the MediaPlaceholder component, and conditionally appends media items to the current selection, passing the resulting collection back through onSelect when the addToGallery flag is set. When the addToGallery flag is not set, onSelect behavior is not modified.

Note: In this implementation, duplicates are removed from the collection via the id property, since this is used as a key in the list of elements that renders these items.
The MediaPlaceholder

The changeset here is used in the related "parent" PR: #18111, which includes these changes integrated with related changes in other components necessary for the gallery block.

Block-level caption

This component uses the mobile Caption component to add a block-level caption for gallery.

To test

Test this component by checking out the branch of the "top level" PR: #18265 via the gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#1498.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@mkevins mkevins added [Status] In Progress Tracking issues with work in progress Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Block] Gallery Affects the Gallery Block - used to display groups of images labels Oct 30, 2019
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 2edfe43 to 1801c53 Compare November 5, 2019 03:40
@mkevins mkevins changed the base branch from master to rnmobile/master November 5, 2019 03:41
@mkevins mkevins changed the base branch from rnmobile/master to master November 5, 2019 03:42
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 75d8a12 to 6b4cf2c Compare November 7, 2019 02:30
@mkevins mkevins changed the base branch from master to try/gallery-draft-tiles November 7, 2019 02:31
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from ad821a3 to 8bf5801 Compare November 12, 2019 13:04
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 6b4cf2c to 3edb3eb Compare November 12, 2019 13:04
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 8bf5801 to 6f1556f Compare November 19, 2019 13:35
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 3edb3eb to 4190b97 Compare November 19, 2019 13:35
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 6f1556f to 095d2a0 Compare November 19, 2019 13:49
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 4190b97 to 8b1e8b3 Compare November 19, 2019 13:58
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 095d2a0 to f66567b Compare November 21, 2019 06:19
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from ac55dd8 to 85b45af Compare November 21, 2019 06:19
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from f66567b to 91368e0 Compare November 22, 2019 05:59
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 85b45af to 1e403ff Compare November 22, 2019 06:00
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 91368e0 to 2aa8448 Compare November 25, 2019 03:40
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 1e403ff to 7a3fa58 Compare November 25, 2019 03:41
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 2aa8448 to deafd68 Compare November 26, 2019 06:50
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 7a3fa58 to f030539 Compare November 26, 2019 06:51
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from deafd68 to e2c7e4c Compare November 28, 2019 05:48
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from f030539 to 3696fbf Compare November 28, 2019 05:48
@mkevins mkevins marked this pull request as ready for review November 29, 2019 01:40
@mkevins mkevins removed the [Status] In Progress Tracking issues with work in progress label Nov 29, 2019
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 0234c1a to 4794e73 Compare December 4, 2019 08:43
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from f27005b to 7fb31dc Compare December 4, 2019 08:43
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 4794e73 to 1248af6 Compare December 4, 2019 09:35
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from 7fb31dc to d05dc84 Compare December 4, 2019 09:36
@mkevins mkevins force-pushed the try/gallery-draft-tiles branch from 1248af6 to 6f2bbb9 Compare December 4, 2019 10:37
@mkevins mkevins changed the base branch from try/gallery-draft-tiles to master December 4, 2019 11:29
@mkevins mkevins force-pushed the try/gallery-draft-add-native-gallery branch from d05dc84 to 3fcb972 Compare December 4, 2019 11:29
@mkevins mkevins merged commit 75980bd into master Dec 4, 2019
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
@mkevins mkevins deleted the try/gallery-draft-add-native-gallery branch December 11, 2019 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants