Skip to content

Commit

Permalink
Try: Add new duotone filter icon. (#40435)
Browse files Browse the repository at this point in the history
* Try: Add new duotone filter icon.

* Update changelog.

* Remove test label

Co-authored-by: Alex Lende <[email protected]>
  • Loading branch information
jasmussen and Alex Lende authored Apr 20, 2022
1 parent b51a39d commit 8660703
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { DOWN } from '@wordpress/keycodes';
import { Icon, filter } from '@wordpress/icons';

function DuotoneControl( {
colorPalette,
Expand Down Expand Up @@ -41,7 +42,13 @@ function DuotoneControl( {
aria-expanded={ isOpen }
onKeyDown={ openOnArrowDown }
label={ __( 'Apply duotone filter' ) }
icon={ <DuotoneSwatch values={ value } /> }
icon={
value ? (
<DuotoneSwatch values={ value } />
) : (
<Icon icon={ filter } />
)
}
/>
);
} }
Expand Down
3 changes: 3 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## Unreleased
### New Features

- Add new `filter` icon. ([#40435](https://github.com/WordPress/gutenberg/pull/40435))

- Add new `commentTitle` icon. ([#40419](https://github.com/WordPress/gutenberg/pull/40419))

Expand Down
1 change: 1 addition & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export { default as download } from './library/download';
export { default as edit } from './library/edit';
export { default as external } from './library/external';
export { default as file } from './library/file';
export { default as filter } from './library/filter';
export { default as flipHorizontal } from './library/flip-horizontal';
export { default as flipVertical } from './library/flip-vertical';
export { default as formatBold } from './library/format-bold';
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/src/library/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const filter = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" />
</SVG>
);

export default filter;

0 comments on commit 8660703

Please sign in to comment.