-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 - Add append logic to MediaPlaceholder #18262
Merged
mkevins
merged 0 commits into
try/gallery-draft-add-native-gallery
from
try/gallery-draft-mediaplaceholder
Nov 7, 2019
Merged
[RNMobile] Gallery - Add append logic to MediaPlaceholder #18262
mkevins
merged 0 commits into
try/gallery-draft-add-native-gallery
from
try/gallery-draft-mediaplaceholder
Nov 7, 2019
Conversation
This file contains 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
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
Nov 4, 2019
This was referenced Nov 5, 2019
Closed
mkevins
changed the base branch from
master
to
try/gallery-draft-add-native-gallery
November 7, 2019 01:51
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
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)
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
MediaPlaceholder
component to append media for the nativeGallery
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 theMediaPlaceholder
component, and conditionally appends media items to the current selection, passing the resulting collection back throughonSelect
when theaddToGallery
flag is set. When theaddToGallery
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 akey
in 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: