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
← All changes | includes/frontend/blocks/src/post-count/edit.js +17 -24 4.4.3 → 4.5.1 View file →
@@ -10,37 +10,30 @@
10 10 import './editor.scss';
11 11 import './style.scss';
12 12
13 13 import Controls from './controls';
14 -import PostCountBlock from './post-count-block'; // Import the new component
14 +import PostCountBlock from './post-count-block';
15 15
16 -/**
17 - * The edit function describes the structure of your block in the context of the
18 - * editor. This represents what the editor will render when the block is used.
19 - *
20 - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
21 - *
22 - * @param {Object} root0 - The root object containing block properties.
23 - * @param {Object} root0.context - The context of the block.
24 - * @param {Object} root0.attributes - The attributes of the block.
25 - * @param {Function} root0.setAttributes - Function to set the block's attributes.
26 - *
27 - * @return {Element} Element to render.
28 - */
29 -export default function Edit({ context, attributes, setAttributes }) {
16 +export default function Edit( { context, attributes, setAttributes } ) {
30 17 const { textAlign } = attributes;
31 18
32 - const blockProps = useBlockProps({
33 - className: clsx({
34 - [`has-text-align-${textAlign}`]: textAlign,
35 - }),
36 - });
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 + } );
37 25
38 26 return (
39 27 <>
40 - <Controls attributes={attributes} setAttributes={setAttributes} />
41 - <div {...blockProps}>
42 - <PostCountBlock attributes={attributes} context={context} />
43 - </div>
28 + <Controls
29 + attributes={ attributes }
30 + setAttributes={ setAttributes }
31 + />
32 + <PostCountBlock
33 + attributes={ attributes }
34 + context={ context }
35 + blockProps={ blockProps }
36 + />
44 37 </>
45 38 );
46 39 }