Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-web into feat/th…
Browse files Browse the repository at this point in the history
…ree_ds_iframe_logs
  • Loading branch information
Vrishab Srivatsa committed Apr 3, 2024
2 parents 89d7775 + edb8117 commit 32fbfac
Show file tree
Hide file tree
Showing 51 changed files with 533 additions and 339 deletions.
18 changes: 8 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"env": {
"browser": true,
"es2021": true
"browser": true,
"es2021": true
},
"extends": [
],
"extends": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react-hooks"
],
"plugins": ["react-hooks"],
"rules": {
"react-hooks/rules-of-hooks": "error"
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
3 changes: 3 additions & 0 deletions .github/workflows/CI-Action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ jobs:
- name: "Build"
run: npm run build

- name: "Test React Hooks Properties"
run: npm run test:hooks

- name: npm release
run: npx semantic-release --debug;
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## [0.35.6](https://github.com/juspay/hyperswitch-web/compare/v0.35.5...v0.35.6) (2024-04-02)


### Bug Fixes

* customer payment methods promise ([#266](https://github.com/juspay/hyperswitch-web/issues/266)) ([57ea1ed](https://github.com/juspay/hyperswitch-web/commit/57ea1ed0483776df98abbbd83b0958674be6490c))

## [0.35.5](https://github.com/juspay/hyperswitch-web/compare/v0.35.4...v0.35.5) (2024-04-02)


### Bug Fixes

* react hooks issue fix ([#233](https://github.com/juspay/hyperswitch-web/issues/233)) ([c9dcb63](https://github.com/juspay/hyperswitch-web/commit/c9dcb638a3da08fe0569c94864df46179c2834e8))

## [0.35.4](https://github.com/juspay/hyperswitch-web/compare/v0.35.3...v0.35.4) (2024-04-01)

## [0.35.3](https://github.com/juspay/hyperswitch-web/compare/v0.35.2...v0.35.3) (2024-04-01)

## [0.35.2](https://github.com/juspay/hyperswitch-web/compare/v0.35.1...v0.35.2) (2024-04-01)

## [0.35.1](https://github.com/juspay/hyperswitch-web/compare/v0.35.0...v0.35.1) (2024-03-27)


Expand Down
185 changes: 124 additions & 61 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.35.1",
"version": "0.35.6",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
61 changes: 1 addition & 60 deletions src/CardUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -579,65 +579,6 @@ let postalRegex = (postalCodes: array<PostalCodeType.postalCodes>, ~country=?, (
countryPostal.regex == "" ? "" : countryPostal.regex
}

let getCardDetailsFromCardProps = cardProps => {
let defaultCardProps = (
None,
_ => (),
"",
_ => (),
_ => (),
React.useRef(Nullable.null),
React.null,
"",
_ => (),
0,
)

switch cardProps {
| Some(cardProps) => cardProps
| None => defaultCardProps
}
}

let getExpiryDetailsFromExpiryProps = expiryProps => {
let defaultExpiryProps = (
None,
_ => (),
"",
_ => (),
_ => (),
React.useRef(Nullable.null),
_ => (),
"",
_ => (),
)

switch expiryProps {
| Some(expiryProps) => expiryProps
| None => defaultExpiryProps
}
}

let getCvcDetailsFromCvcProps = cvcProps => {
let defaultCvcProps = (
None,
_ => (),
"",
_ => (),
_ => (),
_ => (),
React.useRef(Nullable.null),
_ => (),
"",
_ => (),
)

switch cvcProps {
| Some(cvcProps) => cvcProps
| None => defaultCvcProps
}
}

let setRightIconForCvc = (~cardEmpty, ~cardInvalid, ~color, ~cardComplete) => {
if cardEmpty {
<Icon size=Utils.brandIconSize name="cvc-empty" />
Expand All @@ -653,7 +594,7 @@ let setRightIconForCvc = (~cardEmpty, ~cardInvalid, ~color, ~cardComplete) => {
}

let useCardDetails = (~cvcNumber, ~isCvcValidValue, ~isCVCValid) => {
React.useMemo3(() => {
React.useMemo(() => {
let isCardDetailsEmpty = String.length(cvcNumber) == 0
let isCardDetailsValid = isCvcValidValue == "valid"
let isCardDetailsInvalid = isCvcValidValue == "invalid"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Accordion.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let make = (
accordionItemLabelClass,
accordionItemIconClass,
radioClass,
) = React.useMemo1(
) = React.useMemo(
() =>
isActive
? (
Expand Down
Loading

0 comments on commit 32fbfac

Please sign in to comment.