react-native-unit-components 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +4 -2
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +4 -2
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +10 -8
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
- package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +4 -2
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
- package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
- package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +9 -6
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +10 -10
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +25 -3
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/index.js +27 -0
- package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
- package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/commonjs/components/index.js +8 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +18 -2
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/commonjs/helpers/store/helpers.js +29 -0
- package/lib/commonjs/helpers/store/helpers.js.map +1 -0
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +3 -3
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +13 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/commonjs/store/index.js +17 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/store/store.js +16 -0
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/types/shared/index.js +11 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/types/shared/versioning.types.js +14 -0
- package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +3 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +18 -9
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/commonjs/webComponent/html.js +4 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +3 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/index.js +2 -0
- package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +3 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/index.js +2 -0
- package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +8 -6
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/index.js +2 -0
- package/lib/module/components/UNAccountComponent/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +3 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/index.js +2 -0
- package/lib/module/components/UNActivityComponent/index.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
- package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +9 -6
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +10 -10
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +25 -3
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCardComponent/index.js +2 -0
- package/lib/module/components/UNCardComponent/index.js.map +1 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
- package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/module/components/index.js +8 -8
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +18 -2
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/module/helpers/store/helpers.js +20 -0
- package/lib/module/helpers/store/helpers.js.map +1 -0
- package/lib/module/networking/requests/UNWalletPayloadRequest.js +3 -4
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +10 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/slices/pushProvisioningSlice.js +19 -0
- package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/module/store/index.js +2 -0
- package/lib/module/store/index.js.map +1 -0
- package/lib/module/store/store.js +8 -0
- package/lib/module/store/store.js.map +1 -0
- package/lib/module/types/shared/index.js +1 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/types/shared/versioning.types.js +7 -0
- package/lib/module/types/shared/versioning.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +4 -2
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
- package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +17 -7
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
- package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/module/webComponent/html.js +5 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
- package/lib/typescript/components/UNACHCreditComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
- package/lib/typescript/components/UNACHDebitComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -2
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
- package/lib/typescript/components/UNAccountComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -1
- package/lib/typescript/components/UNActivityComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
- package/lib/typescript/components/UNBookPaymentComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
- package/lib/typescript/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.d.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.d.ts} +2 -2
- package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
- package/lib/typescript/components/UNBottomSheetComponent/components/index.d.ts +1 -0
- package/lib/typescript/components/UNBottomSheetComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +4 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
- package/lib/typescript/components/UNCardComponent/index.d.ts +1 -0
- package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
- package/lib/typescript/components/UNCheckDepositComponent/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts +8 -8
- package/lib/typescript/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
- package/lib/typescript/helpers/store/helpers.d.ts +3 -0
- package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +2 -2
- package/lib/typescript/scripts/html/bodyScript.d.ts +2 -0
- package/lib/typescript/slices/pushProvisioningSlice.d.ts +8 -0
- package/lib/typescript/store/index.d.ts +1 -0
- package/lib/typescript/store/store.d.ts +6 -0
- package/lib/typescript/types/shared/index.d.ts +1 -0
- package/lib/typescript/types/shared/versioning.types.d.ts +22 -0
- package/lib/typescript/unitSdkManager/UnitSdk.constants.d.ts +8 -0
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +11 -6
- package/lib/typescript/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
- package/lib/typescript/utils/webVersioningStrategy.utils.d.ts +5 -0
- package/package.json +7 -24
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +5 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
- package/src/components/UNACHCreditComponent/index.ts +1 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +5 -1
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
- package/src/components/UNACHDebitComponent/index.ts +1 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +5 -2
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
- package/src/components/UNAccountComponent/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +4 -1
- package/src/components/UNActivityComponent/index.ts +1 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
- package/src/components/UNBookPaymentComponent/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +25 -23
- package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +12 -12
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/index.ts +1 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +45 -9
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
- package/src/components/UNCardComponent/index.ts +1 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
- package/src/components/UNCheckDepositComponent/index.ts +1 -0
- package/src/components/index.ts +8 -8
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +13 -3
- package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
- package/src/helpers/store/helpers.tsx +22 -0
- package/src/networking/requests/UNWalletPayloadRequest.ts +5 -3
- package/src/scripts/html/bodyScript.ts +13 -1
- package/src/slices/pushProvisioningSlice.ts +24 -0
- package/src/store/index.ts +1 -0
- package/src/store/store.ts +10 -0
- package/src/types/shared/index.ts +1 -0
- package/src/types/shared/versioning.types.ts +28 -0
- package/src/unitSdkManager/UnitSdk.api.ts +5 -2
- package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
- package/src/unitSdkManager/UnitSdkManager.ts +19 -10
- package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
- package/src/utils/webVersioningStrategy.utils.ts +52 -0
- package/src/webComponent/html.ts +16 -2
- package/android/src/main/res/drawable/ic_launcher_background.xml +0 -170
- package/android/src/main/res/drawable/un_ic_launcher_foreground.xml +0 -30
- package/android/src/main/res/drawable-v24/ic_launcher_background.xml +0 -170
- package/android/src/main/res/drawable-v24/un_ic_launcher_foreground.xml +0 -30
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/typescript/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.d.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.d.ts} +0 -0
- /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-unit-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Unit React Native components",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"typescript": "tsc --noEmit",
|
|
27
27
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
28
28
|
"prepare": "bob build",
|
|
29
|
-
"release": "release-it",
|
|
30
29
|
"example": "yarn --cwd example",
|
|
31
30
|
"bootstrap": "yarn example && yarn && yarn example pods"
|
|
32
31
|
},
|
|
@@ -48,8 +47,8 @@
|
|
|
48
47
|
"@react-native-community/eslint-config": "^3.0.2",
|
|
49
48
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
50
49
|
"@types/jest": "^28.1.2",
|
|
51
|
-
"@types/react": "~
|
|
52
|
-
"@types/react-native": "0.
|
|
50
|
+
"@types/react": "~18.0.0",
|
|
51
|
+
"@types/react-native": "0.72.2",
|
|
53
52
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
54
53
|
"@typescript-eslint/parser": "^5.45.0",
|
|
55
54
|
"commitlint": "^17.0.2",
|
|
@@ -65,11 +64,10 @@
|
|
|
65
64
|
"react-native": "0.68.2",
|
|
66
65
|
"react-native-builder-bob": "^0.18.3",
|
|
67
66
|
"react-native-webview": "11.23.1",
|
|
68
|
-
"release-it": "^15.0.0",
|
|
69
67
|
"typescript": "^4.5.2"
|
|
70
68
|
},
|
|
71
69
|
"resolutions": {
|
|
72
|
-
"@types/react": "
|
|
70
|
+
"@types/react": "18.0.0"
|
|
73
71
|
},
|
|
74
72
|
"peerDependencies": {
|
|
75
73
|
"react": "*",
|
|
@@ -78,9 +76,11 @@
|
|
|
78
76
|
"react-native-webview": "*"
|
|
79
77
|
},
|
|
80
78
|
"dependencies": {
|
|
79
|
+
"@reduxjs/toolkit": "^1.9.5",
|
|
81
80
|
"axios": "^1.3.3",
|
|
82
81
|
"react-native-plaid-link-sdk": "^9.0.1",
|
|
83
|
-
"react-native-webview": "11.23.1"
|
|
82
|
+
"react-native-webview": "11.23.1",
|
|
83
|
+
"react-redux": "^8.1.2"
|
|
84
84
|
},
|
|
85
85
|
"jest": {
|
|
86
86
|
"preset": "react-native",
|
|
@@ -94,23 +94,6 @@
|
|
|
94
94
|
"@commitlint/config-conventional"
|
|
95
95
|
]
|
|
96
96
|
},
|
|
97
|
-
"release-it": {
|
|
98
|
-
"git": {
|
|
99
|
-
"commitMessage": "chore: release ${version}",
|
|
100
|
-
"tagName": "v${version}"
|
|
101
|
-
},
|
|
102
|
-
"npm": {
|
|
103
|
-
"publish": true
|
|
104
|
-
},
|
|
105
|
-
"github": {
|
|
106
|
-
"release": true
|
|
107
|
-
},
|
|
108
|
-
"plugins": {
|
|
109
|
-
"@release-it/conventional-changelog": {
|
|
110
|
-
"preset": "angular"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
97
|
"eslintConfig": {
|
|
115
98
|
"root": true,
|
|
116
99
|
"parser": "@babel/eslint-parser",
|
|
@@ -13,6 +13,7 @@ import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
|
|
|
13
13
|
import type WebView from 'react-native-webview';
|
|
14
14
|
import { getAndroidPackageName } from '../utils/nativeModulesInfo';
|
|
15
15
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
16
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
16
17
|
|
|
17
18
|
export interface UNACHCreditComponentProps {
|
|
18
19
|
accountId: string;
|
|
@@ -24,9 +25,10 @@ export interface UNACHCreditComponentProps {
|
|
|
24
25
|
withPlaid?: boolean;
|
|
25
26
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
26
27
|
onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
|
|
28
|
+
sameDay?: boolean;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
|
|
30
32
|
const [height, setHeight] = useState<number>(0);
|
|
31
33
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
32
34
|
const [linkToken, setLinkToken] = useState<string>();
|
|
@@ -139,3 +141,5 @@ export const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
|
|
|
139
141
|
</View>
|
|
140
142
|
);
|
|
141
143
|
};
|
|
144
|
+
|
|
145
|
+
export default withReduxStore<UNACHCreditComponentProps>(UNACHCreditComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNACHCreditComponent, UNACHCreditComponentProps } from './UNACHCreditComponent';
|
|
@@ -14,6 +14,7 @@ import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
|
|
|
14
14
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
15
15
|
import { getAndroidPackageName } from '../utils/nativeModulesInfo';
|
|
16
16
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
17
18
|
|
|
18
19
|
export interface UNACHDebitComponentProps {
|
|
19
20
|
accountId: string;
|
|
@@ -24,9 +25,10 @@ export interface UNACHDebitComponentProps {
|
|
|
24
25
|
fee?: number;
|
|
25
26
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
26
27
|
onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
|
|
28
|
+
sameDay?: boolean;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
|
|
30
32
|
const [height, setHeight] = useState<number>(0);
|
|
31
33
|
const [appPackageName, setAppPackageName] = useState<string>('');
|
|
32
34
|
const [linkToken, setLinkToken] = useState<string>('');
|
|
@@ -140,3 +142,5 @@ export const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
|
|
|
140
142
|
|
|
141
143
|
);
|
|
142
144
|
};
|
|
145
|
+
|
|
146
|
+
export default withReduxStore<UNACHDebitComponentProps>(UNACHDebitComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNACHDebitComponent, UNACHDebitComponentProps } from './UNACHDebitComponent';
|
|
@@ -16,6 +16,7 @@ import type { UNAccountMenuAction } from '../../types/shared';
|
|
|
16
16
|
import { BottomSheetRenderingType, SlotRendering, type BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
|
|
17
17
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
18
18
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
19
|
+
import { withReduxStoreAndRefForwarding } from '../../helpers/store/helpers';
|
|
19
20
|
|
|
20
21
|
export interface UNAccountComponentProps {
|
|
21
22
|
// inputs
|
|
@@ -38,12 +39,12 @@ export interface UNAccountRef {
|
|
|
38
39
|
openAction: (action: UNAccountMenuAction) => void;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export enum
|
|
42
|
+
export enum UNAccountAction {
|
|
42
43
|
List = 'account-list',
|
|
43
44
|
Menu = 'account-menu'
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountComponentProps>(function UNAccountComponent(props, accountRef) {
|
|
47
48
|
const [height, setHeight] = useState(0);
|
|
48
49
|
|
|
49
50
|
const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);
|
|
@@ -136,3 +137,5 @@ export const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountCompon
|
|
|
136
137
|
</View>
|
|
137
138
|
);
|
|
138
139
|
});
|
|
140
|
+
|
|
141
|
+
export default withReduxStoreAndRefForwarding<UNAccountComponentProps, UNAccountRef>(UNAccountComponent);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UNAccountAction, UNAccountComponentProps } from './UNAccountComponent';
|
|
2
2
|
import { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
3
3
|
import type WebView from 'react-native-webview';
|
|
4
4
|
import type { UNAccountMenuAction } from 'src/types/shared';
|
|
@@ -38,5 +38,5 @@ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRe
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export const getAccountActionType = (requestRendering: RequestRenderingEvent) => {
|
|
41
|
-
return requestRendering.data.nativeComponent.includes(
|
|
41
|
+
return requestRendering.data.nativeComponent.includes(UNAccountAction.List) ? UNAccountAction.List : UNAccountAction.Menu;
|
|
42
42
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNAccountComponent, UNAccountComponentProps, UNAccountRef } from './UNAccountComponent';
|
|
@@ -15,6 +15,7 @@ import { ActivityMessage } from '../../messages/webMessages/activityMessage';
|
|
|
15
15
|
import { BottomSheetRenderingType, type BottomSheetSlotData, type SlotRendering } from '../../types/internal/bottomSheet.types';
|
|
16
16
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
17
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
18
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
18
19
|
|
|
19
20
|
const DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;
|
|
20
21
|
export interface UNActivityComponentProps {
|
|
@@ -32,7 +33,7 @@ export interface UNActivityComponentProps {
|
|
|
32
33
|
onLoad?: (response: UNOnLoadResponse<UNActivityOnLoadData>) => void;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
const UNActivityComponent = (props: UNActivityComponentProps) => {
|
|
36
37
|
const webRef = useRef<WebView>(null);
|
|
37
38
|
const [defaultHeight, setDefaultHeight] = useState<number>();
|
|
38
39
|
|
|
@@ -127,3 +128,5 @@ export const UNActivityComponent = (props: UNActivityComponentProps) => {
|
|
|
127
128
|
</View>
|
|
128
129
|
);
|
|
129
130
|
};
|
|
131
|
+
|
|
132
|
+
export default withReduxStore<UNActivityComponentProps>(UNActivityComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNActivityComponent, UNActivityComponentProps } from './UNActivityComponent';
|
|
@@ -10,6 +10,7 @@ import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
|
10
10
|
import type { BookPaymentEvent } from '../../messages/webMessages/bookPaymentMessage';
|
|
11
11
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
12
12
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
13
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
13
14
|
|
|
14
15
|
export interface UNBookPaymentComponentProps {
|
|
15
16
|
//inputs
|
|
@@ -29,7 +30,7 @@ export interface UNBookPaymentComponentProps {
|
|
|
29
30
|
onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {
|
|
33
34
|
const [height, setHeight] = useState<number>(0);
|
|
34
35
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
35
36
|
|
|
@@ -99,3 +100,5 @@ export const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {
|
|
|
99
100
|
</View>
|
|
100
101
|
);
|
|
101
102
|
};
|
|
103
|
+
|
|
104
|
+
export default withReduxStore<UNBookPaymentComponentProps>(UNBookPaymentComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNBookPaymentComponent, UNBookPaymentComponentProps } from './UNBookPaymentComponent';
|
|
@@ -23,7 +23,7 @@ import { getStylesObject } from './UNBottomSheetComponent.styles';
|
|
|
23
23
|
import { useAppStateListener } from '../../hooks/useAppStateListener';
|
|
24
24
|
import { UNAddToWalletBottomSheetItem } from './components/UNAddToWalletBottomSheetItem';
|
|
25
25
|
import { getAccountActionType } from '../UNAccountComponent/UNAccountComponent.utils';
|
|
26
|
-
import {
|
|
26
|
+
import { UNAccountAction } from '../UNAccountComponent/UNAccountComponent';
|
|
27
27
|
import type { AccountChangedEvent } from '../../messages/webMessages/accountMessage';
|
|
28
28
|
import { AccountMessage } from '../../messages/webMessages/accountMessage';
|
|
29
29
|
import { ActivityFiltersChangedEvent, ActivityMessage } from '../../messages/webMessages/activityMessage';
|
|
@@ -31,6 +31,7 @@ import { BOTTOM_SHEET_MAX_PERCENTAGE_SIZE } from './UNBottomSheetComponent.const
|
|
|
31
31
|
import { BottomSheetRenderingType, BottomSheetSlotData, NativeComponentData, WebComponentData } from '../../types/internal/bottomSheet.types';
|
|
32
32
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
33
33
|
import { BottomSheetNativeMessage, type StartBottomSheetFlowMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
34
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
34
35
|
|
|
35
36
|
export enum ScrollState {
|
|
36
37
|
/*
|
|
@@ -55,7 +56,7 @@ export enum ScrollState {
|
|
|
55
56
|
onlyBottomSheet = 'onlyBottomSheet',
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
const UNBottomSheetComponent = () => {
|
|
59
60
|
const [isBottomSheetActive, setIsBottomSheetActive] = useState(false);
|
|
60
61
|
const [height, setHeight] = useState(0);
|
|
61
62
|
|
|
@@ -142,7 +143,7 @@ export const UNBottomSheetComponent = () => {
|
|
|
142
143
|
}
|
|
143
144
|
}, [shouldShowComponent, newHeightMessage, isAddToWallet]);
|
|
144
145
|
|
|
145
|
-
useListenerToBus({ busEventKey: BottomSheetNativeMessage.START_FLOW,
|
|
146
|
+
useListenerToBus({ busEventKey: BottomSheetNativeMessage.START_FLOW, action: startFlow });
|
|
146
147
|
useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_CLOSE_FLOW, action: handleCloseFlow });
|
|
147
148
|
|
|
148
149
|
const defineScrollState = () => {
|
|
@@ -152,7 +153,7 @@ export const UNBottomSheetComponent = () => {
|
|
|
152
153
|
case WebComponentType.account: {
|
|
153
154
|
const accountActionType = getAccountActionType(bottomSheetSlotData.requestRenderingEvent);
|
|
154
155
|
setScrollState(
|
|
155
|
-
accountActionType ===
|
|
156
|
+
accountActionType === UNAccountAction.List ? ScrollState.onTop : ScrollState.unScrollable
|
|
156
157
|
);
|
|
157
158
|
break;
|
|
158
159
|
}
|
|
@@ -205,7 +206,8 @@ export const UNBottomSheetComponent = () => {
|
|
|
205
206
|
injectHtmlFullScreenHeight(webRef.current, fullScreenHeight);
|
|
206
207
|
setHeight(fullScreenHeight);
|
|
207
208
|
} else {
|
|
208
|
-
|
|
209
|
+
const height = (message.details as HeightEvent).height;
|
|
210
|
+
setHeight(height < fullScreenHeight ? height : fullScreenHeight);
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
};
|
|
@@ -285,7 +287,7 @@ export const UNBottomSheetComponent = () => {
|
|
|
285
287
|
switch (renderingType) {
|
|
286
288
|
case BottomSheetRenderingType.Slot:
|
|
287
289
|
if (bottomSheetSlotData?.requestRenderingEvent.data.nativeComponent?.includes('action=AddToWallet') && bottomSheetSlotData?.componentResourceId) {
|
|
288
|
-
return <UNAddToWalletBottomSheetItem renderingType={renderingType} renderingRequest={bottomSheetSlotData.requestRenderingEvent} cardId={bottomSheetSlotData?.componentResourceId} fullScreenHeight={fullScreenHeight}/>;
|
|
290
|
+
return <UNAddToWalletBottomSheetItem renderingType={renderingType} renderingRequest={bottomSheetSlotData.requestRenderingEvent} cardId={bottomSheetSlotData?.componentResourceId} fullScreenHeight={fullScreenHeight} />;
|
|
289
291
|
}
|
|
290
292
|
|
|
291
293
|
return (
|
|
@@ -303,7 +305,7 @@ export const UNBottomSheetComponent = () => {
|
|
|
303
305
|
if (webComponentData?.params?.includes('action=AddToWallet')) {
|
|
304
306
|
const cardId = extractCardIdFromComponentParams(webComponentData);
|
|
305
307
|
if (!cardId) return null;
|
|
306
|
-
return <UNAddToWalletBottomSheetItem renderingType={renderingType} webComponentData={webComponentData} cardId={cardId} fullScreenHeight={fullScreenHeight}/>;
|
|
308
|
+
return <UNAddToWalletBottomSheetItem renderingType={renderingType} webComponentData={webComponentData} cardId={cardId} fullScreenHeight={fullScreenHeight} />;
|
|
307
309
|
}
|
|
308
310
|
return null;
|
|
309
311
|
case BottomSheetRenderingType.NativeComponent:
|
|
@@ -312,22 +314,22 @@ export const UNBottomSheetComponent = () => {
|
|
|
312
314
|
};
|
|
313
315
|
|
|
314
316
|
return (
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
<View
|
|
318
|
+
pointerEvents={isBottomSheetActive ? undefined : 'none'}
|
|
319
|
+
style={styles.container}
|
|
320
|
+
>
|
|
321
|
+
<BottomSheet
|
|
322
|
+
isOpen={isBottomSheetActive}
|
|
323
|
+
height={height}
|
|
324
|
+
onClose={() => setIsBottomSheetActive(false)}
|
|
325
|
+
onOpen={() => setIsBottomSheetActive(true)}
|
|
326
|
+
handleWebViewScroll={() => handleWebViewScroll()}
|
|
327
|
+
shouldEnableBottomSheetScroll={scrollState !== ScrollState.onlyWebView}
|
|
319
328
|
>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
onClose={() => setIsBottomSheetActive(false)}
|
|
324
|
-
onOpen={() => setIsBottomSheetActive(true)}
|
|
325
|
-
handleWebViewScroll={() => handleWebViewScroll()}
|
|
326
|
-
shouldEnableBottomSheetScroll={scrollState !== ScrollState.onlyWebView}
|
|
327
|
-
>
|
|
328
|
-
{isAppActive && renderBottomSheetItem()}
|
|
329
|
-
</BottomSheet >
|
|
330
|
-
</View >
|
|
331
|
-
</>
|
|
329
|
+
{isAppActive && renderBottomSheetItem()}
|
|
330
|
+
</BottomSheet >
|
|
331
|
+
</View >
|
|
332
332
|
);
|
|
333
333
|
};
|
|
334
|
+
|
|
335
|
+
export default withReduxStore(UNBottomSheetComponent);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import type WebView from 'react-native-webview';
|
|
3
|
-
import { WebComponent } from '
|
|
4
|
-
import { injectHtmlFullScreenHeight, renderingBottomSheetRequest } from '
|
|
3
|
+
import { WebComponent } from '../../../../webComponent/WebComponent';
|
|
4
|
+
import { injectHtmlFullScreenHeight, renderingBottomSheetRequest } from '../../UNBottomSheetComponent.utils';
|
|
5
5
|
import { getStylesObject } from './UNAddToWalletBottomSheetItem.styles';
|
|
6
6
|
import { ActivityIndicator } from 'react-native';
|
|
7
|
-
import { UnitMessage, type RequestRenderingEvent } from '
|
|
8
|
-
import UnitAddToWalletButtonView from '
|
|
9
|
-
import { UNCardAddToWalletStatus } from '
|
|
10
|
-
import { BottomSheetRenderingType, WebComponentData } from '
|
|
11
|
-
import { PresentationMode, WebComponentType } from '
|
|
12
|
-
import { useCardWallet } from '
|
|
13
|
-
import { launchStartCardProvisioning } from '
|
|
14
|
-
import type { WebViewMessage } from '
|
|
15
|
-
import EventBus from '
|
|
7
|
+
import { UnitMessage, type RequestRenderingEvent } from '../../../../messages/webMessages/unitMessages';
|
|
8
|
+
import UnitAddToWalletButtonView from '../../../../nativeComponent/UnitAddToWalletButton';
|
|
9
|
+
import { UNCardAddToWalletStatus } from '../../../../types/shared/wallet.types';
|
|
10
|
+
import { BottomSheetRenderingType, WebComponentData } from '../../../../types/internal/bottomSheet.types';
|
|
11
|
+
import { PresentationMode, WebComponentType } from '../../../../types/internal/webComponent.types';
|
|
12
|
+
import { useCardWallet } from '../../../../helpers/pushProvisioningService/hooks/useCardWallet';
|
|
13
|
+
import { launchStartCardProvisioning } from '../../../../helpers/pushProvisioningService/startProvisioning';
|
|
14
|
+
import type { WebViewMessage } from '../../../../messages/webMessages';
|
|
15
|
+
import EventBus from '../../../../helpers/EventBus';
|
|
16
16
|
|
|
17
17
|
export interface UNAddToWalletBottomSheetItemProps {
|
|
18
18
|
renderingType: BottomSheetRenderingType
|
|
@@ -48,7 +48,7 @@ export const UNAddToWalletBottomSheetItem = (props: UNAddToWalletBottomSheetItem
|
|
|
48
48
|
launchStartCardProvisioning(currentUNWallet);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const handleWebComponentMessage
|
|
51
|
+
const handleWebComponentMessage = (message: WebViewMessage) => {
|
|
52
52
|
if (!message || !message.type) return;
|
|
53
53
|
switch (message.type) {
|
|
54
54
|
case UnitMessage.UNIT_ON_LOAD:
|
package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UNAddToWalletBottomSheetItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UNAddToWalletBottomSheetItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNBottomSheetComponent } from './UNBottomSheetComponent';
|
|
@@ -7,15 +7,32 @@ import EventBus from '../../helpers/EventBus';
|
|
|
7
7
|
import { WebComponent } from '../../webComponent/WebComponent';
|
|
8
8
|
import { useListenerToBus } from '../../hooks/listenerToBus';
|
|
9
9
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
getCardParams,
|
|
12
|
+
getCardScript,
|
|
13
|
+
injectRefreshEventIfNeeded,
|
|
14
|
+
injectOpenActionsMenuScript,
|
|
15
|
+
injectRequestCardActionScript,
|
|
16
|
+
injectRequestShowSensitiveDataScript, injectRequestHideSensitiveDataScript,
|
|
17
|
+
} from './UNCardComponent.utils';
|
|
11
18
|
import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../types/shared';
|
|
12
19
|
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
13
20
|
import type { NativeModules } from 'react-native';
|
|
14
21
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
15
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
BottomSheetRenderingType,
|
|
24
|
+
SlotRendering,
|
|
25
|
+
type BottomSheetSlotData,
|
|
26
|
+
} from '../../types/internal/bottomSheet.types';
|
|
16
27
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
28
|
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
18
29
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
30
|
+
import { useLaunchInitialize } from '../../helpers/pushProvisioningService/hooks/useLaunchInitialize';
|
|
31
|
+
import { selectWallet } from '../../slices/pushProvisioningSlice';
|
|
32
|
+
import { useSelector } from 'react-redux';
|
|
33
|
+
import { withReduxStoreAndRefForwarding } from '../../helpers/store/helpers';
|
|
34
|
+
|
|
35
|
+
|
|
19
36
|
export interface UNCardComponentProps {
|
|
20
37
|
// inputs
|
|
21
38
|
cardId: string;
|
|
@@ -30,20 +47,25 @@ export interface UNCardComponentProps {
|
|
|
30
47
|
hideSensitiveDataButton?: boolean;
|
|
31
48
|
|
|
32
49
|
// events
|
|
33
|
-
onLoad?: (response: UNOnLoadResponse<UNCardData>) => void
|
|
50
|
+
onLoad?: (response: UNOnLoadResponse<UNCardData>) => void;
|
|
34
51
|
onStatusChanged?: (card: UNCardData) => void;
|
|
35
52
|
onCardActivated?: (card: UNCardData) => void;
|
|
36
53
|
pushProvisioningModule?: typeof NativeModules;
|
|
37
54
|
}
|
|
55
|
+
|
|
38
56
|
export interface CardRef {
|
|
39
57
|
openActionsMenu: () => void;
|
|
40
58
|
openAction: (action: UNCardMenuAction) => void;
|
|
59
|
+
showSensitiveData: () => void;
|
|
60
|
+
hideSensitiveData: () => void;
|
|
41
61
|
}
|
|
42
62
|
|
|
43
|
-
|
|
63
|
+
const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
|
|
44
64
|
const [height, setHeight] = useState(0);
|
|
45
65
|
|
|
46
66
|
const webRef = useRef<WebView>(null);
|
|
67
|
+
const { initializePushProvisioning } = useLaunchInitialize();
|
|
68
|
+
const { signedNonce } = useSelector(selectWallet);
|
|
47
69
|
|
|
48
70
|
useImperativeHandle(cardRef, () => ({
|
|
49
71
|
openActionsMenu() {
|
|
@@ -51,7 +73,13 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
51
73
|
},
|
|
52
74
|
openAction(action: UNCardMenuAction) {
|
|
53
75
|
injectRequestCardActionScript(webRef.current, action);
|
|
54
|
-
}
|
|
76
|
+
},
|
|
77
|
+
showSensitiveData() {
|
|
78
|
+
injectRequestShowSensitiveDataScript(webRef.current);
|
|
79
|
+
},
|
|
80
|
+
hideSensitiveData() {
|
|
81
|
+
injectRequestHideSensitiveDataScript(webRef.current);
|
|
82
|
+
},
|
|
55
83
|
}));
|
|
56
84
|
|
|
57
85
|
const cardStatusChanged = (card: UNCardData) => {
|
|
@@ -102,12 +130,12 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
102
130
|
const slotData: BottomSheetSlotData = {
|
|
103
131
|
componentName: WebComponentType.card,
|
|
104
132
|
componentResourceId: props.cardId,
|
|
105
|
-
requestRenderingEvent: message.details as RequestRenderingEvent
|
|
133
|
+
requestRenderingEvent: message.details as RequestRenderingEvent,
|
|
106
134
|
};
|
|
107
135
|
|
|
108
136
|
const event = {
|
|
109
137
|
type: BottomSheetRenderingType.Slot,
|
|
110
|
-
data: slotData
|
|
138
|
+
data: slotData,
|
|
111
139
|
} as SlotRendering;
|
|
112
140
|
|
|
113
141
|
EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
|
|
@@ -132,8 +160,13 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
132
160
|
}
|
|
133
161
|
}, [props.pushProvisioningModule]);
|
|
134
162
|
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (signedNonce || !UnitSDK.getPushProvisionModule()) return;
|
|
165
|
+
initializePushProvisioning();
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
135
168
|
return (
|
|
136
|
-
<View style={{ height, width: '100%' }}>
|
|
169
|
+
<View style={{ height, width: '100%', minWidth: 235 }}>
|
|
137
170
|
<WebComponent
|
|
138
171
|
ref={webRef}
|
|
139
172
|
type={WebComponentType.card}
|
|
@@ -145,6 +178,9 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
145
178
|
onMessage={message => handleMessage(message)}
|
|
146
179
|
isScrollable={false}
|
|
147
180
|
/>
|
|
148
|
-
</View>
|
|
181
|
+
</View >
|
|
149
182
|
);
|
|
183
|
+
|
|
150
184
|
});
|
|
185
|
+
|
|
186
|
+
export default withReduxStoreAndRefForwarding<UNCardComponentProps, CardRef>(UNCardComponent);
|
|
@@ -29,6 +29,13 @@ export const injectRequestCardActionScript = (currentWeb: WebView | null, action
|
|
|
29
29
|
currentWeb?.injectJavaScript(`dispatchRequestCardAction('${action}')`);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
export const injectRequestHideSensitiveDataScript = (currentWeb: WebView | null) => {
|
|
33
|
+
currentWeb?.injectJavaScript(`dispatchRequestHideSensitiveData('${WebComponentType.card}')`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const injectRequestShowSensitiveDataScript = (currentWeb: WebView | null) => {
|
|
37
|
+
currentWeb?.injectJavaScript(`dispatchRequestShowSensitiveData('${WebComponentType.card}')`);
|
|
38
|
+
};
|
|
32
39
|
export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {
|
|
33
40
|
if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {
|
|
34
41
|
currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCardComponent, UNCardComponentProps, CardRef } from './UNCardComponent';
|
|
@@ -10,6 +10,7 @@ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
|
|
|
10
10
|
import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
|
|
11
11
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
12
12
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
13
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
13
14
|
|
|
14
15
|
const { Camera } = NativeModules;
|
|
15
16
|
|
|
@@ -24,7 +25,7 @@ export interface UNCheckDepositComponentProps {
|
|
|
24
25
|
onRestartRequest?: (checkData: UNCheckDepositData) => void
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
|
|
28
29
|
const [height, setHeight] = useState<number>(0);
|
|
29
30
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
30
31
|
|
|
@@ -112,3 +113,5 @@ export const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) =>
|
|
|
112
113
|
</View>
|
|
113
114
|
);
|
|
114
115
|
};
|
|
116
|
+
|
|
117
|
+
export default withReduxStore<UNCheckDepositComponentProps>(UNCheckDepositComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCheckDepositComponent, UNCheckDepositComponentProps } from './UNCheckDepositComponent';
|
package/src/components/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './UNCardComponent
|
|
2
|
-
export * from './UNBottomSheetComponent
|
|
3
|
-
export * from './UNBookPaymentComponent
|
|
4
|
-
export * from './UNActivityComponent
|
|
5
|
-
export * from './UNAccountComponent
|
|
6
|
-
export * from './UNCheckDepositComponent
|
|
7
|
-
export * from './UNACHDebitComponent
|
|
8
|
-
export * from './UNACHCreditComponent
|
|
1
|
+
export * from './UNCardComponent';
|
|
2
|
+
export * from './UNBottomSheetComponent';
|
|
3
|
+
export * from './UNBookPaymentComponent';
|
|
4
|
+
export * from './UNActivityComponent';
|
|
5
|
+
export * from './UNAccountComponent';
|
|
6
|
+
export * from './UNCheckDepositComponent';
|
|
7
|
+
export * from './UNACHDebitComponent';
|
|
8
|
+
export * from './UNACHCreditComponent';
|
|
@@ -2,6 +2,9 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';
|
|
3
3
|
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
4
4
|
import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
|
|
5
|
+
import { useSelector } from 'react-redux';
|
|
6
|
+
import { selectWallet } from '../../../slices/pushProvisioningSlice';
|
|
7
|
+
import { useLaunchInitialize } from './useLaunchInitialize';
|
|
5
8
|
|
|
6
9
|
export type CardToEncryptedPayload = {
|
|
7
10
|
[cardId: string]: string;
|
|
@@ -9,6 +12,8 @@ export type CardToEncryptedPayload = {
|
|
|
9
12
|
|
|
10
13
|
export const useCardWallet = (cardId: string) => {
|
|
11
14
|
const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();
|
|
15
|
+
const { signedNonce } = useSelector(selectWallet);
|
|
16
|
+
const { initializePushProvisioning } = useLaunchInitialize();
|
|
12
17
|
|
|
13
18
|
useEffect(() => {
|
|
14
19
|
const getEncryptedPayload = async () => {
|
|
@@ -16,7 +21,12 @@ export const useCardWallet = (cardId: string) => {
|
|
|
16
21
|
const customerToken = UnitSDK.getCustomerToken();
|
|
17
22
|
if (!env || !customerToken) return;
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
// In case we use flow
|
|
25
|
+
if (!signedNonce) {
|
|
26
|
+
await initializePushProvisioning();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env, signedNonce);
|
|
20
30
|
return encryptedPayload;
|
|
21
31
|
};
|
|
22
32
|
|
|
@@ -25,6 +35,7 @@ export const useCardWallet = (cardId: string) => {
|
|
|
25
35
|
if (!currentProvisioningModule) return;
|
|
26
36
|
try {
|
|
27
37
|
const encryptedPayload = await getEncryptedPayload();
|
|
38
|
+
if (!encryptedPayload) return;
|
|
28
39
|
const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
|
|
29
40
|
|
|
30
41
|
const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);
|
|
@@ -37,8 +48,7 @@ export const useCardWallet = (cardId: string) => {
|
|
|
37
48
|
};
|
|
38
49
|
|
|
39
50
|
getCardWalletData();
|
|
40
|
-
|
|
41
|
-
}, [cardId]);
|
|
51
|
+
}, [signedNonce, cardId]);
|
|
42
52
|
|
|
43
53
|
return {
|
|
44
54
|
currentUNWallet
|