Update Edit props type for description
This commit is contained in:
parent
73815bdef7
commit
e28da2912a
|
@ -4,7 +4,6 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { createElement, useState } from '@wordpress/element';
|
||||
import {
|
||||
BlockEditProps,
|
||||
BlockAttributes,
|
||||
BlockInstance,
|
||||
parse,
|
||||
|
@ -20,6 +19,7 @@ import { useEntityProp } from '@wordpress/core-data';
|
|||
*/
|
||||
import { ContentPreview } from '../../components/content-preview';
|
||||
import { ModalEditor } from '../../components/modal-editor';
|
||||
import { ProductEditorBlockEditProps } from '../../types';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -45,7 +45,9 @@ function clearDescriptionIfEmpty( blocks: BlockInstance[] ) {
|
|||
return blocks;
|
||||
}
|
||||
|
||||
export function Edit( { attributes }: BlockEditProps< BlockAttributes > ) {
|
||||
export function Edit( {
|
||||
attributes,
|
||||
}: ProductEditorBlockEditProps< BlockAttributes > ) {
|
||||
const blockProps = useWooBlockProps( attributes );
|
||||
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
||||
const [ description, setDescription ] = useEntityProp< string >(
|
||||
|
|
|
@ -19,4 +19,8 @@ export const settings = {
|
|||
};
|
||||
|
||||
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