From fefa7e975c27a1c8b89caf3292438ef31dbe192e Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Thu, 13 Feb 2020 12:58:40 +1000 Subject: [PATCH] [Mobile] Enable gallery upload options in production (#20043) * Enable gallery upload options in production * Refactor native gallery image scss * Add vertical padding to mobile gallery image caption * Remove unused variable in media-upload --- .../components/media-upload/index.native.js | 10 +----- .../gallery/gallery-image-style.native.scss | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/packages/block-editor/src/components/media-upload/index.native.js b/packages/block-editor/src/components/media-upload/index.native.js index 2a57846847ebe9..2e3b527b10956c 100644 --- a/packages/block-editor/src/components/media-upload/index.native.js +++ b/packages/block-editor/src/components/media-upload/index.native.js @@ -93,15 +93,7 @@ export class MediaUpload extends React.Component { } getMediaOptionsItems() { - const { allowedTypes = [], multiple = false } = this.props; - - // disable upload sources for now when multiple flag is set - // eslint-disable-next-line no-undef - if ( ! __DEV__ ) { - if ( allowedTypes.includes( MEDIA_TYPE_IMAGE ) && multiple ) { - return [ siteLibrarySource ]; - } - } + const { allowedTypes = [] } = this.props; return this.getAllSources() .filter( ( source ) => { diff --git a/packages/block-library/src/gallery/gallery-image-style.native.scss b/packages/block-library/src/gallery/gallery-image-style.native.scss index a953a1e8d62940..765f6c4918544d 100644 --- a/packages/block-library/src/gallery/gallery-image-style.native.scss +++ b/packages/block-library/src/gallery/gallery-image-style.native.scss @@ -1,10 +1,11 @@ -$get-gallery-image-container-height: 150px; -$get-overlay-border-width: 3px; -$get-caption-background-color: rgba(0, 0, 0, 0.4); +$gallery-image-container-height: 150px; +$overlay-border-width: 3px; +$caption-background-color: rgba(0, 0, 0, 0.4); +$caption-padding-vertical: 8px; .galleryImageContainer { flex: 1; - height: $get-gallery-image-container-height; + height: $gallery-image-container-height; background-color: $gray-lighten-30; } @@ -31,7 +32,7 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); bottom: 0; left: 0; right: 0; - border-width: $get-overlay-border-width; + border-width: $overlay-border-width; border-color: #0000; } @@ -126,7 +127,9 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); .caption { @include caption-shared; - background-color: $get-caption-background-color; + background-color: $caption-background-color; + padding-top: $caption-padding-vertical; + padding-bottom: $caption-padding-vertical; } .captionPlaceholder { @@ -141,18 +144,18 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); // expand caption container to compensate for overlay border .captionExpandedContainer { - $width: $get-overlay-border-width; // constrain height to gallery image height for caption scroll - max-height: $get-gallery-image-container-height; + max-height: $gallery-image-container-height; position: absolute; - bottom: - $width; - left: - $width; - right: - $width; - padding-bottom: $width; - padding-left: $width; - padding-right: $width; + bottom: - $overlay-border-width; + left: - $overlay-border-width; + right: - $overlay-border-width; + padding-top: $caption-padding-vertical; + padding-bottom: $overlay-border-width + $caption-padding-vertical; + padding-left: $overlay-border-width; + padding-right: $overlay-border-width; // use caption background color on container when expanded - background-color: $get-caption-background-color; + background-color: $caption-background-color; } .captionExpanded {