Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Do not merge: Button: Update deprecated props #12095

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ProductSelector = ( {
} }
/>
<Button
isSecondary
variant="secondary"
disabled={ ! productId }
onClick={ () => {
setIsEditing( false );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const withProductSelector = ( selectorArgs ) => ( OriginalComponent ) => {
} }
/>
<Button
isSecondary
variant="secondary"
disabled={ ! productId }
onClick={ () => {
setIsEditing( false );
Expand Down
6 changes: 3 additions & 3 deletions assets/js/blocks/attribute-filter/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ const Edit = ( {
</p>
<Button
className="wc-block-attribute-filter__add-attribute-button"
isSecondary
variant="secondary"
href={ getAdminLink(
'edit.php?post_type=product&page=product_attributes'
) }
Expand All @@ -360,7 +360,7 @@ const Edit = ( {
</Button>
<Button
className="wc-block-attribute-filter__read_more_button"
isTertiary
variant="tertiary"
href="https://docs.woocommerce.com/document/managing-product-taxonomies/"
target="_blank"
>
Expand Down Expand Up @@ -397,7 +397,7 @@ const Edit = ( {
</div>
<div className="wc-block-attribute-filter__selection">
{ renderAttributeControl( { isCompact: false } ) }
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NoShippingPlaceholder = () => {
) }
</span>
<Button
isSecondary
variant="secondary"
href={ `${ ADMIN_URL }admin.php?page=wc-settings&tab=shipping` }
target="_blank"
rel="noopener noreferrer"
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/classic-template/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
return (
<div className="wp-block-woocommerce-classic-template__placeholder-migration-button-container">
<Button
isPrimary
variant="primary"
onClick={ () => {
onClickCallback( {
clientId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const NoAttributesPlaceholder = () => (
</p>
<Button
className="wc-block-attribute-filter__add-attribute-button"
isSecondary
variant="secondary"
href={ getAdminLink(
'edit.php?post_type=product&page=product_attributes'
) }
Expand All @@ -45,7 +45,7 @@ export const NoAttributesPlaceholder = () => (
</Button>
<Button
className="wc-block-attribute-filter__read_more_button"
isTertiary
variant="tertiary"
href="https://docs.woocommerce.com/document/managing-product-taxonomies/"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const Edit = ( props: EditProps ) => {
}
/>
<Button
isPrimary
variant="primary"
onClick={ () => {
setIsEditing( false );
debouncedSpeak(
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/featured-items/with-edit-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const withEditMode =
} }
/>
) }
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/handpicked-products/edit-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const HandpickedProductsEditMode = (
setAttributes( { products: ids } );
} }
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/blocks/price-filter/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function ( {
</p>
<Button
className="wc-block-price-slider__add-product-button"
isSecondary
variant="secondary"
href={ getAdminLink( 'post-new.php?post_type=product' ) }
target="_top"
>
Expand All @@ -144,7 +144,7 @@ export default function ( {
</Button>
<Button
className="wc-block-price-slider__read_more_button"
isTertiary
variant="tertiary"
href="https://docs.woocommerce.com/document/managing-products/"
target="_blank"
>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/blocks/product-category/edit-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export const ProductsByCategoryEditMode = (
setChangedAttributes( { catOperator: value } )
}
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
<Button
className="wc-block-products-category__cancel-button"
isTertiary
variant="tertiary"
onClick={ onCancel }
>
{ __( 'Cancel', 'woo-gutenberg-products-block' ) }
Expand Down
4 changes: 2 additions & 2 deletions assets/js/blocks/product-tag/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ const ProductsByTagBlock = ( {
} )
}
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
<Button
className="wc-block-product-tag__cancel-button"
isTertiary
variant="tertiary"
onClick={ onCancel }
>
{ __( 'Cancel', 'woo-gutenberg-products-block' ) }
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/products-by-attribute/edit-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ProductsByAttributeEditMode = (
setAttributes( { attrOperator: value } )
}
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/blocks/products/all-products/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ class Editor extends Component {
<div className="wc-block-all-products__actions">
<Button
className="wc-block-all-products__done-button"
isPrimary
variant="primary"
onClick={ onDone }
>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
<Button
className="wc-block-all-products__cancel-button"
isTertiary
variant="tertiary"
onClick={ onCancel }
>
{ __( 'Cancel', 'woo-gutenberg-products-block' ) }
Expand Down
4 changes: 2 additions & 2 deletions assets/js/blocks/products/edit-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
</p>
<Button
className="wc-block-products__add-product-button"
isSecondary
variant="secondary"
href={ ADMIN_URL + 'post-new.php?post_type=product' }
target="_top"
>
Expand All @@ -29,7 +29,7 @@ export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
</Button>
<Button
className="wc-block-products__read_more_button"
isTertiary
variant="tertiary"
href="https://docs.woocommerce.com/document/managing-products/"
target="_blank"
>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/reviews/reviews-by-category/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const ReviewsByCategoryEditor = ( {
} }
showReviewCount={ true }
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/reviews/reviews-by-product/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const ReviewsByProductEditor = ( {
} }
renderItem={ renderProductControlItem }
/>
<Button isPrimary onClick={ onDone }>
<Button variant="primary" onClick={ onDone }>
{ __( 'Done', 'woo-gutenberg-products-block' ) }
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/single-product/edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const Editor = ( {
setAttributes={ setAttributes }
/>
<Button
isSecondary
variant="secondary"
onClick={ () => {
setIsEditing( false );
} }
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/single-product/edit/layout-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const LayoutEditor = ( {
'woo-gutenberg-products-block'
) }
onClick={ resetInnerBlocks }
isTertiary
variant="tertiary"
className="wc-block-editor-single-product__reset-layout"
icon={ backup }
>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/editor-components/error-placeholder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ErrorPlaceholder = ( {
{ isLoading ? (
<Spinner />
) : (
<Button isSecondary onClick={ onRetry }>
<Button variant="secondary" onClick={ onRetry }>
{ __( 'Retry', 'woo-gutenberg-products-block' ) }
</Button>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const SelectedListItems = < T extends object = object >( {
<strong>{ messages.selected( selectedCount ) }</strong>
{ selectedCount > 0 ? (
<Button
isLink
variant="link"
isDestructive
onClick={ () => onChange( [] ) }
aria-label={ messages.clear }
Expand Down
Loading