@tap-payments/auth-jsconnect 2.7.8-test → 2.7.8
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/build/@types/app.d.ts +42 -4
- package/build/@types/app.js +16 -0
- package/build/@types/config.d.ts +4 -0
- package/build/@types/form.d.ts +11 -1
- package/build/@types/redux.d.ts +1 -0
- package/build/api/account.d.ts +4 -1
- package/build/api/account.js +15 -1
- package/build/api/auth.d.ts +35 -20
- package/build/api/auth.js +1 -1
- package/build/api/axios.js +1 -2
- package/build/api/data.d.ts +4 -17
- package/build/api/data.js +5 -45
- package/build/api/entity.d.ts +3 -2
- package/build/api/entity.js +12 -4
- package/build/api/firebase.js +68 -8
- package/build/api/index.d.ts +14 -25
- package/build/api/lead.d.ts +16 -3
- package/build/api/lead.js +16 -0
- package/build/api/user.d.ts +7 -0
- package/build/api/user.js +9 -1
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.js +15 -15
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +353 -151
- package/build/assets/locales/en.json +349 -150
- package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
- package/build/components/AnimationFlow/AnimationFlow.js +5 -5
- package/build/components/AnimationFlow/BottomSheet.d.ts +5 -2
- package/build/components/AnimationFlow/BottomSheet.js +43 -14
- package/build/components/AnimationFlow/Dialog.d.ts +4 -3
- package/build/components/AnimationFlow/Dialog.js +5 -3
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
- package/build/components/ArabicDatePicker/style.css +32 -3
- package/build/components/DatePicker/DatePicker.d.ts +1 -1
- package/build/components/DatePicker/DatePicker.js +2 -2
- package/build/components/Footer/Footer.js +2 -1
- package/build/components/Input/Input.js +1 -1
- package/build/components/Providers/ThemeProvider.js +3 -3
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +5 -7
- package/build/constants/api.js +11 -15
- package/build/constants/app.d.ts +39 -0
- package/build/constants/app.js +345 -35
- package/build/constants/assets.d.ts +3 -0
- package/build/constants/assets.js +4 -1
- package/build/constants/dummy.d.ts +4 -219
- package/build/constants/dummy.js +64 -6194
- package/build/constants/flows.d.ts +26 -0
- package/build/constants/flows.js +27 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/validation.d.ts +3 -0
- package/build/constants/validation.js +3 -0
- package/build/features/app/auth/authStore.d.ts +29 -8
- package/build/features/app/auth/authStore.js +495 -149
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +186 -153
- package/build/features/app/board/boardStore.d.ts +5 -1
- package/build/features/app/board/boardStore.js +82 -51
- package/build/features/app/brand/brandStore.d.ts +17 -33
- package/build/features/app/brand/brandStore.js +254 -257
- package/build/features/app/business/businessStore.d.ts +37 -15
- package/build/features/app/business/businessStore.js +443 -235
- package/build/features/app/connect/connectStore.d.ts +33 -5
- package/build/features/app/connect/connectStore.js +355 -120
- package/build/features/app/connectExpress/connectExpressStore.d.ts +56 -27
- package/build/features/app/connectExpress/connectExpressStore.js +676 -392
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +204 -238
- package/build/features/app/individual/individualStore.d.ts +18 -34
- package/build/features/app/individual/individualStore.js +269 -292
- package/build/features/app/kyc/kycStore.d.ts +67 -0
- package/build/features/app/kyc/kycStore.js +432 -0
- package/build/features/app/password/passwordStore.d.ts +33 -18
- package/build/features/app/password/passwordStore.js +260 -219
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +170 -136
- package/build/features/auth/Auth.d.ts +5 -6
- package/build/features/auth/Auth.js +40 -15
- package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
- package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
- package/build/features/auth/screens/AuthSwitch/index.js +2 -0
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
- package/build/features/auth/screens/CivilID/CivilID.js +4 -35
- package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/auth/screens/DOB/DOBForm.js +59 -0
- package/build/features/auth/screens/DOB/index.d.ts +3 -0
- package/build/features/auth/screens/DOB/index.js +2 -0
- package/build/features/{business/screens/OTP → auth/screens/DOB}/validation.d.ts +4 -4
- package/build/features/auth/screens/DOB/validation.js +4 -0
- package/build/features/auth/screens/Email/Email.d.ts +5 -0
- package/build/features/auth/screens/Email/Email.js +57 -0
- package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
- package/build/features/auth/screens/Email/EmailField.js +52 -0
- package/build/features/auth/screens/Email/index.d.ts +3 -0
- package/build/features/auth/screens/Email/index.js +2 -0
- package/build/features/auth/screens/Email/validation.d.ts +8 -0
- package/build/features/auth/screens/Email/validation.js +4 -0
- package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
- package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
- package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
- package/build/features/auth/screens/EmailSent/index.js +2 -0
- package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
- package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
- package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
- package/build/features/auth/screens/MigratingData/index.js +2 -0
- package/build/features/auth/screens/Mobile/Mobile.js +6 -38
- package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
- package/build/features/auth/screens/Mobile/validation.js +11 -3
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +7 -43
- package/build/features/auth/screens/NID/validation.d.ts +0 -3
- package/build/features/auth/screens/NID/validation.js +0 -1
- package/build/features/auth/screens/OTP/OTP.js +41 -10
- package/build/features/auth/screens/OTP/OTPInput.js +23 -6
- package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
- package/build/features/auth/screens/OperatorError/index.js +2 -0
- package/build/features/auth/screens/Password/Password.d.ts +5 -0
- package/build/features/auth/screens/Password/Password.js +61 -0
- package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
- package/build/features/auth/screens/Password/PasswordField.js +28 -0
- package/build/features/auth/screens/Password/index.d.ts +3 -0
- package/build/features/auth/screens/Password/index.js +2 -0
- package/build/features/auth/screens/Password/validation.d.ts +8 -0
- package/build/features/auth/screens/Password/validation.js +4 -0
- package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/auth/screens/VerifyNafath/index.js +2 -0
- package/build/features/bank/Bank.d.ts +5 -1
- package/build/features/bank/Bank.js +22 -9
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +7 -6
- package/build/features/board/Board.d.ts +2 -0
- package/build/features/board/Board.js +24 -13
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
- package/build/features/board/screens/Verify/Verify.js +3 -2
- package/build/features/brand/Brand.d.ts +5 -1
- package/build/features/brand/Brand.js +22 -9
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
- package/build/features/brand/screens/BrandInfo/BrandName.js +5 -2
- package/build/features/brand/screens/BrandInfo/validation.js +2 -2
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +3 -2
- package/build/features/business/Business.js +20 -12
- package/build/features/business/screens/Activities/Activities.js +26 -9
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
- package/build/features/business/screens/Customers/Customers.js +50 -10
- package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +11 -5
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
- package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
- package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
- package/build/features/business/screens/Customers/validation.d.ts +6 -6
- package/build/features/business/screens/Customers/validation.js +3 -8
- package/build/features/business/screens/DOB/DOB.d.ts +6 -0
- package/build/features/business/screens/DOB/DOB.js +45 -0
- package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/business/screens/DOB/DOBForm.js +72 -0
- package/build/features/business/screens/DOB/index.d.ts +3 -0
- package/build/features/business/screens/DOB/index.js +2 -0
- package/build/features/{connectExpress/screens/IdentityOTP → business/screens/DOB}/validation.d.ts +4 -4
- package/build/features/business/screens/DOB/validation.js +4 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
- package/build/features/business/screens/IDBOD/validation.js +0 -1
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
- package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
- package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/business/screens/MobileOwnership/index.js +2 -0
- package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/business/screens/MobileOwnership/validation.js +38 -0
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +15 -4
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/business/screens/VerifyNafath/index.js +2 -0
- package/build/features/connect/Connect.d.ts +5 -1
- package/build/features/connect/Connect.js +16 -9
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connect/screens/CivilID/CivilID.js +6 -1
- package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
- package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
- package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connect/screens/DOB/DOBForm.js +59 -0
- package/build/features/connect/screens/DOB/index.d.ts +3 -0
- package/build/features/connect/screens/DOB/index.js +2 -0
- package/build/features/connect/screens/DOB/validation.d.ts +8 -0
- package/build/features/connect/screens/DOB/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +11 -5
- package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
- package/build/features/connect/screens/Individual/validation.js +11 -3
- package/build/features/connect/screens/Merchant/BrandName.js +5 -2
- package/build/features/connect/screens/Merchant/validation.js +2 -2
- package/build/features/connect/screens/Mobile/Mobile.js +12 -9
- package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/connect/screens/Mobile/validation.js +11 -3
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connect/screens/MobileOwnership/index.js +2 -0
- package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +5 -11
- package/build/features/connect/screens/NID/validation.d.ts +0 -3
- package/build/features/connect/screens/NID/validation.js +0 -1
- package/build/features/connect/screens/OTP/OTP.js +6 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -11
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyNafath/index.js +2 -0
- package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
- package/build/features/connectExpress/ConnectExpress.js +62 -39
- package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +2 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
- package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
- package/build/features/connectExpress/screens/DOB/index.js +2 -0
- package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/DOB/validation.js +4 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +10 -10
- package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/NID/TAC.js +2 -2
- package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NID/validation.js +0 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
- package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
- package/build/features/entity/Entity.d.ts +4 -1
- package/build/features/entity/Entity.js +22 -9
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
- package/build/features/entity/screens/EntityName/EntityName.js +31 -14
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
- package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
- package/build/features/entity/screens/EntityName/LegalName.js +1 -13
- package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +1 -10
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +3 -2
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +211 -13
- package/build/features/individual/Individual.d.ts +4 -1
- package/build/features/individual/Individual.js +22 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
- package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
- package/build/features/individual/screens/IndividualList/UserList.js +7 -7
- package/build/features/individual/screens/IndividualList/validation.js +11 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +3 -2
- package/build/features/kyc/KYC.d.ts +11 -0
- package/build/features/kyc/KYC.js +99 -0
- package/build/features/kyc/index.d.ts +1 -0
- package/build/features/kyc/index.js +1 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
- package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
- package/build/features/kyc/screens/Loading/Loading.js +10 -0
- package/build/features/kyc/screens/Loading/index.d.ts +2 -0
- package/build/features/kyc/screens/Loading/index.js +2 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
- package/build/features/kyc/screens/OperatorError/index.js +2 -0
- package/build/features/kyc/screens/Success/Success.d.ts +5 -0
- package/build/features/kyc/screens/Success/Success.js +32 -0
- package/build/features/kyc/screens/Success/index.d.ts +2 -0
- package/build/features/kyc/screens/Success/index.js +2 -0
- package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
- package/build/features/kyc/screens/Terms/Header.js +36 -0
- package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
- package/build/features/kyc/screens/Terms/Terms.js +87 -0
- package/build/features/kyc/screens/Terms/index.d.ts +2 -0
- package/build/features/kyc/screens/Terms/index.js +2 -0
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.d.ts +3 -0
- package/build/features/kyc/screens/Users/Users.js +76 -0
- package/build/features/kyc/screens/Users/index.d.ts +2 -0
- package/build/features/kyc/screens/Users/index.js +2 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
- package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
- package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
- package/build/features/password/Password.d.ts +4 -1
- package/build/features/password/Password.js +88 -31
- package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
- package/build/features/password/screens/OTP/OTP.js +3 -3
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +7 -6
- package/build/features/shared/Address/CountryList.d.ts +5 -5
- package/build/features/shared/Address/InputSelect.d.ts +5 -5
- package/build/features/shared/Background/Background.js +1 -1
- package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
- package/build/features/shared/Button/Button.js +3 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
- package/build/features/shared/Button/FlowsButtons.js +18 -4
- package/build/features/shared/Button/NafathButton.d.ts +8 -0
- package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/features/shared/Calender/Calender.d.ts +2 -1
- package/build/features/shared/Calender/Calender.js +3 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dialog/DialogContainer.js +5 -4
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
- package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
- package/build/features/shared/NafathVerification/index.d.ts +2 -0
- package/build/features/shared/NafathVerification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
- package/build/features/signIn/SignIn.js +18 -7
- package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/signIn/screens/Mobile/validation.js +11 -3
- package/build/features/signIn/screens/OTP/OTP.js +5 -4
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +4 -1
- package/build/features/tax/Tax.js +22 -9
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/features/tax/screens/Verify/Verify.js +7 -6
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useAppTheme.js +4 -3
- package/build/hooks/useCountDown.d.ts +10 -0
- package/build/hooks/useCountDown.js +17 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useSanitizedTranslation.d.ts +2 -0
- package/build/hooks/useSanitizedTranslation.js +15 -0
- package/build/hooks/useVerifyToken.d.ts +4 -2
- package/build/hooks/useVerifyToken.js +9 -4
- package/build/index.css +360 -120
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/components.js +7 -0
- package/build/theme/palette.js +2 -1
- package/build/theme/shadows.js +1 -1
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +2 -2
- package/build/utils/array.js +2 -2
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +16 -3
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +3 -0
- package/build/utils/string.d.ts +6 -2
- package/build/utils/string.js +28 -3
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +3 -4
- package/build/features/business/screens/OTP/OTP.d.ts +0 -8
- package/build/features/business/screens/OTP/OTP.js +0 -90
- package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
- package/build/features/business/screens/OTP/OTPInput.js +0 -49
- package/build/features/business/screens/OTP/index.d.ts +0 -3
- package/build/features/business/screens/OTP/index.js +0 -2
- package/build/features/business/screens/OTP/validation.js +0 -4
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -87
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
- package/build/features/shared/Button/AbsherButton.d.ts +0 -8
- /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
|
@@ -60,23 +60,24 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
60
60
|
import React, { memo } from 'react';
|
|
61
61
|
import { createRoot } from 'react-dom/client';
|
|
62
62
|
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useAppDispatch } from '../../hooks';
|
|
63
|
-
import { handleCurrentActiveScreen, handleSetCountryByIso2, settingsSelector } from '../../app/settings';
|
|
63
|
+
import { handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, settingsSelector } from '../../app/settings';
|
|
64
64
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
65
65
|
import { store } from '../../app/store';
|
|
66
66
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
67
67
|
import Collapse from '../../components/Collapse';
|
|
68
|
-
import { findOrCreateElementAndInject, sendPageView,
|
|
68
|
+
import { findOrCreateElementAndInject, sendPageView, isTapDomain, isOtherThanKWOrSA, initializeGTM } from '../../utils';
|
|
69
69
|
import { AUTH_SCREENS_NAVIGATION } from '../../constants';
|
|
70
70
|
import Background from '../shared/Background';
|
|
71
71
|
import { FeatureContainer } from '../shared/Containers';
|
|
72
|
-
import { authSelector, setMobileCountryCode, setLeadId, retrieveLeadIdentityByIdAsync } from '../app/auth/authStore';
|
|
72
|
+
import { authSelector, setMobileCountryCode, setLeadId, retrieveLeadIdentityByIdAsync, storeIsBusinessCountryPassed } from '../app/auth/authStore';
|
|
73
73
|
import { authFeatureScreens } from '../featuresScreens';
|
|
74
74
|
var Auth = memo(function (_a) {
|
|
75
|
-
var
|
|
75
|
+
var _b, _c, _d, _e;
|
|
76
|
+
var postURL = _a.postURL, configToken = _a.configToken, props = __rest(_a, ["postURL", "configToken"]);
|
|
76
77
|
var theme = useAppTheme().theme;
|
|
77
78
|
var dispatch = useAppDispatch();
|
|
78
|
-
var
|
|
79
|
-
var
|
|
79
|
+
var _f = useAppSelector(settingsSelector), settingData = _f.data, error = _f.error, settingLoading = _f.loading;
|
|
80
|
+
var _g = useAppSelector(authSelector), authError = _g.error, loading = _g.loading, customLoading = _g.customLoading, data = _g.data;
|
|
80
81
|
var leadId = data.leadId;
|
|
81
82
|
var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
83
|
var lead;
|
|
@@ -88,19 +89,38 @@ var Auth = memo(function (_a) {
|
|
|
88
89
|
});
|
|
89
90
|
}); };
|
|
90
91
|
useAppConfig(__assign(__assign(__assign({ postURL: postURL, navigation: AUTH_SCREENS_NAVIGATION }, props), { configToken: configToken }), (configToken && { onVerifyConfigTokenSuccess: onVerifyConfigTokenSuccess })));
|
|
91
|
-
useErrorListener(authError || error
|
|
92
|
+
useErrorListener(authError || error, {
|
|
93
|
+
event: 'Send Event',
|
|
94
|
+
event_category: 'User Registration Flow',
|
|
95
|
+
event_action: 'Registration Error'
|
|
96
|
+
});
|
|
92
97
|
useStepStartedListener();
|
|
93
|
-
var activeScreen = settingData.activeScreen, isTapOrigin = settingData.isTapOrigin, open = settingData.open, merchant = settingData.merchant;
|
|
94
|
-
var animationDirection = open ?
|
|
98
|
+
var activeScreen = settingData.activeScreen, isTapOrigin = settingData.isTapOrigin, open = settingData.open, merchant = settingData.merchant, appConfig = settingData.appConfig;
|
|
99
|
+
var animationDirection = open ? (_b = appConfig.features) === null || _b === void 0 ? void 0 : _b.dialogStartTransition : (_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.dialogEndTransition;
|
|
100
|
+
var hideOverlay = ((_d = appConfig.features) === null || _d === void 0 ? void 0 : _d.overlay) === false;
|
|
95
101
|
React.useEffect(function () {
|
|
96
102
|
var _a;
|
|
103
|
+
initializeGTM();
|
|
97
104
|
sendPageView({ title: 'Auth' });
|
|
98
105
|
dispatch(setLeadId((_a = props.leadId) !== null && _a !== void 0 ? _a : ''));
|
|
99
106
|
}, []);
|
|
107
|
+
var isOtherThanKWOrSACountry = React.useMemo(function () { var _a; return isOtherThanKWOrSA((_a = settingData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2); }, [settingData.businessCountry]);
|
|
108
|
+
var getMinHeight = function () {
|
|
109
|
+
if (activeScreen.name !== 'AUTH_SWITCH_STEP')
|
|
110
|
+
return {};
|
|
111
|
+
var _a = appConfig.features || {}, disableNafath = _a.disableNafath, disablePaci = _a.disablePaci;
|
|
112
|
+
if (disableNafath || disablePaci || isOtherThanKWOrSACountry)
|
|
113
|
+
return { minHeight: '180px' };
|
|
114
|
+
return {};
|
|
115
|
+
};
|
|
100
116
|
React.useEffect(function () {
|
|
101
117
|
var _a, _b;
|
|
102
|
-
if (settingLoading || !props.open
|
|
118
|
+
if (settingLoading || !props.open)
|
|
119
|
+
return;
|
|
120
|
+
if (!settingData.isValidOperator) {
|
|
121
|
+
dispatch(handleCurrentActiveScreen('AUTH_OPERATOR_ERROR_STEP'));
|
|
103
122
|
return;
|
|
123
|
+
}
|
|
104
124
|
if (leadId) {
|
|
105
125
|
dispatch(retrieveLeadIdentityByIdAsync(leadId));
|
|
106
126
|
return;
|
|
@@ -108,6 +128,7 @@ var Auth = memo(function (_a) {
|
|
|
108
128
|
var iso2 = (_a = settingData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
109
129
|
var ipIso2 = (_b = settingData.ipCountry) === null || _b === void 0 ? void 0 : _b.iso2;
|
|
110
130
|
if (!iso2 && ipIso2 && settingData.appConfig.scope === 'auth') {
|
|
131
|
+
dispatch(storeIsBusinessCountryPassed(false));
|
|
111
132
|
dispatch(handleSetCountryByIso2(ipIso2));
|
|
112
133
|
iso2 = ipIso2;
|
|
113
134
|
}
|
|
@@ -115,9 +136,6 @@ var Auth = memo(function (_a) {
|
|
|
115
136
|
dispatch(handleCurrentActiveScreen('AUTH_BUSINESS_COUNTRY_STEP'));
|
|
116
137
|
return;
|
|
117
138
|
}
|
|
118
|
-
if (iso2 && !isSA(iso2)) {
|
|
119
|
-
dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
|
|
120
|
-
}
|
|
121
139
|
}, [settingData.isValidOperator, settingLoading]);
|
|
122
140
|
React.useEffect(function () {
|
|
123
141
|
var _a;
|
|
@@ -125,7 +143,14 @@ var Auth = memo(function (_a) {
|
|
|
125
143
|
dispatch(setMobileCountryCode(settingData.businessCountry));
|
|
126
144
|
}
|
|
127
145
|
}, [settingData.businessCountry]);
|
|
128
|
-
|
|
146
|
+
var handleDialogClose = function () {
|
|
147
|
+
dispatch(handleOpen(false));
|
|
148
|
+
setTimeout(function () {
|
|
149
|
+
var _a;
|
|
150
|
+
(_a = props.unmount) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
151
|
+
}, 1100);
|
|
152
|
+
};
|
|
153
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ hideOverlay: hideOverlay, open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, onClose: ((_e = appConfig.features) === null || _e === void 0 ? void 0 : _e.closeButton) ? handleDialogClose : undefined, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapDomain(props.merchantDomain), animationDirection: animationDirection, dialogEdgeFormat: settingData.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ sx: getMinHeight(), isMaturityExpress: !isTapDomain(props.merchantDomain) }, { children: authFeatureScreens.map(function (_a, index) {
|
|
129
154
|
var Element = _a.element, name = _a.name;
|
|
130
155
|
var isActive = activeScreen.name === name;
|
|
131
156
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -137,7 +162,7 @@ export function AuthElement(props) {
|
|
|
137
162
|
export function renderAuthLib(config, elementId) {
|
|
138
163
|
var el = findOrCreateElementAndInject(elementId);
|
|
139
164
|
var root = createRoot(el);
|
|
140
|
-
root.render(_jsx(AuthElement, __assign({}, config)));
|
|
141
165
|
var unmount = function () { return root.unmount(); };
|
|
166
|
+
root.render(_jsx(AuthElement, __assign({}, config, { unmount: unmount })));
|
|
142
167
|
return { unmount: unmount };
|
|
143
168
|
}
|
|
@@ -23,7 +23,6 @@ import FlatButton from '../../../../components/Button';
|
|
|
23
23
|
import Warning from '../../../../components/Warning';
|
|
24
24
|
import { handleCurrentActiveScreen } from '../../../../app/settings';
|
|
25
25
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
26
|
-
import { AuthForType } from '../../../../@types';
|
|
27
26
|
import { authSelector, onSignUp } from '../../../app/auth/authStore';
|
|
28
27
|
var Container = styled(Box)(function (_a) {
|
|
29
28
|
var theme = _a.theme;
|
|
@@ -60,11 +59,9 @@ var AccountNotFound = function (_a) {
|
|
|
60
59
|
var t = useTranslation().t;
|
|
61
60
|
var dispatch = useAppDispatch();
|
|
62
61
|
var isAr = useLanguage().isAr;
|
|
63
|
-
var _b = useAppSelector(authSelector),
|
|
64
|
-
var isNidAuth = authData.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
62
|
+
var _b = useAppSelector(authSelector), loading = _b.loading, error = _b.error;
|
|
65
63
|
var onSignIn = function () {
|
|
66
|
-
|
|
67
|
-
dispatch(handleCurrentActiveScreen(screen));
|
|
64
|
+
dispatch(handleCurrentActiveScreen('AUTH_SWITCH_STEP'));
|
|
68
65
|
};
|
|
69
66
|
var handleOnSignUp = function () {
|
|
70
67
|
dispatch(onSignUp());
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
|
+
import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
17
|
+
import { resetStore } from '../../../app/auth/authStore';
|
|
18
|
+
import { NafathButton, MobileButton } from '../../../shared/Button';
|
|
19
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
|
+
import { isKW, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
21
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
22
|
+
var AuthSwitch = function (_a) {
|
|
23
|
+
var dispatch = useAppDispatch();
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var data = useAppSelector(settingsSelector).data;
|
|
26
|
+
var _b = data.appConfig.features || {}, disableNafath = _b.disableNafath, disablePaci = _b.disablePaci;
|
|
27
|
+
React.useEffect(function () {
|
|
28
|
+
dispatch(resetStore());
|
|
29
|
+
}, []);
|
|
30
|
+
var isKWCountry = React.useMemo(function () { return isKW(data.businessCountry.iso2); }, [data.businessCountry.iso2]);
|
|
31
|
+
var isSACountry = React.useMemo(function () { return isSA(data.businessCountry.iso2); }, [data.businessCountry.iso2]);
|
|
32
|
+
var onOpenMobile = function () {
|
|
33
|
+
dispatch(handleNextScreenStep('AUTH_MOBILE_STEP'));
|
|
34
|
+
};
|
|
35
|
+
var onOpenEmail = function () {
|
|
36
|
+
dispatch(handleNextScreenStep('AUTH_EMAIL_STEP'));
|
|
37
|
+
};
|
|
38
|
+
var onOpenNID = function () {
|
|
39
|
+
sendCustomEventToGTM({
|
|
40
|
+
event: 'Send Event',
|
|
41
|
+
event_category: 'User Registration Flow',
|
|
42
|
+
event_action: 'Abser Click',
|
|
43
|
+
event_label: data.businessCountry.iso2
|
|
44
|
+
});
|
|
45
|
+
dispatch(handleNextScreenStep('AUTH_NID_STEP'));
|
|
46
|
+
};
|
|
47
|
+
var onOpenPACI = function () {
|
|
48
|
+
sendCustomEventToGTM({
|
|
49
|
+
event: 'Send Event',
|
|
50
|
+
event_category: 'User Registration Flow',
|
|
51
|
+
event_action: 'PACI Click',
|
|
52
|
+
event_label: data.businessCountry.iso2
|
|
53
|
+
});
|
|
54
|
+
dispatch(handleNextScreenStep('AUTH_CIVIL_ID_STEP'));
|
|
55
|
+
};
|
|
56
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(MobileButton, __assign({ onClick: function () { return onOpenMobile(); } }, { children: t('mobile_button_label') })), _jsx(MobileButton, __assign({ onClick: function () { return onOpenEmail(); }, icon: ICONS_NAMES.email_icon }, { children: t('email_button_label') })), isKWCountry && !disablePaci ? (_jsx(MobileButton, __assign({ onClick: function () { return onOpenPACI(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (isSACountry && !disableNafath && _jsx(NafathButton, __assign({ onClick: function () { return onOpenNID(); } }, { children: t('nafath_button_label') })))] }));
|
|
57
|
+
};
|
|
58
|
+
export default React.memo(AuthSwitch);
|
|
@@ -17,8 +17,7 @@ import Collapse from '@mui/material/Collapse';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
|
-
import { deepCopy,
|
|
21
|
-
import { AuthForType } from '../../../../@types';
|
|
20
|
+
import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
|
|
22
21
|
import Form from '../../../../components/Form';
|
|
23
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
23
|
import Button from '../../../shared/Button';
|
|
@@ -41,8 +40,6 @@ var AuthenticationList = function (_a) {
|
|
|
41
40
|
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
42
41
|
var brandList = (data.responseData || {}).brandList;
|
|
43
42
|
var _e = React.useState(false), isAddEntity = _e[0], setIsAddEntity = _e[1];
|
|
44
|
-
var otpData = data.otpData;
|
|
45
|
-
var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
|
|
46
43
|
React.useEffect(function () {
|
|
47
44
|
sendCustomEventToGTM({
|
|
48
45
|
event: 'Send Event',
|
|
@@ -71,7 +68,6 @@ var AuthenticationList = function (_a) {
|
|
|
71
68
|
dispatch(getMerchantList(deepCopy(formData)));
|
|
72
69
|
};
|
|
73
70
|
var onBack = function () {
|
|
74
|
-
var _a;
|
|
75
71
|
if (isAddEntity) {
|
|
76
72
|
setIsAddEntity(false);
|
|
77
73
|
methods.setValue('licenseNumber', '');
|
|
@@ -80,10 +76,8 @@ var AuthenticationList = function (_a) {
|
|
|
80
76
|
methods.setValue('entityInfo', undefined, { shouldValidate: true });
|
|
81
77
|
return;
|
|
82
78
|
}
|
|
83
|
-
var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
84
|
-
var screen = startWithNID ? (isKW(code) ? 'AUTH_CIVIL_ID_STEP' : 'AUTH_NID_STEP') : 'AUTH_MOBILE_STEP';
|
|
85
79
|
dispatch(resetAuthenticationScreen());
|
|
86
|
-
dispatch(handlePrevScreenStep(
|
|
80
|
+
dispatch(handlePrevScreenStep());
|
|
87
81
|
};
|
|
88
82
|
React.useEffect(function () {
|
|
89
83
|
if (error)
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form';
|
|
5
5
|
import { KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH, LICENSE_NUMBER_MAX_LENGTH, LICENSE_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
6
|
-
import {
|
|
6
|
+
import { isSA, cleanFLandCRNumber } from '../../../../utils';
|
|
7
7
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
8
8
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
9
9
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -19,7 +19,7 @@ var LicenseNumber = function () {
|
|
|
19
19
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
20
20
|
var handleFLNumberChange = function (_a) {
|
|
21
21
|
var target = _a.target;
|
|
22
|
-
var value =
|
|
22
|
+
var value = cleanFLandCRNumber(target.value);
|
|
23
23
|
licenseNumberControl.field.onChange(value);
|
|
24
24
|
};
|
|
25
25
|
var clearLicenseNumber = function () {
|
|
@@ -52,7 +52,7 @@ import { useAppSelector, useAppDispatch, useLanguage } from '../../../../hooks';
|
|
|
52
52
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
53
53
|
import BusinessCountry from '../../../shared/BusinessCountry';
|
|
54
54
|
import Button from '../../../shared/Button';
|
|
55
|
-
import { findCountryByIso2,
|
|
55
|
+
import { findCountryByIso2, isSA, sendCustomEventToGTM } from '../../../../utils';
|
|
56
56
|
import Collapse from '../../../../components/Collapse';
|
|
57
57
|
import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
|
|
58
58
|
import { authSelector, updateBusinessCountry, storeIsStartFromBusinessCountry, clearError, resetStore, setMobileCountryCode } from '../../../app/auth/authStore';
|
|
@@ -81,6 +81,12 @@ var BusinessCountryScreen = function (_a) {
|
|
|
81
81
|
return [2];
|
|
82
82
|
countryCode = findCountryByIso2(settingsData.countries, iso2);
|
|
83
83
|
dispatch(handleSetCountryByIso2(iso2));
|
|
84
|
+
sendCustomEventToGTM({
|
|
85
|
+
event: 'Send Event',
|
|
86
|
+
event_category: 'User Registration Flow',
|
|
87
|
+
event_action: 'Country selection page view',
|
|
88
|
+
event_label: iso2
|
|
89
|
+
});
|
|
84
90
|
if (!data.leadId) return [3, 2];
|
|
85
91
|
return [4, dispatch(updateBusinessCountry(iso2)).unwrap()];
|
|
86
92
|
case 1:
|
|
@@ -89,7 +95,7 @@ var BusinessCountryScreen = function (_a) {
|
|
|
89
95
|
case 2:
|
|
90
96
|
if (countryCode)
|
|
91
97
|
dispatch(setMobileCountryCode(countryCode));
|
|
92
|
-
if (
|
|
98
|
+
if (!isSA(iso2)) {
|
|
93
99
|
dispatch(handleNextScreenStep('AUTH_MOBILE_STEP'));
|
|
94
100
|
return [2];
|
|
95
101
|
}
|
|
@@ -13,49 +13,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
|
-
import {
|
|
17
|
-
import Box from '@mui/material/Box';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
18
|
import { civilIDValidationSchema } from './validation';
|
|
20
19
|
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
|
-
import {
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
21
|
import { clearError, authSelector, resetStore, createCivilIdAuth } from '../../../app/auth/authStore';
|
|
23
22
|
import Form from '../../../../components/Form';
|
|
24
|
-
import Button
|
|
23
|
+
import Button from '../../../shared/Button';
|
|
25
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
26
|
-
import Collapse from '../../../../components/Collapse';
|
|
27
|
-
import Divider from '@mui/material/Divider';
|
|
28
|
-
import Text from '../../../../components/Text';
|
|
29
25
|
import { deepCopy } from '../../../../utils';
|
|
30
26
|
import IDNumber from './IDNumber';
|
|
31
27
|
var FormStyled = styled(Form)(function () { return ({
|
|
32
28
|
display: 'flex',
|
|
33
29
|
flexDirection: 'column'
|
|
34
30
|
}); });
|
|
35
|
-
var TextStyled = styled(Text)(function (_a) {
|
|
36
|
-
var theme = _a.theme;
|
|
37
|
-
return ({
|
|
38
|
-
color: alpha(theme.palette.primary.dark, 0.4)
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
var DividerStyled = styled(Divider)(function (_a) {
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return ({
|
|
44
|
-
width: '45%',
|
|
45
|
-
borderColor: alpha(theme.palette.primary.dark, 0.4),
|
|
46
|
-
marginBlockEnd: theme.spacing(0.62)
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
var OrBoxStyled = styled(Box)(function (_a) {
|
|
50
|
-
var theme = _a.theme;
|
|
51
|
-
return ({
|
|
52
|
-
display: 'flex',
|
|
53
|
-
justifyContent: 'space-between',
|
|
54
|
-
marginBlockEnd: theme.spacing(1.62),
|
|
55
|
-
marginBlockStart: theme.spacing(-1.25),
|
|
56
|
-
marginInline: theme.spacing(2.5)
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
31
|
var CivilID = function (_a) {
|
|
60
32
|
var isAr = useLanguage().isAr;
|
|
61
33
|
var dispatch = useAppDispatch();
|
|
@@ -79,10 +51,7 @@ var CivilID = function (_a) {
|
|
|
79
51
|
var onBack = function () {
|
|
80
52
|
dispatch(handlePrevScreenStep());
|
|
81
53
|
};
|
|
82
|
-
var onBackToCountryList = function () {
|
|
83
|
-
dispatch(handleCurrentActiveScreen('AUTH_BUSINESS_COUNTRY_STEP'));
|
|
84
|
-
};
|
|
85
54
|
var disabled = !methods.formState.isValid;
|
|
86
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb:
|
|
55
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
87
56
|
};
|
|
88
57
|
export default React.memo(CivilID);
|
|
@@ -24,7 +24,7 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
24
24
|
});
|
|
25
25
|
var DOB = function (_a) {
|
|
26
26
|
var _b;
|
|
27
|
-
var onDateClicked = _a.onDateClicked
|
|
27
|
+
var onDateClicked = _a.onDateClicked;
|
|
28
28
|
var t = useTranslation().t;
|
|
29
29
|
var control = useFormContext().control;
|
|
30
30
|
var dispatch = useAppDispatch();
|
|
@@ -41,7 +41,7 @@ var DOB = function (_a) {
|
|
|
41
41
|
var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
42
42
|
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
43
43
|
var spacing = _a.spacing;
|
|
44
|
-
return spacing(
|
|
45
|
-
} } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true,
|
|
44
|
+
return spacing(0, 2.5, 1.5, 2.5);
|
|
45
|
+
} } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleBirthDateChange })] }));
|
|
46
46
|
};
|
|
47
47
|
export default DOB;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
16
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
+
import { DOBValidationSchema } from './validation';
|
|
19
|
+
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
+
import { clearError, authSelector, updateLeadDOB } from '../../../app/auth/authStore';
|
|
22
|
+
import Form from '../../../../components/Form';
|
|
23
|
+
import Button from '../../../shared/Button';
|
|
24
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
+
import Collapse from '../../../../components/Collapse';
|
|
26
|
+
import DOB from './DOB';
|
|
27
|
+
import { deepCopy } from '../../../../utils';
|
|
28
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'column'
|
|
31
|
+
}); });
|
|
32
|
+
var DOBForm = function (_a) {
|
|
33
|
+
var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
|
|
34
|
+
var isAr = useLanguage().isAr;
|
|
35
|
+
var dispatch = useAppDispatch();
|
|
36
|
+
var t = useTranslation().t;
|
|
37
|
+
var _c = useAppSelector(authSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
38
|
+
var methods = useForm({
|
|
39
|
+
resolver: yupResolver(DOBValidationSchema),
|
|
40
|
+
defaultValues: data.dobData,
|
|
41
|
+
mode: 'onChange'
|
|
42
|
+
});
|
|
43
|
+
React.useEffect(function () {
|
|
44
|
+
if (error)
|
|
45
|
+
dispatch(clearError());
|
|
46
|
+
}, [methods.formState.isValid]);
|
|
47
|
+
var onSubmit = function (data) {
|
|
48
|
+
dispatch(updateLeadDOB(deepCopy(data)));
|
|
49
|
+
};
|
|
50
|
+
var handleCollapseOpenClose = function (flag) {
|
|
51
|
+
setCollapse(flag);
|
|
52
|
+
};
|
|
53
|
+
var onBack = function () {
|
|
54
|
+
dispatch(handlePrevScreenStep());
|
|
55
|
+
};
|
|
56
|
+
var disabled = !methods.formState.isValid;
|
|
57
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ sx: { mt: 10 }, loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
58
|
+
};
|
|
59
|
+
export default React.memo(DOBForm);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
2
|
+
export declare const DOBValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
-
|
|
5
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
6
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
-
|
|
7
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
8
|
}>>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
17
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
+
import { EmailInfoValidation } from './validation';
|
|
19
|
+
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
20
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
+
import { clearError, authSelector, resetStore, createEmailAuth } from '../../../app/auth/authStore';
|
|
22
|
+
import Form from '../../../../components/Form';
|
|
23
|
+
import Button from '../../../shared/Button';
|
|
24
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
+
import { deepCopy } from '../../../../utils';
|
|
26
|
+
import EmailField from './EmailField';
|
|
27
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column'
|
|
30
|
+
}); });
|
|
31
|
+
var Email = function (_a) {
|
|
32
|
+
var isAr = useLanguage().isAr;
|
|
33
|
+
var dispatch = useAppDispatch();
|
|
34
|
+
var t = useTranslation().t;
|
|
35
|
+
var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
36
|
+
var methods = useForm({
|
|
37
|
+
resolver: yupResolver(EmailInfoValidation),
|
|
38
|
+
defaultValues: data.emailData,
|
|
39
|
+
mode: 'onChange'
|
|
40
|
+
});
|
|
41
|
+
React.useEffect(function () {
|
|
42
|
+
if (error)
|
|
43
|
+
dispatch(clearError());
|
|
44
|
+
}, [methods.formState.isValid]);
|
|
45
|
+
React.useEffect(function () {
|
|
46
|
+
dispatch(resetStore());
|
|
47
|
+
}, []);
|
|
48
|
+
var onSubmit = function (data) {
|
|
49
|
+
dispatch(createEmailAuth(deepCopy(data)));
|
|
50
|
+
};
|
|
51
|
+
var onBack = function () {
|
|
52
|
+
dispatch(handlePrevScreenStep());
|
|
53
|
+
};
|
|
54
|
+
var disabled = !methods.formState.isValid;
|
|
55
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(EmailField, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
56
|
+
};
|
|
57
|
+
export default React.memo(Email);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
interface EmailFieldProps {
|
|
4
|
+
sx: SxProps<Theme> | undefined;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<EmailFieldProps & React.RefAttributes<unknown>>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
import { MAX_EMAIL_LENGTH } from '../../../../constants';
|
|
20
|
+
import Input from '../../../shared/Input';
|
|
21
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
22
|
+
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
34
|
+
});
|
|
35
|
+
var EmailField = React.forwardRef(function (_a, ref) {
|
|
36
|
+
var _b;
|
|
37
|
+
var sx = _a.sx, readOnly = _a.readOnly;
|
|
38
|
+
var t = useTranslation().t;
|
|
39
|
+
var control = useFormContext().control;
|
|
40
|
+
var emailControl = useController({ control: control, name: 'email' });
|
|
41
|
+
var handleEmailChange = function (_a) {
|
|
42
|
+
var target = _a.target;
|
|
43
|
+
emailControl.field.onChange(target.value);
|
|
44
|
+
};
|
|
45
|
+
var clearEmail = function () {
|
|
46
|
+
emailControl.field.onChange('');
|
|
47
|
+
};
|
|
48
|
+
var emailValue = emailControl.field.value;
|
|
49
|
+
var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
50
|
+
return (_jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_email_lable') }) }), _jsx(Input, { type: 'email', readOnly: readOnly, inputProps: { maxLength: MAX_EMAIL_LENGTH }, onChange: handleEmailChange, value: emailValue, endAdornment: _jsx(EndAdornment, { value: emailValue, error: error, onClear: clearEmail }), placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true })] })));
|
|
51
|
+
});
|
|
52
|
+
export default React.memo(EmailField);
|