[RNMobile] Gallery - Add append logic to MediaPlaceholder#18262
Merged
mkevins merged 0 commit intotry/gallery-draft-add-native-galleryfrom Nov 7, 2019
Merged
Conversation
This was referenced Nov 5, 2019
Closed
Contributor
Author
|
Merged into Native Gallery PR to reduce the number of PRs in the PR hierarchy for mobile Gallery block. Tracked here: #18176. |
5 tasks
mkevins
added a commit
that referenced
this pull request
Nov 7, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
3 tasks
mkevins
added a commit
that referenced
this pull request
Nov 12, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Nov 19, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Nov 22, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Nov 25, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Nov 26, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Nov 28, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Dec 3, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Dec 4, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Dec 4, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Dec 4, 2019
* Add append logic to MediaPlaceholder for gallery * Fix lint errors
mkevins
added a commit
that referenced
this pull request
Dec 4, 2019
* Add native gallery * Add native gallery block behind DEV flag * Refactor gallery to accept props more directly * Pass isBlockSelected prop to gallery-image * Pass isCropped prop to gallery-image * Limit displayed columns on mobile for gallery * Fix lint errors * Use renamed tiles spacing prop in native gallery component * [RNMobile] Gallery - Add append logic to MediaPlaceholder (#18262) * Add append logic to MediaPlaceholder for gallery * Fix lint errors * Add margin-bottom to tiles in native gallery * Limit displayed gallery columns to 4 for viewports < large * Fix lint * Add darkmode styles for MediaPlaceholder appender * Use child-first approach for gallery image UI components * Limit displayed columns in gallery to 4 on native * Add block-level caption to native gallery * Fix scss imports for jest * Fix lint * Use "narrow" instead of "mobile" semantics for viewport flag
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR modifies the
MediaPlaceholdercomponent to append media for the nativeGalleryimplementation.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
addToGalleryprop to theMediaPlaceholdercomponent, and conditionally appends media items to the current selection, passing the resulting collection back throughonSelectwhen theaddToGalleryflag is set. When theaddToGalleryflag is not set,onSelectbehavior is not modified.Note: In this implementation, duplicates are removed from the collection via the
idproperty, since this is used as akeyin the list of elements that renders these items.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.
To test
Test this component via the main draft PR.
Checklist: