Set control label per context
This commit is contained in:
parent
6e09d7b480
commit
cd537befbe
|
@ -81,6 +81,7 @@ function useProducts(
|
|||
}
|
||||
|
||||
export const HandPickedProductsControlField = ( {
|
||||
label,
|
||||
query,
|
||||
trackInteraction,
|
||||
setQueryAttribute,
|
||||
|
@ -151,7 +152,7 @@ export const HandPickedProductsControlField = ( {
|
|||
return (
|
||||
<FormTokenField
|
||||
displayTransform={ transformTokenIntoProductName }
|
||||
label={ __( 'Select Products', 'woocommerce' ) }
|
||||
label={ label || __( 'Hand-Picked Products', 'woocommerce' ) }
|
||||
onChange={ onTokenChange }
|
||||
onInputChange={ isLargeCatalog ? handleSearch : undefined }
|
||||
suggestions={ suggestions }
|
||||
|
|
|
@ -289,6 +289,7 @@ const CollectionSpecificControls = (
|
|||
'woocommerce/product-collection/hand-picked' && (
|
||||
<HandPickedProductsControlField
|
||||
{ ...queryControlProps }
|
||||
label={ __( 'Select Products', 'woocommerce' ) }
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ export type DisplayLayoutControlProps = {
|
|||
setAttributes: ProductCollectionSetAttributes;
|
||||
};
|
||||
export type QueryControlProps = {
|
||||
label?: string;
|
||||
query: ProductCollectionQuery;
|
||||
trackInteraction: TrackInteraction;
|
||||
setQueryAttribute: ( attrs: Partial< ProductCollectionQuery > ) => void;
|
||||
|
|
Loading…
Reference in New Issue