From 7b3434c8b51f12e6e6028dcbc9e6cbef98b39003 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Wed, 3 Jul 2024 09:25:12 +0200 Subject: [PATCH] CYS: Fix pattern rendering issues (#49041) * CYS: Fix pattern rendering issues * Add changefile(s) from automation for the following project(s): woocommerce * fix import --------- Co-authored-by: github-actions --- .../sidebar/pattern-screen/sidebar-pattern-screen.tsx | 7 +++++-- ...-patterns-woo-patterns-preview-arent-rendered-correctly | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 plugins/woocommerce/changelog/49041-48680-cys-block-list-patterns-woo-patterns-preview-arent-rendered-correctly diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/pattern-screen/sidebar-pattern-screen.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/pattern-screen/sidebar-pattern-screen.tsx index 78d5f4a1346..8d2cc93a674 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/pattern-screen/sidebar-pattern-screen.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/pattern-screen/sidebar-pattern-screen.tsx @@ -8,6 +8,7 @@ import { useRef, useState, } from '@wordpress/element'; +import { useAsyncList } from '@wordpress/compose'; import { useSelect, useDispatch, select } from '@wordpress/data'; import { BlockInstance, cloneBlock } from '@wordpress/blocks'; import { close } from '@wordpress/icons'; @@ -108,6 +109,8 @@ export const SidebarPatternScreen = ( { category }: { category: string } ) => { ); }, [ category, patterns ] ); + const asyncSortedPatterns = useAsyncList( sortedPatterns ); + const [ patternPagination, setPatternPagination ] = useState( 10 ); const refElement = useRef< HTMLDivElement >( null ); @@ -243,11 +246,11 @@ export const SidebarPatternScreen = ( { category }: { category: string } ) => { ) } { ! isSpinnerVisible && (