Skip to content

Commit

Permalink
card_stop adding credit/debit class to non-cards (#2465)
Browse files Browse the repository at this point in the history
* card_stop adding credit/debit class to non-cards

* Adding changeset file
  • Loading branch information
sponglord authored Nov 23, 2023
1 parent 4e6f174 commit f461447
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/cool-hotels-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@adyen/adyen-web': patch
---

For all PaymentMethodItems we were adding a class `adyen-checkout__payment-method--{fundingSource}` (where fundingSource was either "credit" or "debit")

This is meant to be a Card PM specific class to indicate, in the paymentMethods list, whether the card is a credit or debit card.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ class PaymentMethodItem extends Component<PaymentMethodItemProps> {
return null;
}

const isCard = paymentMethod.props.type === 'card' || paymentMethod.props.type === 'scheme';

const paymentMethodClassnames = classNames({
'adyen-checkout__payment-method': true,
[styles['adyen-checkout__payment-method']]: true,
[`adyen-checkout__payment-method--${paymentMethod.props.type}`]: true,
[`adyen-checkout__payment-method--${paymentMethod.props.fundingSource ?? 'credit'}`]: true,
...(isCard && { [`adyen-checkout__payment-method--${paymentMethod.props.fundingSource ?? 'credit'}`]: true }),
'adyen-checkout__payment-method--selected': isSelected,
[styles['adyen-checkout__payment-method--selected']]: isSelected,
'adyen-checkout__payment-method--loading': isLoading,
Expand Down

0 comments on commit f461447

Please sign in to comment.