PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.6.0
GenerateBlocks v1.6.0
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 / blocks / container / components / ShapeDividers.js
generateblocks / src / blocks / container / components Last commit date
BlockControls.js 4 years ago ComponentCSS.js 4 years ago ContainerContentRenderer.js 3 years ago GridItem.js 4 years ago InspectorControls.js 4 years ago ShapeDividers.js 4 years ago
ShapeDividers.js
34 lines
1 import { Fragment } from '@wordpress/element';
2 import classnames from 'classnames';
3 import sanitizeSVG from '../../../utils/sanitize-svg';
4
5 export default ( { attributes, allShapes } ) => {
6 const { shapeDividers } = attributes;
7
8 return (
9 <Fragment>
10 { !! attributes.shapeDividers.length &&
11 <div className="gb-shapes">
12 {
13 attributes.shapeDividers.map( ( location, index ) => {
14 const shapeNumber = index + 1;
15
16 return <Fragment key={ index }>
17 { 'undefined' !== typeof allShapes[ shapeDividers[ index ].shape ] &&
18 <div
19 className={ classnames( {
20 'gb-shape': true,
21 [ `gb-shape-${ shapeNumber }` ]: true,
22 } ) }
23 dangerouslySetInnerHTML={ { __html: sanitizeSVG( allShapes[ shapeDividers[ index ].shape ].icon ) } }
24 />
25 }
26 </Fragment>;
27 } )
28 }
29 </div>
30 }
31 </Fragment>
32 );
33 };
34