Skip to content

Commit

Permalink
refactor: upgrading to rescript v11 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrishab Srivatsa committed Mar 20, 2024
1 parent f781880 commit 5f5a02a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/CardUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ let clientTimeZone = dateTimeFormat().resolvedOptions().timeZone
let clientCountry = Utils.getClientCountry(clientTimeZone)

let postalRegex = (postalCodes: array<PostalCodeType.postalCodes>, ~country=?, ()) => {
let country = country->Belt.Option.getWithDefault(clientCountry.isoAlpha2)
let country = country->Option.getOr(clientCountry.isoAlpha2)
let countryPostal = Utils.getCountryPostal(country, postalCodes)
countryPostal.regex
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/SurchargeUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let useSurchargeDetailsForOneClickWallets = (~list) => {
RecoilAtoms.areOneClickWalletsRendered,
)

React.useMemo2(() => {
React.useMemo(() => {
oneClickWallets->Array.reduce([], (acc, wallet) => {
let isWalletBtnRendered = switch wallet.paymentMethodType {
| "apple_pay" => areOneClickWalletsRendered.isApplePay
Expand Down
2 changes: 1 addition & 1 deletion src/LoaderController.res
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger) => {
let appearance =
optionsAppearance == CardTheme.defaultAppearance ? config.appearance : optionsAppearance
let localeString = CardTheme.getLocaleObject(localeString == "" ? config.locale : localeString)
setConfig(._ => {
setConfig(_ => {
config: {
appearance,
locale: config.locale,
Expand Down
6 changes: 3 additions & 3 deletions src/Payment.res
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ let make = (~paymentMode, ~integrateError, ~logger) => {

React.useEffect(() => {
setCardError(_ =>
isCardValid->Belt.Option.getWithDefault(true) ? "" : localeString.inValidCardErrorText
isCardValid->Option.getOr(true) ? "" : localeString.inValidCardErrorText
)
None
}, [isCardValid])

React.useEffect(() => {
setCvcError(_ =>
isCVCValid->Belt.Option.getWithDefault(true) ? "" : localeString.inCompleteCVCErrorText
isCVCValid->Option.getOr(true) ? "" : localeString.inCompleteCVCErrorText
)
None
}, [isCVCValid])
Expand All @@ -368,7 +368,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
None
}, (isExpiryValid, isExpiryComplete(cardExpiry)))

let icon = React.useMemo2(() => {
let icon = React.useMemo(() => {
let animate = cardType == NOTFOUND ? "animate-slideLeft" : "animate-slideRight"
let cardBrandIcon = getCardBrandIcon(cardType, paymentType)
<div className=animate> cardBrandIcon </div>
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ let make = (
~isCvcValidValue,
)

let isCustomerAcceptanceRequired = React.useMemo2(() => {
let isCustomerAcceptanceRequired = React.useMemo(() => {
if displaySavedPaymentMethodsCheckbox {
isSaveCardsChecked || list.payment_type === SETUP_MANDATE
} else {
Expand Down

0 comments on commit 5f5a02a

Please sign in to comment.