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

Commit ed48fc3

Browse files
committed
fix typescript errors
1 parent 0696a64 commit ed48fc3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

assets/js/blocks/products/all-products/edit.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type EditorAttributes = {
5353
alignButtons: boolean;
5454
contentVisibility: object;
5555
orderby: string;
56-
layoutConfig: Array< number >;
56+
layoutConfig: Array< object >;
5757
isPreview: boolean;
5858
};
5959

@@ -233,6 +233,7 @@ class Editor extends Component< EditorProps, EditorState > {
233233
<li className="wc-block-grid__product">
234234
<ProductDataContextProvider
235235
product={ previewProducts[ 0 ] }
236+
isLoading={ false }
236237
>
237238
{ /* @ts-expect-error: `InnerBlocks` is a component that is typed in WordPress core*/ }
238239
<InnerBlocks { ...InnerBlockProps } />

assets/js/blocks/products/base-utils.js renamed to assets/js/blocks/products/base-utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* External dependencies
33
*/
44
import classnames from 'classnames';
5+
import { BlockInstance } from '@wordpress/blocks';
56

67
/**
78
* Internal dependencies
@@ -12,7 +13,7 @@ import { ImageSizing } from '../../atomic/blocks/product-elements/image/types';
1213
/**
1314
* The default layout built from the default template.
1415
*/
15-
export const DEFAULT_PRODUCT_LIST_LAYOUT = [
16+
export const DEFAULT_PRODUCT_LIST_LAYOUT: [ string, object? ][] = [
1617
[ 'woocommerce/product-image', { imageSizing: ImageSizing.THUMBNAIL } ],
1718
[ 'woocommerce/product-title' ],
1819
[ 'woocommerce/product-price' ],
@@ -25,7 +26,9 @@ export const DEFAULT_PRODUCT_LIST_LAYOUT = [
2526
*
2627
* @param {Object[]} innerBlocks Inner block components.
2728
*/
28-
export const getProductLayoutConfig = ( innerBlocks ) => {
29+
export const getProductLayoutConfig = (
30+
innerBlocks: BlockInstance[]
31+
): [ string, object? ][] => {
2932
if ( ! innerBlocks || innerBlocks.length === 0 ) {
3033
return [];
3134
}

0 commit comments

Comments
 (0)