2021-09-21 12:38:56 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { useStoreCart } from '@woocommerce/base-context/hooks';
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2021-09-21 12:38:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2022-04-07 13:47:58 +00:00
|
|
|
import { CartExpressPayment } from '../../../cart-checkout-shared/payment-methods';
|
2021-09-21 12:38:56 +00:00
|
|
|
|
2021-10-25 15:31:22 +00:00
|
|
|
const Block = ( { className }: { className: string } ): JSX.Element | null => {
|
2021-09-21 12:38:56 +00:00
|
|
|
const { cartNeedsPayment } = useStoreCart();
|
|
|
|
|
|
|
|
if ( ! cartNeedsPayment ) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2024-05-31 03:49:36 +00:00
|
|
|
<div className={ clsx( 'wc-block-cart__payment-options', className ) }>
|
2021-09-21 12:38:56 +00:00
|
|
|
<CartExpressPayment />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Block;
|