From 23b0f5131eb29ccdf0b9306f79b556d627278d6f Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Fri, 29 Jul 2022 16:14:54 +0200 Subject: [PATCH] Use BHE hydration for All Products Block --- .../blocks/products/all-products/frontend.js | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/assets/js/blocks/products/all-products/frontend.js b/assets/js/blocks/products/all-products/frontend.js index 4d704bd3e..cbef10d72 100644 --- a/assets/js/blocks/products/all-products/frontend.js +++ b/assets/js/blocks/products/all-products/frontend.js @@ -7,27 +7,30 @@ import { renderFrontend } from '@woocommerce/base-utils'; /** * Internal dependencies */ -import Block from './block'; +import Block from './block.js'; +import { registerBlockType } from '../../../base/utils/bhe-frontend'; /** * Wrapper component to supply the notice provider. * * @param {*} props */ -const AllProductsFrontend = ( props ) => { - return ( - - - - ); -}; +// const AllProductsFrontend = ( props ) => { +// return ( +// +// +// +// ); +// }; -const getProps = ( el ) => ( { - attributes: JSON.parse( el.dataset.attributes ), -} ); +// const getProps = ( el ) => ( { +// attributes: JSON.parse( el.dataset.attributes ), +// } ); -renderFrontend( { - selector: '.wp-block-woocommerce-all-products', - Block: AllProductsFrontend, - getProps, -} ); +// renderFrontend( { +// selector: '.wp-block-woocommerce-all-products', +// Block: AllProductsFrontend, +// getProps, +// } ); + +registerBlockType( 'woocommerce/all-products', Block );