mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix Google Pay preview config and style
This commit is contained in:
parent
f3bac3c51f
commit
c794ad20e9
1 changed files with 18 additions and 8 deletions
|
@ -4,7 +4,13 @@ import PreviewButton from '../../../../ppcp-button/resources/js/modules/Preview/
|
||||||
/**
|
/**
|
||||||
* A single GooglePay preview button instance.
|
* A single GooglePay preview button instance.
|
||||||
*/
|
*/
|
||||||
export default class GooglePayPreviewButton extends PreviewButton {
|
export default class GooglePayPreviewButton extends PreviewButton { /**
|
||||||
|
* Instance of the preview button.
|
||||||
|
*
|
||||||
|
* @type {?PaymentButton}
|
||||||
|
*/
|
||||||
|
#button = null;
|
||||||
|
|
||||||
constructor( args ) {
|
constructor( args ) {
|
||||||
super( args );
|
super( args );
|
||||||
|
|
||||||
|
@ -21,14 +27,18 @@ export default class GooglePayPreviewButton extends PreviewButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
createButton( buttonConfig ) {
|
createButton( buttonConfig ) {
|
||||||
const button = new GooglepayButton(
|
if (!this.#button) {
|
||||||
'preview',
|
this.#button = new GooglepayButton(
|
||||||
null,
|
'preview',
|
||||||
buttonConfig,
|
null,
|
||||||
this.ppcpConfig
|
buttonConfig,
|
||||||
);
|
this.ppcpConfig
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
button.init( this.apiConfig );
|
this.#button.configure( this.apiConfig, null );
|
||||||
|
this.#button.applyButtonStyles( buttonConfig, this.ppcpConfig );
|
||||||
|
this.#button.reinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue