-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
index.js
29 lines (25 loc) · 895 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { createElement } from '@wordpress/element';
export const Circle = ( props ) => createElement( 'circle', props );
export const G = ( props ) => createElement( 'g', props );
export const Path = ( props ) => createElement( 'path', props );
export const Polygon = ( props ) => createElement( 'polygon', props );
export const Rect = ( props ) => createElement( 'rect', props );
export const SVG = ( { className, isPressed, ...props } ) => {
const appliedProps = {
...props,
className: classnames( className, { 'is-pressed': isPressed } ) || undefined,
role: 'img',
'aria-hidden': 'true',
focusable: 'false',
};
// Disable reason: We need to have a way to render HTML tag for web.
// eslint-disable-next-line react/forbid-elements
return <svg { ...appliedProps } />;
};