[Product Block editor]: rename component edit function (#41741)

This commit is contained in:
Damián Suárez 2023-11-30 08:42:21 -03:00 committed by GitHub
commit bc9e2118c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 10 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
[Product Block editor]: rename component edit function

View File

@ -18,11 +18,12 @@ import { sanitizeHTML } from '../../../utils/sanitize-html';
import { SectionBlockAttributes } from './types';
import { ProductEditorBlockEditProps } from '../../../types';
export function Edit( {
export function SectionBlockEdit( {
attributes,
clientId,
}: ProductEditorBlockEditProps< SectionBlockAttributes > ) {
const { description, title, blockGap } = attributes;
const blockProps = useWooBlockProps( attributes );
const innerBlockProps = useInnerBlocksProps(
{

View File

@ -7,7 +7,7 @@ import { registerProductEditorBlockType } from '../../../utils';
* Internal dependencies
*/
import blockConfiguration from './block.json';
import { Edit } from './edit';
import { SectionBlockEdit } from './edit';
const { name, ...metadata } = blockConfiguration;
@ -15,7 +15,7 @@ export { metadata, name };
export const settings = {
example: {},
edit: Edit,
edit: SectionBlockEdit,
};
export function init() {

View File

@ -19,7 +19,7 @@ export interface TabBlockAttributes extends BlockAttributes {
isSelected?: boolean;
}
export function Edit( {
export function TabBlockEdit( {
setAttributes,
attributes,
context,

View File

@ -7,7 +7,7 @@ import { registerProductEditorBlockType } from '../../../utils';
* Internal dependencies
*/
import blockConfiguration from './block.json';
import { Edit } from './edit';
import { TabBlockEdit } from './edit';
const { name, ...metadata } = blockConfiguration;
@ -15,7 +15,7 @@ export { metadata, name };
export const settings = {
example: {},
edit: Edit,
edit: TabBlockEdit,
};
export function init() {

View File

@ -46,7 +46,7 @@ function clearDescriptionIfEmpty( blocks: BlockInstance[] ) {
return blocks;
}
export function Edit( {
export function DescriptionBlockEdit( {
attributes,
}: ProductEditorBlockEditProps< BlockAttributes > ) {
const blockProps = useWooBlockProps( attributes );

View File

@ -2,7 +2,7 @@
* Internal dependencies
*/
import blockConfiguration from './block.json';
import { Edit } from './edit';
import { DescriptionBlockEdit } from './edit';
import { registerProductEditorBlockType } from '../../../utils';
const { name, ...metadata } = blockConfiguration;
@ -11,7 +11,7 @@ export { metadata, name };
export const settings = {
example: {},
edit: Edit,
edit: DescriptionBlockEdit,
};
export const init = () =>

View File

@ -11,7 +11,7 @@ import { useState } from '@wordpress/element';
* Internal dependencies
*/
import { Tabs } from '../';
import { Edit as Tab } from '../../../blocks/generic/tab/edit';
import { TabBlockEdit as Tab } from '../../../blocks/generic/tab/edit';
jest.mock( '@woocommerce/block-templates', () => ( {
...jest.requireActual( '@woocommerce/block-templates' ),