Skip to content

Commit

Permalink
Move block alignment toolbar from inspector to block controls
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jul 8, 2017
1 parent d87fded commit 293a84f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions blocks/library/latest-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import InspectorControls from '../../inspector-controls';
import TextControl from '../../inspector-controls/text-control';
import ToggleControl from '../../inspector-controls/toggle-control';
import BlockDescription from '../../block-description';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';

const MIN_POSTS = 1;
Expand Down Expand Up @@ -112,20 +113,22 @@ registerBlockType( 'core/latest-posts', {

return [
focus && (
<InspectorControls key="inspector">
<BlockDescription>
<p>{ __( 'Shows a list of your site\'s most recent posts.' ) }</p>
</BlockDescription>
<h3>{ __( 'Latest Posts Settings' ) }</h3>

<p>{ __( 'Alignment' ) }</p>
<BlockControls key="controls">
<BlockAlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
controls={ [ 'left', 'center', 'right', 'wide', 'full' ] }
/>
</BlockControls>
),
focus && (
<InspectorControls key="inspector">
<BlockDescription>
<p>{ __( 'Shows a list of your site\'s most recent posts.' ) }</p>
</BlockDescription>
<h3>{ __( 'Latest Posts Settings' ) }</h3>

<ToggleControl
label={ __( 'Display post date' ) }
Expand Down

0 comments on commit 293a84f

Please sign in to comment.