🚧 Implement getters for wrapper & styles

This commit is contained in:
Philipp Stracker 2024-10-07 11:46:46 +02:00
parent 0ef461e4b2
commit 39b9c784d4
No known key found for this signature in database

View file

@ -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 PaymentButton from '../../../ppcp-button/resources/js/modules/Renderer/PaymentButton';
import { PaymentMethods } from '../../../ppcp-button/resources/js/modules/Helper/CheckoutMethodState';
import {
combineStyles,
combineWrapperIds,
} from '../../../ppcp-button/resources/js/modules/Helper/PaymentButtonHelpers';
/**
* Plugin-specific styling.
@ -67,9 +71,6 @@ class ApplePayButton extends PaymentButton {
static methodId = PaymentMethods.APPLEPAY;
#wrapperId = '';
#ppcpButtonWrapperId = '';
/**
* Context describes the button's location on the website and what details it submits.
*
@ -91,6 +92,29 @@ class ApplePayButton extends PaymentButton {
*/
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(
context,
externalHandler,