From 423cdce744e232d9922a2cefe0acaf66fc65860c Mon Sep 17 00:00:00 2001 From: Bart Kalisz Date: Fri, 6 Sep 2024 12:52:05 +0200 Subject: [PATCH] add back --- .../collections/hand-picked.tsx | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 plugins/woocommerce-blocks/assets/js/blocks/product-collection/collections/hand-picked.tsx diff --git a/plugins/woocommerce-blocks/assets/js/blocks/product-collection/collections/hand-picked.tsx b/plugins/woocommerce-blocks/assets/js/blocks/product-collection/collections/hand-picked.tsx new file mode 100644 index 00000000000..afbf5177b85 --- /dev/null +++ b/plugins/woocommerce-blocks/assets/js/blocks/product-collection/collections/hand-picked.tsx @@ -0,0 +1,95 @@ +/** + * External dependencies + */ +import type { InnerBlockTemplate } from '@wordpress/blocks'; +import { __ } from '@wordpress/i18n'; +import { Icon } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import { INNER_BLOCKS_PRODUCT_TEMPLATE } from '../constants'; +import { + CoreCollectionNames, + CoreFilterNames, + ETimeFrameOperator, +} from '../types'; + +const handPickedIcon = ( + + + + + + + + +); + +const collection = { + name: CoreCollectionNames.HAND_PICKED, + title: __( 'Hand Picked', 'woocommerce' ), + icon: , + description: __( 'Recommend your hand-picked products.', 'woocommerce' ), + keywords: [ 'hand-picked products', 'product collection' ], + scope: [], +}; + +const attributes = { + displayLayout: { + type: 'flex', + columns: 5, + shrinkColumns: true, + }, + query: { + orderBy: 'date', + order: 'desc', + perPage: 5, + pages: 1, + timeFrame: { + operator: ETimeFrameOperator.IN, + value: '-7 days', + }, + }, + hideControls: [ CoreFilterNames.HAND_PICKED ], +}; + +const heading: InnerBlockTemplate = [ + 'core/heading', + { + textAlign: 'center', + level: 2, + content: __( 'Hand Picked', 'woocommerce' ), + style: { spacing: { margin: { bottom: '1rem' } } }, + }, +]; + +const innerBlocks: InnerBlockTemplate[] = [ + heading, + INNER_BLOCKS_PRODUCT_TEMPLATE, +]; + +export default { + ...collection, + attributes, + innerBlocks, +};