All Products: Re-add alignment controls for Product Rating and Price (https://github.com/woocommerce/woocommerce-blocks/pull/8264)
* Product Rating and Price: Re-add alignment controls in the All Products context. * Add default values to align attributes for price and rating product elements --------- Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
This commit is contained in:
parent
33b3a1d82d
commit
34fc847d9f
|
@ -14,6 +14,7 @@ export const blockAttributes: BlockAttributes = {
|
|||
},
|
||||
textAlign: {
|
||||
type: 'string',
|
||||
default: 'center',
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -59,14 +59,12 @@ const PriceEdit = ( {
|
|||
return (
|
||||
<>
|
||||
<BlockControls>
|
||||
{ isDescendentOfQueryLoop && (
|
||||
<AlignmentToolbar
|
||||
value={ attributes.textAlign }
|
||||
onChange={ ( textAlign: AllowedAlignments ) => {
|
||||
setAttributes( { textAlign } );
|
||||
} }
|
||||
/>
|
||||
) }
|
||||
</BlockControls>
|
||||
<div { ...blockProps }>
|
||||
<Block { ...blockAttrs } />
|
||||
|
|
|
@ -14,7 +14,7 @@ export const blockAttributes: BlockAttributes = {
|
|||
},
|
||||
textAlign: {
|
||||
type: 'string',
|
||||
default: '',
|
||||
default: 'center',
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -42,14 +42,12 @@ const Edit = ( {
|
|||
return (
|
||||
<>
|
||||
<BlockControls>
|
||||
{ isDescendentOfQueryLoop && (
|
||||
<AlignmentToolbar
|
||||
value={ attributes.textAlign }
|
||||
onChange={ ( newAlign ) => {
|
||||
setAttributes( { textAlign: newAlign || '' } );
|
||||
} }
|
||||
/>
|
||||
) }
|
||||
</BlockControls>
|
||||
<div { ...blockProps }>
|
||||
<Block { ...blockAttrs } />
|
||||
|
|
Loading…
Reference in New Issue