Make the start shopping button show the theme style (https://github.com/woocommerce/woocommerce-blocks/pull/8567)

* Make the start shopping button show the theme style

* Center the button

* Fix test
This commit is contained in:
Alba Rincón 2023-03-03 10:55:28 +01:00 committed by GitHub
parent 1d0adeed28
commit 7245ca519e
2 changed files with 11 additions and 9 deletions

View File

@ -2,6 +2,7 @@
* External dependencies
*/
import { SHOP_URL } from '@woocommerce/block-settings';
import Button from '@woocommerce/base-components/button';
import classNames from 'classnames';
/**
@ -23,15 +24,16 @@ const Block = ( {
}
return (
<div
className={ classNames(
className,
'wc-block-mini-cart__shopping-button'
) }
>
<a href={ SHOP_URL }>
<div className="wp-block-button has-text-align-center">
<Button
className={ classNames(
className,
'wc-block-mini-cart__shopping-button'
) }
href={ SHOP_URL }
>
{ startShoppingButtonLabel || defaultStartShoppingButtonLabel }
</a>
</Button>
</div>
);
};

View File

@ -191,7 +191,7 @@ describe( 'Shopper → Mini Cart', () => {
);
const shopLink = await page.$eval(
'.wc-block-mini-cart__shopping-button a',
'a.wc-block-mini-cart__shopping-button',
( el ) => el.href
);