Skip to content

Commit

Permalink
Fixed Affirm using black logo on dark themes (#9805)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 authored Dec 3, 2024
1 parent a622dac commit 6cff322
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-upe-theme-block
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fixed Affirm using black logo on dark themes
2 changes: 0 additions & 2 deletions client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const upeMethods = {
};

const enabledPaymentMethodsConfig = getUPEConfig( 'paymentMethodsConfig' );
const upeAppearanceTheme = getUPEConfig( 'wcBlocksUPEAppearanceTheme' );
const isStripeLinkEnabled = isLinkEnabled( enabledPaymentMethodsConfig );

// Create an API object, which will be used throughout the checkout.
Expand Down Expand Up @@ -116,7 +115,6 @@ Object.entries( enabledPaymentMethodsConfig )
iconLight={ upeConfig.icon }
iconDark={ upeConfig.darkIcon }
upeName={ upeName }
upeAppearanceTheme={ upeAppearanceTheme }
/>
),
ariaLabel: 'WooPayments',
Expand Down
14 changes: 5 additions & 9 deletions client/checkout/blocks/payment-method-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,15 @@ const PaymentMethodMessageWrapper = ( {
);
};

export default ( {
api,
title,
countries,
iconLight,
iconDark,
upeName,
upeAppearanceTheme,
} ) => {
export default ( { api, title, countries, iconLight, iconDark, upeName } ) => {
const cartData = wp.data.select( 'wc/store/cart' ).getCartData();
const isTestMode = getUPEConfig( 'testMode' );
const [ appearance, setAppearance ] = useState(
getUPEConfig( 'wcBlocksUPEAppearance' )
);
const [ upeAppearanceTheme, setUpeAppearanceTheme ] = useState(
getUPEConfig( 'wcBlocksUPEAppearanceTheme' )
);

// Stripe expects the amount to be sent as the minor unit of 2 digits.
const amount = parseInt(
Expand All @@ -86,6 +81,7 @@ export default ( {
'blocks_checkout'
);
setAppearance( upeAppearance );
setUpeAppearanceTheme( upeAppearance.theme );
}

if ( ! appearance ) {
Expand Down

0 comments on commit 6cff322

Please sign in to comment.