diff --git a/.eslintrc.js b/.eslintrc.js index e21f7d6e6d780..f6b24dcb15017 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -313,6 +313,7 @@ module.exports = { ...[ 'BorderBoxControl', 'BorderControl', + 'ComboboxControl', 'CustomSelectControl', 'DimensionControl', 'FontSizePicker', diff --git a/packages/block-library/src/avatar/user-control.js b/packages/block-library/src/avatar/user-control.js index 598c05011eaed..235202ffec90d 100644 --- a/packages/block-library/src/avatar/user-control.js +++ b/packages/block-library/src/avatar/user-control.js @@ -33,6 +33,7 @@ function UserControl( { value, onChange } ) { return ( - { showAuthorControl && - ( ( showCombobox && ( - - ) ) || ( + + { showAuthorControl && + ( ( showCombobox && ( + + ) ) || ( + + ) ) } + + setAttributes( { showAvatar: ! showAvatar } ) + } + /> + { showAvatar && ( { + setAttributes( { + avatarSize: Number( size ), + } ); + } } /> - ) ) } - - setAttributes( { showAvatar: ! showAvatar } ) - } - /> - { showAvatar && ( - { - setAttributes( { - avatarSize: Number( size ), - } ); - } } + label={ __( 'Show bio' ) } + checked={ showBio } + onChange={ () => + setAttributes( { showBio: ! showBio } ) + } /> - ) } - - setAttributes( { showBio: ! showBio } ) - } - /> - setAttributes( { isLink: ! isLink } ) } - /> - { isLink && ( - setAttributes( { - linkTarget: value ? '_blank' : '_self', - } ) + label={ __( 'Link author name to author page' ) } + checked={ isLink } + onChange={ () => + setAttributes( { isLink: ! isLink } ) } - checked={ linkTarget === '_blank' } /> - ) } + { isLink && ( + + setAttributes( { + linkTarget: value ? '_blank' : '_self', + } ) + } + checked={ linkTarget === '_blank' } + /> + ) } + diff --git a/packages/block-library/src/post-author/editor.scss b/packages/block-library/src/post-author/editor.scss new file mode 100644 index 0000000000000..f6464893138cf --- /dev/null +++ b/packages/block-library/src/post-author/editor.scss @@ -0,0 +1,7 @@ +.wp-block-post-author__inspector-settings { + // Counteract the margin added by the block inspector. + .components-base-control, + .components-base-control:last-child { + margin-bottom: 0; + } +}