PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.1
WebberZone Top 10 — Popular Posts v4.5.1
4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 All 117 releases
top-10 / includes / frontend / blocks / src / post-count / edit.js

edit.js in WebberZone Top 10 — Popular Posts 4.5.1, at includes/frontend/blocks/src/post-count/edit.js

40 lines 833 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * External dependencies
3 */
4 import clsx from 'clsx';
5
6 /**
7 * WordPress dependencies
8 */
9 import { useBlockProps } from '@wordpress/block-editor';
10 import './editor.scss';
11 import './style.scss';
12
13 import Controls from './controls';
14 import PostCountBlock from './post-count-block';
15
16 export default function Edit( { context, attributes, setAttributes } ) {
17 const { textAlign } = attributes;
18
19 const blockProps = useBlockProps( {
20 className: clsx( 'wp-block-tptn-post-count', 'tptn-post-count', {
21 [ `has-text-align-${ textAlign }` ]: textAlign,
22 'tptn-advanced-mode': attributes.advancedMode,
23 } ),
24 } );
25
26 return (
27 <>
28 <Controls
29 attributes={ attributes }
30 setAttributes={ setAttributes }
31 />
32 <PostCountBlock
33 attributes={ attributes }
34 context={ context }
35 blockProps={ blockProps }
36 />
37 </>
38 );
39 }
40