Skip to content

Commit

Permalink
[Mobile] Enable gallery upload options in production (#20043)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mkevins authored Feb 13, 2020
1 parent a59a5d9 commit fefa7e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => {
Expand Down
33 changes: 18 additions & 15 deletions packages/block-library/src/gallery/gallery-image-style.native.scss
Original file line number Diff line number Diff line change
@@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit fefa7e9

Please sign in to comment.