diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dfb0978d..9460d090c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## [0.84.5](https://github.com/juspay/hyperswitch-web/compare/v0.84.4...v0.84.5) (2024-08-26) + +## [0.84.4](https://github.com/juspay/hyperswitch-web/compare/v0.84.3...v0.84.4) (2024-08-23) + + +### Bug Fixes + +* **payout:** dropdown for selecting payment methods, UI updates ([#581](https://github.com/juspay/hyperswitch-web/issues/581)) ([78bc958](https://github.com/juspay/hyperswitch-web/commit/78bc9580b21006fb8522e86e0c2e19f9777586e6)) + +## [0.84.3](https://github.com/juspay/hyperswitch-web/compare/v0.84.2...v0.84.3) (2024-08-22) + +## [0.84.2](https://github.com/juspay/hyperswitch-web/compare/v0.84.1...v0.84.2) (2024-08-22) + + +### Bug Fixes + +* google pay button border ([#570](https://github.com/juspay/hyperswitch-web/issues/570)) ([44be5b6](https://github.com/juspay/hyperswitch-web/commit/44be5b69ed95d081d178d9dbed74e9ddcc336a56)) + ## [0.84.1](https://github.com/juspay/hyperswitch-web/compare/v0.84.0...v0.84.1) (2024-08-13) diff --git a/package-lock.json b/package-lock.json index 837e0bac9..42a0726fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.84.1", + "version": "0.84.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.84.1", + "version": "0.84.5", "hasInstallScript": true, "dependencies": { "@glennsl/rescript-fetch": "^0.2.0", diff --git a/package.json b/package.json index 6a9ac0fe8..d6398445c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.84.1", + "version": "0.84.5", "main": "index.js", "private": true, "dependencies": { diff --git a/rescript.json b/rescript.json index 0fc408fe2..294471c26 100644 --- a/rescript.json +++ b/rescript.json @@ -14,7 +14,7 @@ "namespace": true, "ppx-flags": [], "package-specs": { - "module": "es6", + "module": "esmodule", "in-source": true }, "bs-dependencies": [ diff --git a/src/CollectWidget.res b/src/CollectWidget.res index f1be4802a..7aa3b8a5f 100644 --- a/src/CollectWidget.res +++ b/src/CollectWidget.res @@ -497,23 +497,28 @@ let make = ( } let handleTabSelection = selectedPMT => { - if ( - availablePaymentMethodTypesOrdered->Array.indexOf(selectedPMT) >= - defaultOptionsLimitInTabLayout - ) { - // Move the selected payment method at the last tab position - let ordList = availablePaymentMethodTypes->Array.reduceWithIndex([], (acc, pmt, i) => { - if i === defaultOptionsLimitInTabLayout - 1 { - acc->Array.push(selectedPMT) - } - if pmt !== selectedPMT { - acc->Array.push(pmt) - } - acc - }) - setAvailablePaymentMethodTypesOrdered(_ => ordList) - } - setSelectedPaymentMethodType(_ => Some(selectedPMT)) + availablePaymentMethodTypesOrdered + ->Array.find(pmt => pmt->getPaymentMethodTypeLabel === selectedPMT) + ->Option.map(selectedPaymentMethod => { + if ( + availablePaymentMethodTypesOrdered->Array.indexOf(selectedPaymentMethod) >= + defaultOptionsLimitInTabLayout + ) { + // Move the selected payment method at the last tab position + let ordList = availablePaymentMethodTypes->Array.reduceWithIndex([], (acc, pmt, i) => { + if i === defaultOptionsLimitInTabLayout - 1 { + acc->Array.push(selectedPaymentMethod) + } + if pmt !== selectedPaymentMethod { + acc->Array.push(pmt) + } + acc + }) + setAvailablePaymentMethodTypesOrdered(_ => ordList) + } + setSelectedPaymentMethodType(_ => Some(selectedPaymentMethod)) + }) + ->ignore } let renderTabScreen = (~limit=defaultOptionsLimitInTabLayout) => { @@ -541,9 +546,8 @@ let make = ( , ) } @@ -559,7 +563,7 @@ let make = (
Int.toString} onClick={_ => setSelectedPaymentMethodType(_ => Some(pmt))} - className="flex w-full items-center rounded border border-solid border-jp-gray-700 px-2.5 py-1.5 mr-2.5 cursor-pointer hover:bg-jp-gray-50" + className="flex w-full items-center rounded border-0 px-2.5 py-1.5 mr-2.5 cursor-pointer hover:bg-jp-gray-50" style={selectedPaymentMethodType === Some(pmt) ? activeStyles : defaultStyles}> {pmt->getPaymentMethodTypeIcon}
{React.string(pmt->getPaymentMethodTypeLabel)}
@@ -582,7 +586,8 @@ let make = ( size=10 />