Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Make Product SKU editable (#8804)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmanijak authored Mar 22, 2023
1 parent 003d2d8 commit 32ba22d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/atomic/blocks/product-elements/sku/edit.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
import { useBlockProps } from '@wordpress/block-editor';
import type { BlockEditProps } from '@wordpress/blocks';
import EditProductLink from '@woocommerce/editor-components/edit-product-link';
import { ProductQueryContext as Context } from '@woocommerce/blocks/product-query/types';
Expand All @@ -17,6 +18,7 @@ const Edit = ( {
setAttributes,
context,
}: BlockEditProps< Attributes > & { context: Context } ): JSX.Element => {
const blockProps = useBlockProps();
const blockAttrs = {
...attributes,
...context,
Expand All @@ -29,10 +31,10 @@ const Edit = ( {
);

return (
<>
<div { ...blockProps }>
<EditProductLink />
<Block { ...blockAttrs } />
</>
</div>
);
};

Expand Down

0 comments on commit 32ba22d

Please sign in to comment.