Update Edit props type for description

This commit is contained in:
Matt Sherman 2023-09-27 23:39:12 -04:00
parent 73815bdef7
commit e28da2912a
2 changed files with 9 additions and 3 deletions

View File

@ -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 >(

View File

@ -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,
} );