Update Edit props type for inventory-sku
This commit is contained in:
parent
db0c738b12
commit
120efa3022
|
@ -2,7 +2,7 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { BlockEditProps, BlockAttributes } from '@wordpress/blocks';
|
import { BlockAttributes } from '@wordpress/blocks';
|
||||||
import { createElement, createInterpolateElement } from '@wordpress/element';
|
import { createElement, createInterpolateElement } from '@wordpress/element';
|
||||||
import { useWooBlockProps } from '@woocommerce/block-templates';
|
import { useWooBlockProps } from '@woocommerce/block-templates';
|
||||||
|
|
||||||
|
@ -19,8 +19,15 @@ import { useEntityProp } from '@wordpress/core-data';
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
import { ProductEditorBlockEditProps } from '../../types';
|
||||||
|
|
||||||
export function Edit( { attributes }: BlockEditProps< BlockAttributes > ) {
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function Edit( {
|
||||||
|
attributes,
|
||||||
|
}: ProductEditorBlockEditProps< BlockAttributes > ) {
|
||||||
const blockProps = useWooBlockProps( attributes );
|
const blockProps = useWooBlockProps( attributes );
|
||||||
|
|
||||||
const [ sku, setSku ] = useEntityProp( 'postType', 'product', 'sku' );
|
const [ sku, setSku ] = useEntityProp( 'postType', 'product', 'sku' );
|
||||||
|
|
|
@ -19,4 +19,8 @@ export const settings = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const init = () =>
|
export const init = () =>
|
||||||
registerWooBlockType( { name, metadata: metadata as never, settings } );
|
registerWooBlockType( {
|
||||||
|
name,
|
||||||
|
metadata: metadata as never,
|
||||||
|
settings: settings as never,
|
||||||
|
} );
|
||||||
|
|
Loading…
Reference in New Issue