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] Added auto opening of media upload options to Gallery block v2 #36757

Merged
merged 4 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ function GalleryEdit( props ) {
[ clientId ]
);

const wasBlockJustInserted = useSelect(
( select ) => {
return select( blockEditorStore ).wasBlockJustInserted(
clientId,
'inserter_menu'
);
},
[ clientId ]
);

const images = useMemo(
() =>
innerBlockImages?.map( ( block ) => ( {
Expand Down Expand Up @@ -437,6 +447,9 @@ function GalleryEdit( props ) {
value={ hasImageIds ? images : {} }
onError={ onUploadError }
notices={ hasImages ? undefined : noticeUI }
autoOpenMediaUpload={
! hasImages && isSelected && wasBlockJustInserted
}
/>
);

Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ For each user feature we should also add a importance categorization label to i
## Unreleased
- [*] [Embed block] Included Link in Block Settings [#36099]
- [**] Fix tab titles translation of inserter menu [#36534]
- [*] [Media&Text block] Fix an issue where the text font size would be bigger than expected in some cases [#36570]
- [*] [Media&Text block] Fix an issue where the text font size would be bigger than expected in some cases [#36570]
- [**] [Gallery block] When a gallery block is added, the media options are auto opened for v2 of the Gallery block. [#36757]

## 1.66.0
- [**] [Image block] Add ability to quickly link images to Media Files and Attachment Pages [#34846]
Expand Down