Skip to content

Commit

Permalink
refactor: applied suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanskar2001 committed Oct 25, 2024
1 parent 3d6b4da commit a2622b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/CardUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,6 @@ let getEligibleCoBadgedCardSchemes = (~matchedCardSchemes, ~enabledCardSchemes)
})
}

let getCardBrandFromStates = (cardBrand, cardScheme, showFields, isNotBancontact) => {
switch (showFields, isNotBancontact) {
| (false, _) => cardScheme
| (_, true) => cardBrand
| _ => cardBrand
}
let getCardBrandFromStates = (cardBrand, cardScheme, showFields) => {
!showFields ? cardScheme : cardBrand
}
7 changes: 1 addition & 6 deletions src/Payment.res
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
!showFields && isNotBancontact ? cardScheme : cardBrand
)

let cardBrand = CardUtils.getCardBrandFromStates(
cardBrand,
cardScheme,
showFields,
isNotBancontact,
)
let cardBrand = CardUtils.getCardBrandFromStates(cardBrand, cardScheme, showFields)
let supportedCardBrands = React.useMemo(() => {
paymentMethodListValue->PaymentUtils.getSupportedCardBrands
}, [paymentMethodListValue])
Expand Down

0 comments on commit a2622b2

Please sign in to comment.