Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-web into useMemo…
Browse files Browse the repository at this point in the history
…-changes
  • Loading branch information
Pritish Budhiraja committed Mar 21, 2024
2 parents 225da90 + 0194abe commit 2c68231
Show file tree
Hide file tree
Showing 42 changed files with 215 additions and 154 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [0.33.11](https://github.com/juspay/hyperswitch-web/compare/v0.33.10...v0.33.11) (2024-03-21)


### Bug Fixes

* hotfix changes for postal code ([#245](https://github.com/juspay/hyperswitch-web/issues/245)) ([4ba7350](https://github.com/juspay/hyperswitch-web/commit/4ba7350d4bbfbfcb570bd8c56a51a14df06f4dae))

## [0.33.10](https://github.com/juspay/hyperswitch-web/compare/v0.33.9...v0.33.10) (2024-03-20)


### Bug Fixes

* saved Payment Method stuck in loading state and Card Holder Name for every saved card ([#241](https://github.com/juspay/hyperswitch-web/issues/241)) ([6b1bc56](https://github.com/juspay/hyperswitch-web/commit/6b1bc565f659d163297453c6b6f5cc602bee6ff5))

## [0.33.9](https://github.com/juspay/hyperswitch-web/compare/v0.33.8...v0.33.9) (2024-03-19)

## [0.33.8](https://github.com/juspay/hyperswitch-web/compare/v0.33.7...v0.33.8) (2024-03-18)


Expand Down
179 changes: 121 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orca-payment-page",
"version": "0.33.8",
"version": "0.33.11",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/App.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let make = () => {
log
})

React.useEffect1(() => {
React.useEffect(() => {
setLoggerState(_ => logger)
None
}, [logger])
Expand Down
5 changes: 2 additions & 3 deletions src/Components/AddressPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ let make = (~paymentType, ~className="") => {
}
}

React.useEffect2(() => {
React.useEffect(() => {
checkPostalValidity(postalCode, setPostalCode, regex)
None
}, (regex, country.value))

React.useEffect1(() => {
React.useEffect(() => {
setState(prev => {
...prev,
value: "",
Expand Down Expand Up @@ -309,7 +309,6 @@ let make = (~paymentType, ~className="") => {
onChange=onPostalChange
paymentType
className
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down
2 changes: 1 addition & 1 deletion src/Components/BlikCodePaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let make = () => {
})
}

React.useEffect1(() => {
React.useEffect(() => {
setblikCode(prev => {
...prev,
errorString: switch prev.isValid {
Expand Down
10 changes: 4 additions & 6 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ let make = (
~paymentMethodType,
~setRequiredFieldsBody,
~isSavedCardFlow=false,
~savedCards=[]: array<PaymentType.customerMethods>,
~savedMethod=PaymentType.defaultCustomerMethods,
~cardProps=None,
~expiryProps=None,
~cvcProps=None,
~isBancontact=false,
) => {
React.useEffect1(() => {
React.useEffect(() => {
setRequiredFieldsBody(_ => Dict.make())
None
}, [paymentMethodType])
Expand Down Expand Up @@ -46,8 +46,8 @@ let make = (
}, [requiredFieldsWithBillingDetails])

let isAllStoredCardsHaveName = React.useMemo(() => {
PaymentType.getIsAllStoredCardsHaveName(savedCards)
}, [savedCards])
PaymentType.getIsStoredPaymentMethodHasName(savedMethod)
}, [savedMethod])

//<...>//
let fieldsArr = React.useMemo(() => {
Expand Down Expand Up @@ -509,7 +509,6 @@ let make = (
}}
onChange=onPostalChange
paymentType
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down Expand Up @@ -622,7 +621,6 @@ let make = (
}}
onChange=onPostalChange
paymentType
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down
2 changes: 1 addition & 1 deletion src/Components/EmailPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let make = (~paymentType) => {
})
}

React.useEffect1(() => {
React.useEffect(() => {
setEmail(prev => {
...prev,
errorString: switch prev.isValid {
Expand Down
4 changes: 2 additions & 2 deletions src/Components/InputField.res
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ let make = (
onBlur(ev)
Utils.handleOnBlurPostMessage(~targetOrigin=parentURL, ())
}
React.useEffect2(() => {
React.useEffect(() => {
if value->String.length > 0 {
setValidClasses()
}
Expand Down Expand Up @@ -105,7 +105,7 @@ let make = (

let concatString = Array.joinWith([cardEmpty, cardComplete, cardInvalid, cardFocused], "")

React.useEffect5(() => {
React.useEffect(() => {
Utils.handlePostMessage([
("id", iframeId->JSON.Encode.string),
("concatedString", concatString->JSON.Encode.string),
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Modal.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let make = (
}, 450)->ignore
}

React.useEffect1(() => {
React.useEffect(() => {
loader ? setOpenModal(_ => false) : setOpenModal(_ => true)
None
}, [loader])
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PayNowButton.res
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ let make = (

let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton)

React.useEffect5(() => {
React.useEffect(() => {
if showFields {
if selectedOption === Card {
setIsDisabled(_ => !validFormat)
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PaymentDropDownField.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let make = (
}
}
}
React.useEffect1(() => {
React.useEffect(() => {
let initialValue = options->Array.get(0)->Option.getOr("")
if (
value.value === "" ||
Expand Down
Loading

0 comments on commit 2c68231

Please sign in to comment.