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

[Mobile] Enable gallery upload options in production #20043

Merged
merged 6 commits into from
Feb 13, 2020
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
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