Skip to content

Commit

Permalink
Rename the alignment icons
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 30, 2020
1 parent 9d264c1 commit 4fa0ddb
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ import { find } from 'lodash';
*/
import { __ } from '@wordpress/i18n';
import { Toolbar } from '@wordpress/components';
import { alignLeft, alignRight, alignCenter } from '@wordpress/icons';
import { textAlignLeft, textAlignRight, textAlignCenter } from '@wordpress/icons';

const DEFAULT_ALIGNMENT_CONTROLS = [
{
icon: alignLeft,
icon: textAlignLeft,
title: __( 'Align text left' ),
align: 'left',
},
{
icon: alignCenter,
icon: textAlignCenter,
title: __( 'Align text center' ),
align: 'center',
},
{
icon: alignRight,
icon: textAlignRight,
title: __( 'Align text right' ),
align: 'right',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { Toolbar } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import {
alignBlockCenter,
alignBlockFullWidth,
alignBlockLeft,
alignBlockRight,
alignBlockWide,
positionCenter,
positionLeft,
positionRight,
stretchFullWidth,
stretchWide,
} from '@wordpress/icons';

/**
Expand All @@ -20,23 +20,23 @@ import { withBlockEditContext } from '../block-edit/context';

const BLOCK_ALIGNMENTS_CONTROLS = {
left: {
icon: alignBlockLeft,
icon: positionLeft,
title: __( 'Align left' ),
},
center: {
icon: alignBlockCenter,
icon: positionCenter,
title: __( 'Align center' ),
},
right: {
icon: alignBlockRight,
icon: positionRight,
title: __( 'Align right' ),
},
wide: {
icon: alignBlockWide,
icon: stretchWide,
title: __( 'Wide width' ),
},
full: {
icon: alignBlockFullWidth,
icon: stretchFullWidth,
title: __( 'Full width' ),
},
};
Expand All @@ -50,9 +50,9 @@ export function BlockAlignmentToolbar( { value, onChange, controls = DEFAULT_CON
return () => onChange( value === align ? undefined : align );
}

const enabledControls = wideControlsEnabled ?
controls :
controls.filter( ( control ) => WIDE_CONTROLS.indexOf( control ) === -1 );
const enabledControls = wideControlsEnabled
? controls
: controls.filter( ( control ) => WIDE_CONTROLS.indexOf( control ) === -1 );

const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[ value ];
const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[ DEFAULT_CONTROL ];
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { alignJustify as icon } from '@wordpress/icons';
import { textAlignJustify as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down
8 changes: 4 additions & 4 deletions packages/block-library/src/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
ToggleControl,
ToolbarGroup,
} from '@wordpress/components';
import { table as icon, alignLeft, alignRight, alignCenter } from '@wordpress/icons';
import { table as icon, textAlignLeft, textAlignRight, textAlignCenter } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -68,17 +68,17 @@ const BACKGROUND_COLORS = [

const ALIGNMENT_CONTROLS = [
{
icon: alignLeft,
icon: textAlignLeft,
title: __( 'Align Column Left' ),
align: 'left',
},
{
icon: alignCenter,
icon: textAlignCenter,
title: __( 'Align Column Center' ),
align: 'center',
},
{
icon: alignRight,
icon: textAlignRight,
title: __( 'Align Column Right' ),
align: 'right',
},
Expand Down
18 changes: 9 additions & 9 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
export { default as Icon } from './icon';

export { default as alignBlockCenter } from './library/align-block-center';
export { default as alignBlockFullWidth } from './library/align-block-full-width';
export { default as alignBlockLeft } from './library/align-block-left';
export { default as alignBlockRight } from './library/align-block-right';
export { default as alignBlockWide } from './library/align-block-wide';
export { default as alignCenter } from './library/align-center';
export { default as alignJustify } from './library/align-justify';
export { default as alignLeft } from './library/align-left';
export { default as alignRight } from './library/align-right';
export { default as archive } from './library/archive';
export { default as audio } from './library/audio';
export { default as button } from './library/button';
Expand Down Expand Up @@ -37,6 +28,9 @@ export { default as more } from './library/more';
export { default as navigation } from './library/navigation';
export { default as pageBreak } from './library/page-break';
export { default as paragraph } from './library/paragraph';
export { default as positionCenter } from './library/position-center';
export { default as positionLeft } from './library/position-left';
export { default as positionRight } from './library/position-right';
export { default as plusCircle } from './library/plus-circle';
export { default as postList } from './library/post-list';
export { default as preformatted } from './library/preformatted';
Expand All @@ -47,8 +41,14 @@ export { default as rss } from './library/rss';
export { default as search } from './library/search';
export { default as separator } from './library/separator';
export { default as shortcode } from './library/shortcode';
export { default as stretchFullWidth } from './library/stretch-full-width';
export { default as stretchWide } from './library/stretch-wide';
export { default as table } from './library/table';
export { default as tag } from './library/tag';
export { default as textAlignCenter } from './library/text-align-center';
export { default as textAlignJustify } from './library/text-align-justify';
export { default as textAlignLeft } from './library/text-align-left';
export { default as textAlignRight } from './library/text-align-right';
export { default as title } from './library/title';
export { default as trash } from './library/trash';
export { default as verse } from './library/verse';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignBlockCenter = (
const positionCenter = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z" />
</SVG>
);

export default alignBlockCenter;
export default positionCenter;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignBlockLeft = (
const positionLeft = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M3 5h14V3H3v2zm9 8V7H3v6h9zm2-4h3V7h-3v2zm0 4h3v-2h-3v2zM3 17h14v-2H3v2z" />
</SVG>
);

export default alignBlockLeft;
export default positionLeft;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignBlockRight = (
const positionRight = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M3 5h14V3H3v2zm0 4h3V7H3v2zm14 4V7H8v6h9zM3 13h3v-2H3v2zm0 4h14v-2H3v2z" />
</SVG>
);

export default alignBlockRight;
export default positionRight;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignBlockFullWidth = (
const stretchFullWidth = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M17 13V3H3v10h14zM5 17h10v-2H5v2z" />
</SVG>
);

export default alignBlockFullWidth;
export default stretchFullWidth;
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignBlockWide = (
const stretchWide = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M5 5h10V3H5v2zm12 8V7H3v6h14zM5 17h10v-2H5v2z" />
</SVG>
);

export default alignBlockWide;
export default stretchWide;
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignCenter = (
const textAlignCenter = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M14 5V3H6v2h8zm3 4V7H3v2h14zm-3 4v-2H6v2h8zm3 4v-2H3v2h14z" />
</SVG>
);

export default alignCenter;
export default textAlignCenter;

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignJustify = (
const textAlignJustify = (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" />
</SVG>
);

export default alignJustify;
export default textAlignJustify;
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignLeft = (
const textAlignLeft = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M12 5V3H3v2h9zm5 4V7H3v2h14zm-5 4v-2H3v2h9zm5 4v-2H3v2h14z" />
</SVG>
);

export default alignLeft;
export default textAlignLeft;

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const alignRight = (
const textAlignRight = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M17 5V3H8v2h9zm0 4V7H3v2h14zm0 4v-2H8v2h9zm0 4v-2H3v2h14z" />
</SVG>
);

export default alignRight;
export default textAlignRight;

0 comments on commit 4fa0ddb

Please sign in to comment.