[Product Block editor]: rename component edit function (#41741)
This commit is contained in:
commit
bc9e2118c7
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
[Product Block editor]: rename component edit function
|
|
@ -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(
|
||||
{
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -19,7 +19,7 @@ export interface TabBlockAttributes extends BlockAttributes {
|
|||
isSelected?: boolean;
|
||||
}
|
||||
|
||||
export function Edit( {
|
||||
export function TabBlockEdit( {
|
||||
setAttributes,
|
||||
attributes,
|
||||
context,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -46,7 +46,7 @@ function clearDescriptionIfEmpty( blocks: BlockInstance[] ) {
|
|||
return blocks;
|
||||
}
|
||||
|
||||
export function Edit( {
|
||||
export function DescriptionBlockEdit( {
|
||||
attributes,
|
||||
}: ProductEditorBlockEditProps< BlockAttributes > ) {
|
||||
const blockProps = useWooBlockProps( attributes );
|
||||
|
|
|
@ -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 = () =>
|
||||
|
|
|
@ -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' ),
|
||||
|
|
Loading…
Reference in New Issue