diff --git a/packages/block-library/src/heading/edit.js b/packages/block-library/src/heading/edit.js index fd280fd2714fed..3289fb5a7d2470 100644 --- a/packages/block-library/src/heading/edit.js +++ b/packages/block-library/src/heading/edit.js @@ -62,19 +62,14 @@ function HeadingEdit( { <> setAttributes( { level: newLevel } ) } /> + { + setAttributes( { align: nextAlign } ); + } } />

{ __( 'Level' ) }

- setAttributes( { level: newLevel } ) } /> -

{ __( 'Text Alignment' ) }

- { - setAttributes( { align: nextAlign } ); - } } - /> + setAttributes( { level: newLevel } ) } />
+ + + ); +} diff --git a/packages/block-library/src/heading/heading-toolbar.js b/packages/block-library/src/heading/heading-toolbar.js index b01ff2c1c202a4..f3a089a8fafefe 100644 --- a/packages/block-library/src/heading/heading-toolbar.js +++ b/packages/block-library/src/heading/heading-toolbar.js @@ -10,22 +10,32 @@ import { __, sprintf } from '@wordpress/i18n'; import { Component } from '@wordpress/element'; import { Toolbar } from '@wordpress/components'; +/** + * Internal dependencies + */ +import HeadingLevelIcon from './heading-level-icon'; + class HeadingToolbar extends Component { createLevelControl( targetLevel, selectedLevel, onChange ) { return { - icon: 'heading', + icon: , // translators: %s: heading level e.g: "1", "2", "3" title: sprintf( __( 'Heading %d' ), targetLevel ), isActive: targetLevel === selectedLevel, onClick: () => onChange( targetLevel ), - subscript: String( targetLevel ), }; } render() { - const { minLevel, maxLevel, selectedLevel, onChange } = this.props; + const { isCollapsed = true, minLevel, maxLevel, selectedLevel, onChange } = this.props; + return ( - this.createLevelControl( index, selectedLevel, onChange ) ) } /> + } + controls={ range( minLevel, maxLevel ).map( + ( index ) => this.createLevelControl( index, selectedLevel, onChange ) + ) } /> ); } }