Add paypal icon to the block checkout

This commit is contained in:
inpsyde-maticluznar 2024-10-18 09:47:42 +02:00
parent de609be21b
commit 82faf9370b
No known key found for this signature in database
GPG key ID: D005973F231309F6
2 changed files with 23 additions and 1 deletions

View file

@ -768,9 +768,24 @@ if ( block_enabled && config.enabled ) {
);
}
const PaypalLabel = ( { components, config } ) => {
const { PaymentMethodIcons } = components;
return (
<>
<span
dangerouslySetInnerHTML={ {
__html: config.title,
} }
/>
<PaymentMethodIcons icons={ config.icon } align="right" />
</>
);
};
registerPaymentMethod( {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
label: <PaypalLabel config={ config } />,
content: descriptionElement,
edit: descriptionElement,
placeOrderButtonLabel: config.placeOrderButtonText,