Skip to content

Commit

Permalink
Feature/icon (#14)
Browse files Browse the repository at this point in the history
* custom icon
  • Loading branch information
cr0ybot authored May 3, 2023
1 parent 627f628 commit ad299e8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions assets/feed-block.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/blocks/feed/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { __ } from '@wordpress/i18n';
import { useBlockProps } from '@wordpress/block-editor';
import { Button, Placeholder, TextControl } from '@wordpress/components';
import { useState } from '@wordpress/element';
import { rss } from '@wordpress/icons';
import { prependHTTP } from '@wordpress/url';

import icon from '../../../icons/feed-block';

import FeedContent from './feed-content';

export default function Edit( props ) {
Expand All @@ -30,7 +31,7 @@ export default function Edit( props ) {
if ( isEditing ) {
return (
<div { ...blockProps }>
<Placeholder icon={ rss } label="Feed Loop">
<Placeholder icon={ icon } label="Feed Loop">
<form
onSubmit={ onSubmitFeedURL }
className="wp-block-feed-block-feed__placeholder-form"
Expand Down
3 changes: 3 additions & 0 deletions src/blocks/feed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import { registerBlockType } from '@wordpress/blocks';

import icon from '../../icons/feed-block';

import './style.scss';
import './editor.scss';

Expand All @@ -12,6 +14,7 @@ import edit from './edit';
import save from './save';

registerBlockType( metadata, {
icon,
/**
* @see ./edit.js
*/
Expand Down
9 changes: 9 additions & 0 deletions src/icons/feed-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { SVG, Path } from '@wordpress/primitives';

const feedBlock = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="m22,19h-1.5c0-7.444-6.056-13.5-13.5-13.5v-1.5c8.271,0,15,6.729,15,15ZM7,8.679v1.5c4.864,0,8.821,3.957,8.821,8.821h1.5c0-5.691-4.63-10.321-10.321-10.321Zm4.75,8.359c0-1.495-1.216-2.711-2.711-2.711-.477,0-.946.126-1.356.363l.751,1.299c.183-.106.393-.162.605-.162.668,0,1.211.543,1.211,1.211s-.543,1.212-1.211,1.212c-.407,0-.784-.203-.993-.515l-1.325-2.196c-.505-.759-1.35-1.212-2.259-1.212-1.495,0-2.711,1.216-2.711,2.711s1.216,2.712,2.711,2.712c.477,0,.946-.126,1.356-.363l-.751-1.299c-.183.106-.393.162-.605.162-.668,0-1.211-.544-1.211-1.212s.543-1.211,1.211-1.211c.407,0,.784.203.993.515l1.325,2.196c.505.759,1.35,1.212,2.259,1.212,1.495,0,2.711-1.217,2.711-2.712Z" />
</SVG>
);

export default feedBlock;

0 comments on commit ad299e8

Please sign in to comment.