mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
🚧 Implement getters for wrapper & styles
This commit is contained in:
parent
0ef461e4b2
commit
39b9c784d4
1 changed files with 27 additions and 3 deletions
|
@ -11,6 +11,10 @@ import widgetBuilder from '../../../ppcp-button/resources/js/modules/Renderer/Wi
|
||||||
import { apmButtonsInit } from '../../../ppcp-button/resources/js/modules/Helper/ApmButtons';
|
import { apmButtonsInit } from '../../../ppcp-button/resources/js/modules/Helper/ApmButtons';
|
||||||
import PaymentButton from '../../../ppcp-button/resources/js/modules/Renderer/PaymentButton';
|
import PaymentButton from '../../../ppcp-button/resources/js/modules/Renderer/PaymentButton';
|
||||||
import { PaymentMethods } from '../../../ppcp-button/resources/js/modules/Helper/CheckoutMethodState';
|
import { PaymentMethods } from '../../../ppcp-button/resources/js/modules/Helper/CheckoutMethodState';
|
||||||
|
import {
|
||||||
|
combineStyles,
|
||||||
|
combineWrapperIds,
|
||||||
|
} from '../../../ppcp-button/resources/js/modules/Helper/PaymentButtonHelpers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin-specific styling.
|
* Plugin-specific styling.
|
||||||
|
@ -67,9 +71,6 @@ class ApplePayButton extends PaymentButton {
|
||||||
static methodId = PaymentMethods.APPLEPAY;
|
static methodId = PaymentMethods.APPLEPAY;
|
||||||
|
|
||||||
|
|
||||||
#wrapperId = '';
|
|
||||||
#ppcpButtonWrapperId = '';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context describes the button's location on the website and what details it submits.
|
* Context describes the button's location on the website and what details it submits.
|
||||||
*
|
*
|
||||||
|
@ -91,6 +92,29 @@ class ApplePayButton extends PaymentButton {
|
||||||
*/
|
*/
|
||||||
initialPaymentRequest = null;
|
initialPaymentRequest = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
static getWrappers( buttonConfig, ppcpConfig ) {
|
||||||
|
return combineWrapperIds(
|
||||||
|
buttonConfig?.button?.wrapper || '',
|
||||||
|
buttonConfig?.button?.mini_cart_wrapper || '',
|
||||||
|
ppcpConfig?.button?.wrapper || '',
|
||||||
|
'ppc-button-applepay-container',
|
||||||
|
'ppc-button-ppcp-applepay'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
static getStyles( buttonConfig, ppcpConfig ) {
|
||||||
|
return combineStyles(
|
||||||
|
ppcpConfig?.button || {},
|
||||||
|
buttonConfig?.button || {}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
context,
|
context,
|
||||||
externalHandler,
|
externalHandler,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue