PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.0.2
GenerateBlocks v2.0.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / components / icon-wrapper / index.js
generateblocks / src / components / icon-wrapper Last commit date
test 2 years ago index.js 4 years ago
index.js
30 lines
1 import { Fragment } from '@wordpress/element';
2
3 export default ( {
4 icon,
5 hasIcon = true,
6 direction = 'left',
7 children,
8 hideChildren = false,
9 showWrapper = false,
10 wrapperClassname = '',
11 } ) => {
12 const Icon = icon ? (
13 <span
14 className="gb-icon"
15 dangerouslySetInnerHTML={ { __html: icon } }
16 />
17 ) : undefined;
18
19 return (
20 <Fragment>
21 { hasIcon && 'left' === direction && Icon }
22 { hideChildren || ( showWrapper
23 ? <span className={ wrapperClassname }>{ children }</span>
24 : children
25 ) }
26 { hasIcon && 'right' === direction && Icon }
27 </Fragment>
28 );
29 };
30