Add buttonAttributes for getting button styles

This commit is contained in:
Emili Castells Guasch 2024-06-18 12:31:50 +02:00 committed by Daniel Dudzic
parent 8b5165ddfc
commit 7782e79aae
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -40,6 +40,7 @@ const PayPalComponent = ( {
shippingData,
isEditing,
fundingSource,
buttonAttributes,
} ) => {
const { onPaymentSetup, onCheckoutFail, onCheckoutValidation } =
eventRegistration;
@ -582,6 +583,12 @@ const PayPalComponent = ( {
fundingSource
);
if ( typeof buttonAttributes !== 'undefined' ) {
style.height = buttonAttributes?.height
? Number( buttonAttributes.height )
: style.height;
}
if ( ! paypalScriptLoaded ) {
return null;
}
@ -606,11 +613,11 @@ const PayPalComponent = ( {
}
return ( data, actions ) => {
let shippingAddressChange = shouldHandleShippingInPayPal()
const shippingAddressChange = shouldHandleShippingInPayPal()
? handleShippingAddressChange( data, actions )
: null;
return shippingAddressChange;
return shippingAddressChange;
};
};