Skip to content

Commit

Permalink
Adds icons and descriptions to Post blocks. (#24603)
Browse files Browse the repository at this point in the history
* Closes #24175. Adds icons and descriptions to Post blocks.

* Addressed comments and removed spacing and extra lines in icon files.

* Worked on spaces and enters again to fix errors. This is getting silly.
  • Loading branch information
mapk committed Aug 19, 2020
1 parent 9cb1acf commit 133f0e4
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/post-comments-count/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { postCommentsCount as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -14,5 +15,7 @@ export { metadata, name };

export const settings = {
title: __( 'Post Comments Count' ),
description: __( "Display a post's comments count." ),
icon,
edit,
};
3 changes: 3 additions & 0 deletions packages/block-library/src/post-comments-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { postCommentsForm as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -14,5 +15,7 @@ export { metadata, name };

export const settings = {
title: __( 'Post Comments Form' ),
description: __( "Display a post's comments form." ),
icon,
edit,
};
3 changes: 3 additions & 0 deletions packages/block-library/src/post-comments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { postComments as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -14,5 +15,7 @@ export { metadata, name };

export const settings = {
title: __( 'Post Comments' ),
description: __( "Display a post's comments." ),
icon,
edit,
};
3 changes: 3 additions & 0 deletions packages/block-library/src/post-featured-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { postFeaturedImage as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -14,5 +15,7 @@ export { metadata, name };

export const settings = {
title: __( 'Post Featured Image' ),
description: __( "Display a post's featured image." ),
icon,
edit,
};
4 changes: 4 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ export { default as plugins } from './library/plugins';
export { default as plusCircleFilled } from './library/plus-circle-filled';
export { default as plusCircle } from './library/plus-circle';
export { default as plus } from './library/plus';
export { default as postComments } from './library/post-comments';
export { default as postCommentsCount } from './library/post-comments-count';
export { default as postCommentsForm } from './library/post-comments-form';
export { default as postDate } from './library/post-date';
export { default as postExcerpt } from './library/post-excerpt';
export { default as postFeaturedImage } from './library/post-featured-image';
export { default as postList } from './library/post-list';
export { default as postTitle } from './library/post-title';
export { default as preformatted } from './library/preformatted';
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/src/library/post-comments-count.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const postCommentsCount = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z" />
</SVG>
);

export default postCommentsCount;
12 changes: 12 additions & 0 deletions packages/icons/src/library/post-comments-form.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const postCommentsForm = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z" />
</SVG>
);

export default postCommentsForm;
12 changes: 12 additions & 0 deletions packages/icons/src/library/post-comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const postComments = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" />
</SVG>
);

export default postComments;
12 changes: 12 additions & 0 deletions packages/icons/src/library/post-featured-image.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const postFeaturedImage = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" />
</SVG>
);

export default postFeaturedImage;

0 comments on commit 133f0e4

Please sign in to comment.