Improve title for edit button (https://github.com/woocommerce/woocommerce-blocks/pull/5113)
* Improve title for edit button woocommerce/woocommerce-blocks#1689 Improve title for edit button * fix edit title for Product By Attribute and All Products blocks
This commit is contained in:
parent
645d534bda
commit
b5875d13ca
|
@ -111,7 +111,10 @@ const FeaturedCategory = ( {
|
|||
controls={ [
|
||||
{
|
||||
icon: 'edit',
|
||||
title: __( 'Edit', 'woo-gutenberg-products-block' ),
|
||||
title: __(
|
||||
'Edit selected category',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
setAttributes( { editMode: ! editMode } ),
|
||||
isActive: editMode,
|
||||
|
|
|
@ -161,7 +161,10 @@ const FeaturedProduct = ( {
|
|||
controls={ [
|
||||
{
|
||||
icon: 'edit',
|
||||
title: __( 'Edit', 'woo-gutenberg-products-block' ),
|
||||
title: __(
|
||||
'Edit selected product',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
setAttributes( { editMode: ! editMode } ),
|
||||
isActive: editMode,
|
||||
|
|
|
@ -170,7 +170,7 @@ class ProductsBlock extends Component {
|
|||
{
|
||||
icon: 'edit',
|
||||
title: __(
|
||||
'Edit',
|
||||
'Edit selected products',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
|
|
|
@ -291,7 +291,7 @@ class ProductByCategoryBlock extends Component {
|
|||
{
|
||||
icon: 'edit',
|
||||
title: __(
|
||||
'Edit',
|
||||
'Edit selected categories',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
|
|
|
@ -273,7 +273,7 @@ class ProductsByTagBlock extends Component {
|
|||
{
|
||||
icon: 'edit',
|
||||
title: __(
|
||||
'Edit',
|
||||
'Edit selected tags',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
|
|
|
@ -171,7 +171,7 @@ class ProductsByAttributeBlock extends Component {
|
|||
{
|
||||
icon: 'edit',
|
||||
title: __(
|
||||
'Edit',
|
||||
'Edit selected attribute',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () =>
|
||||
|
|
|
@ -148,7 +148,10 @@ class Editor extends Component {
|
|||
controls={ [
|
||||
{
|
||||
icon: 'edit',
|
||||
title: __( 'Edit', 'woo-gutenberg-products-block' ),
|
||||
title: __(
|
||||
'Edit inner product layout',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () => this.togglePreview(),
|
||||
isActive: isEditing,
|
||||
},
|
||||
|
|
|
@ -14,13 +14,13 @@ import { BlockControls } from '@wordpress/block-editor';
|
|||
import { getAdminLink, getSetting } from '@woocommerce/settings';
|
||||
import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
|
||||
|
||||
export const getBlockControls = ( editMode, setAttributes ) => (
|
||||
export const getBlockControls = ( editMode, setAttributes, buttonTitle ) => (
|
||||
<BlockControls>
|
||||
<ToolbarGroup
|
||||
controls={ [
|
||||
{
|
||||
icon: 'edit',
|
||||
title: __( 'Edit', 'woo-gutenberg-products-block' ),
|
||||
title: buttonTitle,
|
||||
onClick: () => setAttributes( { editMode: ! editMode } ),
|
||||
isActive: editMode,
|
||||
},
|
||||
|
|
|
@ -139,9 +139,14 @@ const ReviewsByCategoryEditor = ( {
|
|||
return renderEditMode();
|
||||
}
|
||||
|
||||
const buttonTitle = __(
|
||||
'Edit selected categories',
|
||||
'woo-gutenberg-products-block'
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{ getBlockControls( editMode, setAttributes ) }
|
||||
{ getBlockControls( editMode, setAttributes, buttonTitle ) }
|
||||
{ getInspectorControls() }
|
||||
<EditorContainerBlock
|
||||
attributes={ attributes }
|
||||
|
|
|
@ -162,9 +162,14 @@ const ReviewsByProductEditor = ( {
|
|||
return renderEditMode();
|
||||
}
|
||||
|
||||
const buttonTitle = __(
|
||||
'Edit selected product',
|
||||
'woo-gutenberg-products-block'
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{ getBlockControls( editMode, setAttributes ) }
|
||||
{ getBlockControls( editMode, setAttributes, buttonTitle ) }
|
||||
{ getInspectorControls() }
|
||||
<EditorContainerBlock
|
||||
attributes={ attributes }
|
||||
|
|
|
@ -19,7 +19,10 @@ const EditorBlockControls = ( { isEditing, setIsEditing } ) => {
|
|||
controls={ [
|
||||
{
|
||||
icon: 'edit',
|
||||
title: __( 'Edit', 'woo-gutenberg-products-block' ),
|
||||
title: __(
|
||||
'Edit selected product',
|
||||
'woo-gutenberg-products-block'
|
||||
),
|
||||
onClick: () => setIsEditing( ! isEditing ),
|
||||
isActive: isEditing,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue