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