From ece6e759608eba536b6ac03a5693f2bd4f6dd80f Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Wed, 22 Jan 2020 13:21:11 +1000 Subject: [PATCH 1/2] Fix blank image size labels on mobile --- packages/block-library/src/gallery/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/gallery/edit.js b/packages/block-library/src/gallery/edit.js index 6a0adcde40133c..7512d4b6908b3d 100644 --- a/packages/block-library/src/gallery/edit.js +++ b/packages/block-library/src/gallery/edit.js @@ -250,7 +250,7 @@ class GalleryEdit extends Component { imageSizes, ( { slug } ) => some( resizedImages, ( sizes ) => ( sizes[ slug ] ) ) ), - ( { name, slug } ) => ( { value: slug, label: name } ) + ( { name, slug, label } ) => ( { value: slug, label: label || name } ) ); } From 3372d185fa6c71f805fdb59877dce0564b33c6a7 Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Fri, 31 Jan 2020 16:39:47 +1000 Subject: [PATCH 2/2] Use name instead of label in default imageSizes --- packages/block-editor/src/store/defaults.js | 8 ++++---- packages/block-library/src/gallery/edit.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/store/defaults.js b/packages/block-editor/src/store/defaults.js index dca689127ad93d..42b15fa8c68115 100644 --- a/packages/block-editor/src/store/defaults.js +++ b/packages/block-editor/src/store/defaults.js @@ -129,10 +129,10 @@ export const SETTINGS_DEFAULTS = { ], imageSizes: [ - { slug: 'thumbnail', label: __( 'Thumbnail' ) }, - { slug: 'medium', label: __( 'Medium' ) }, - { slug: 'large', label: __( 'Large' ) }, - { slug: 'full', label: __( 'Full Size' ) }, + { slug: 'thumbnail', name: __( 'Thumbnail' ) }, + { slug: 'medium', name: __( 'Medium' ) }, + { slug: 'large', name: __( 'Large' ) }, + { slug: 'full', name: __( 'Full Size' ) }, ], // This is current max width of the block inner area diff --git a/packages/block-library/src/gallery/edit.js b/packages/block-library/src/gallery/edit.js index 7e7dad4a45f79f..9d7b57c77c8b66 100644 --- a/packages/block-library/src/gallery/edit.js +++ b/packages/block-library/src/gallery/edit.js @@ -250,7 +250,7 @@ class GalleryEdit extends Component { imageSizes, ( { slug } ) => some( resizedImages, ( sizes ) => ( sizes[ slug ] ) ) ), - ( { name, slug, label } ) => ( { value: slug, label: label || name } ) + ( { name, slug } ) => ( { value: slug, label: name } ) ); }