mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #2779 from woocommerce/PCP-3861-remove-empty-space-when-applepay-is-not-available
Hide payment button wrapper for ineligible buttons (3861)
This commit is contained in:
commit
d0e1cc1744
1 changed files with 6 additions and 2 deletions
|
@ -175,9 +175,9 @@ export default class PaymentButton {
|
||||||
/**
|
/**
|
||||||
* Whether the current browser/website support the payment method.
|
* Whether the current browser/website support the payment method.
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {?boolean}
|
||||||
*/
|
*/
|
||||||
#isEligible = false;
|
#isEligible = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this button is visible. Modified by `show()` and `hide()`
|
* Whether this button is visible. Modified by `show()` and `hide()`
|
||||||
|
@ -889,6 +889,10 @@ export default class PaymentButton {
|
||||||
if ( ! this.isPresent ) {
|
if ( ! this.isPresent ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( ! this.isEligible ) {
|
||||||
|
this.wrapperElement.style.display = 'none';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.applyWrapperStyles();
|
this.applyWrapperStyles();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue