@tap-payments/auth-jsconnect 1.0.4 → 1.0.7
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 +74 -0
- package/build/@types/app.js +11 -1
- package/build/@types/theme.d.ts +12 -3
- package/build/@types/theme.js +15 -1
- package/build/app/rootReducer.d.ts +1 -1
- package/build/app/rootReducer.js +1 -1
- package/build/app/settings.d.ts +7 -2
- package/build/app/settings.js +36 -6
- package/build/app/store.d.ts +2 -2
- package/build/assets/locales/ar.json +70 -3
- package/build/assets/locales/en.json +69 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +3 -2
- package/build/components/AnimationFlow/BottomSheet.js +30 -3
- package/build/components/AnimationFlow/Dialog.d.ts +3 -2
- package/build/components/AnimationFlow/Dialog.js +26 -18
- package/build/components/Button/Button.d.ts +7 -3
- package/build/components/Button/Button.js +20 -2
- package/build/components/Collapse/Collapse.d.ts +5 -0
- package/build/components/Collapse/Collapse.js +28 -0
- package/build/components/Collapse/index.d.ts +3 -0
- package/build/components/Collapse/index.js +2 -0
- package/build/components/DatePicker/DatePicker.js +3 -3
- package/build/components/Footer/Footer.js +1 -1
- package/build/components/Input/Input.d.ts +4 -1
- package/build/components/Input/Input.js +7 -5
- package/build/components/Loader/Loader.d.ts +10 -8
- package/build/components/Loader/Loader.js +21 -41
- package/build/components/OTPField/OTPField.js +3 -23
- package/build/components/OTPTimer/OTPTimer.d.ts +4 -2
- package/build/components/OTPTimer/OTPTimer.js +20 -8
- package/build/components/Providers/ThemeProvider.js +6 -9
- package/build/components/SimpleList/SimpleList.d.ts +11 -3
- package/build/components/SimpleList/SimpleList.js +51 -22
- package/build/components/Slide/Slide.d.ts +6 -0
- package/build/components/Slide/Slide.js +30 -0
- package/build/components/Slide/index.d.ts +3 -0
- package/build/components/Slide/index.js +2 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +14 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +86 -0
- package/build/components/SocialMediaGroup/index.d.ts +3 -0
- package/build/components/SocialMediaGroup/index.js +2 -0
- package/build/components/ToggleButton/ToggleButton.d.ts +5 -0
- package/build/components/ToggleButton/ToggleButton.js +44 -0
- package/build/components/ToggleButton/index.d.ts +3 -0
- package/build/components/ToggleButton/index.js +2 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +5 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.js +37 -0
- package/build/components/ToggleButtonGroup/index.d.ts +3 -0
- package/build/components/ToggleButtonGroup/index.js +2 -0
- package/build/components/Tooltip/Tooltip.d.ts +10 -0
- package/build/components/Tooltip/Tooltip.js +44 -0
- package/build/components/Tooltip/index.d.ts +3 -0
- package/build/components/Tooltip/index.js +2 -0
- package/build/components/Warning/Warning.d.ts +2 -1
- package/build/components/Warning/Warning.js +4 -19
- package/build/constants/app.d.ts +14 -4
- package/build/constants/app.js +145 -4
- package/build/constants/assets.d.ts +11 -0
- package/build/constants/assets.js +12 -1
- package/build/constants/dummy.d.ts +103 -0
- package/build/constants/dummy.js +219 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/validation.d.ts +6 -0
- package/build/constants/validation.js +6 -0
- package/build/features/app/{midStore.d.ts → business/midStore.d.ts} +2 -2
- package/build/features/app/{midStore.js → business/midStore.js} +0 -0
- package/build/features/app/connect/midStore.d.ts +10 -0
- package/build/features/app/connect/midStore.js +18 -0
- package/build/features/bank/Bank.d.ts +6 -0
- package/build/features/bank/Bank.js +48 -0
- package/build/features/bank/index.d.ts +1 -0
- package/build/features/bank/index.js +1 -0
- package/build/features/bank/screens/BankDetails/BankDetails.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/BankDetails.js +57 -0
- package/build/features/bank/screens/BankDetails/BankName.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/BankName.js +27 -0
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/Beneficiary.js +34 -0
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +5 -0
- package/build/features/bank/screens/BankDetails/IBAN.js +35 -0
- package/build/features/bank/screens/BankDetails/index.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/index.js +2 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +14 -0
- package/build/features/bank/screens/BankDetails/validation.js +9 -0
- package/build/features/business/Business.d.ts +6 -0
- package/build/features/business/Business.js +61 -0
- package/build/features/business/index.d.ts +1 -0
- package/build/features/business/index.js +1 -0
- package/build/features/business/screens/Activities/Activities.d.ts +5 -0
- package/build/features/business/screens/Activities/Activities.js +83 -0
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +70 -0
- package/build/features/business/screens/Activities/ActivitiesList.js +136 -0
- package/build/features/business/screens/Activities/SalesChannels.d.ts +5 -0
- package/build/features/business/screens/Activities/SalesChannels.js +107 -0
- package/build/features/business/screens/Activities/index.d.ts +3 -0
- package/build/features/business/screens/Activities/index.js +2 -0
- package/build/features/business/screens/Activities/validation.d.ts +119 -0
- package/build/features/business/screens/Activities/validation.js +17 -0
- package/build/features/business/screens/BusinessType/BusinessType.d.ts +12 -0
- package/build/features/business/screens/BusinessType/BusinessType.js +85 -0
- package/build/features/business/screens/BusinessType/CRNumber.d.ts +6 -0
- package/build/features/business/screens/BusinessType/CRNumber.js +40 -0
- package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +11 -0
- package/build/features/business/screens/BusinessType/CompanyLicense.js +109 -0
- package/build/features/business/screens/BusinessType/FLNumber.d.ts +6 -0
- package/build/features/business/screens/BusinessType/FLNumber.js +40 -0
- package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +11 -0
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +112 -0
- package/build/features/business/screens/BusinessType/SelectType.d.ts +8 -0
- package/build/features/business/screens/BusinessType/SelectType.js +106 -0
- package/build/features/business/screens/BusinessType/Switch.d.ts +7 -0
- package/build/features/business/screens/BusinessType/Switch.js +35 -0
- package/build/features/business/screens/BusinessType/index.d.ts +3 -0
- package/build/features/business/screens/BusinessType/index.js +2 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +15 -0
- package/build/features/business/screens/BusinessType/validation.js +14 -0
- package/build/features/business/screens/Confirm/Confirm.d.ts +5 -0
- package/build/features/business/screens/Confirm/Confirm.js +53 -0
- package/build/features/business/screens/Confirm/index.d.ts +3 -0
- package/build/features/business/screens/Confirm/index.js +2 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +92 -0
- package/build/features/business/screens/Customers/CustomerLocations.js +122 -0
- package/build/features/business/screens/Customers/Customers.d.ts +5 -0
- package/build/features/business/screens/Customers/Customers.js +92 -0
- package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +7 -0
- package/build/features/business/screens/Customers/ExpectedCustomers.js +78 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +7 -0
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +74 -0
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +44 -0
- package/build/features/business/screens/Customers/RefundPolicy.js +86 -0
- package/build/features/business/screens/Customers/TransactionPolicy.d.ts +3 -0
- package/build/features/business/screens/Customers/TransactionPolicy.js +37 -0
- package/build/features/business/screens/Customers/index.d.ts +3 -0
- package/build/features/business/screens/Customers/index.js +2 -0
- package/build/features/business/screens/Customers/validation.d.ts +20 -0
- package/build/features/business/screens/Customers/validation.js +8 -0
- package/build/features/business/screens/IDBOD/DOB.d.ts +5 -0
- package/build/features/business/screens/IDBOD/DOB.js +44 -0
- package/build/features/business/screens/IDBOD/ID.d.ts +5 -0
- package/build/features/business/screens/IDBOD/ID.js +69 -0
- package/build/features/business/screens/IDBOD/IDBOD.d.ts +5 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +85 -0
- package/build/features/business/screens/IDBOD/index.d.ts +3 -0
- package/build/features/business/screens/IDBOD/index.js +2 -0
- package/build/features/business/screens/IDBOD/validation.d.ts +11 -0
- package/build/features/business/screens/IDBOD/validation.js +5 -0
- package/build/features/business/screens/OTP/OTP.d.ts +11 -0
- package/build/features/business/screens/OTP/OTP.js +112 -0
- package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPInput.js +51 -0
- package/build/features/business/screens/OTP/OTPTimer.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPTimer.js +20 -0
- package/build/features/business/screens/OTP/index.d.ts +3 -0
- package/build/features/business/screens/OTP/index.js +2 -0
- package/build/features/business/screens/OTP/validation.d.ts +8 -0
- package/build/features/business/screens/OTP/validation.js +4 -0
- package/build/features/business/screens/Success/Success.d.ts +5 -0
- package/build/features/business/screens/Success/Success.js +15 -0
- package/build/features/business/screens/Success/index.d.ts +3 -0
- package/build/features/business/screens/Success/index.js +2 -0
- package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +6 -0
- package/build/features/business/screens/VerifyNumber/OTPInput.js +68 -0
- package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +5 -0
- package/build/features/business/screens/VerifyNumber/OTPTimer.js +20 -0
- package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +13 -0
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +119 -0
- package/build/features/business/screens/VerifyNumber/index.d.ts +3 -0
- package/build/features/business/screens/VerifyNumber/index.js +2 -0
- package/build/features/business/screens/VerifyNumber/validation.d.ts +8 -0
- package/build/features/business/screens/VerifyNumber/validation.js +4 -0
- package/build/features/connect/Connect.js +20 -22
- package/build/features/connect/screens/Individual/Email.d.ts +5 -0
- package/build/features/connect/screens/Individual/Email.js +31 -0
- package/build/features/connect/screens/Individual/Individual.d.ts +5 -0
- package/build/features/connect/screens/Individual/Individual.js +77 -0
- package/build/features/connect/screens/Individual/Name.d.ts +5 -0
- package/build/features/connect/screens/Individual/Name.js +31 -0
- package/build/features/connect/screens/Individual/index.d.ts +3 -0
- package/build/features/connect/screens/Individual/index.js +2 -0
- package/build/features/connect/screens/Individual/validation.d.ts +11 -0
- package/build/features/connect/screens/Individual/validation.js +5 -0
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +2 -6
- package/build/features/connect/screens/MID/BusinessCountry.js +20 -79
- package/build/features/connect/screens/MID/IDNumber.d.ts +0 -4
- package/build/features/connect/screens/MID/IDNumber.js +24 -36
- package/build/features/connect/screens/MID/MID.js +41 -24
- package/build/features/connect/screens/MID/MIDTitle.js +2 -2
- package/build/features/connect/screens/MID/MobileNumber.d.ts +2 -7
- package/build/features/connect/screens/MID/MobileNumber.js +40 -84
- package/build/features/connect/screens/MID/validation.d.ts +18 -0
- package/build/features/connect/screens/MID/validation.js +8 -0
- package/build/features/connect/screens/Merchant/BrandName.d.ts +5 -0
- package/build/features/connect/screens/Merchant/BrandName.js +73 -0
- package/build/features/connect/screens/Merchant/Merchant.d.ts +5 -0
- package/build/features/connect/screens/Merchant/Merchant.js +50 -0
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +5 -0
- package/build/features/connect/screens/Merchant/SocialMedia.js +79 -0
- package/build/features/connect/screens/Merchant/TAC.d.ts +5 -0
- package/build/features/connect/screens/Merchant/TAC.js +79 -0
- package/build/features/connect/screens/Merchant/index.d.ts +3 -0
- package/build/features/connect/screens/Merchant/index.js +2 -0
- package/build/features/connect/screens/Merchant/validation.d.ts +50 -0
- package/build/features/connect/screens/Merchant/validation.js +23 -0
- package/build/features/connect/screens/OTP/OTP.d.ts +6 -2
- package/build/features/connect/screens/OTP/OTP.js +41 -46
- package/build/features/connect/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTP/OTPInput.js +38 -0
- package/build/features/connect/screens/OTP/validation.d.ts +8 -0
- package/build/features/connect/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Password/Password.d.ts +5 -0
- package/build/features/connect/screens/Password/Password.js +49 -0
- package/build/features/connect/screens/Password/PasswordInput.d.ts +5 -0
- package/build/features/connect/screens/Password/PasswordInput.js +38 -0
- package/build/features/connect/screens/Password/index.d.ts +3 -0
- package/build/features/connect/screens/Password/index.js +2 -0
- package/build/features/connect/screens/Password/validation.d.ts +8 -0
- package/build/features/connect/screens/Password/validation.js +4 -0
- package/build/features/connect/screens/ThankYou/ThankYou.d.ts +5 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +15 -0
- package/build/features/connect/screens/ThankYou/index.d.ts +3 -0
- package/build/features/connect/screens/ThankYou/index.js +2 -0
- package/build/features/featuresScreens.d.ts +7 -0
- package/build/features/featuresScreens.js +99 -0
- package/build/features/owner/Owner.d.ts +6 -0
- package/build/features/owner/Owner.js +50 -0
- package/build/features/owner/index.d.ts +1 -0
- package/build/features/owner/index.js +1 -0
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +19 -0
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +52 -0
- package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +3 -0
- package/build/features/owner/screens/ShowOwnerInfo/index.js +2 -0
- package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +7 -0
- package/build/features/owner/screens/ShowOwnerInfo/info.js +28 -0
- package/build/features/password/Password.d.ts +6 -0
- package/build/features/password/Password.js +50 -0
- package/build/features/password/index.d.ts +1 -0
- package/build/features/password/index.js +1 -0
- package/build/features/password/screens/CreatePassword/ConditionText.d.ts +7 -0
- package/build/features/password/screens/CreatePassword/ConditionText.js +23 -0
- package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +27 -0
- package/build/features/password/screens/CreatePassword/CreatePassword.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/CreatePassword.js +51 -0
- package/build/features/password/screens/CreatePassword/Password.d.ts +5 -0
- package/build/features/password/screens/CreatePassword/Password.js +75 -0
- package/build/features/password/screens/CreatePassword/PasswordBar.d.ts +7 -0
- package/build/features/password/screens/CreatePassword/PasswordBar.js +29 -0
- package/build/features/password/screens/CreatePassword/index.d.ts +3 -0
- package/build/features/password/screens/CreatePassword/index.js +2 -0
- package/build/features/password/screens/CreatePassword/validation.d.ts +11 -0
- package/build/features/password/screens/CreatePassword/validation.js +8 -0
- package/build/features/shared/Button/Button.d.ts +8 -0
- package/build/features/shared/Button/Button.js +49 -0
- package/build/features/shared/Button/index.d.ts +2 -0
- package/build/features/shared/Button/index.js +2 -0
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +2 -0
- package/build/features/shared/CheckIcon/CheckIcon.js +14 -0
- package/build/features/shared/CheckIcon/index.d.ts +2 -0
- package/build/features/shared/CheckIcon/index.js +2 -0
- package/build/features/shared/ClearIcon/ClearIcon.d.ts +6 -0
- package/build/features/shared/ClearIcon/ClearIcon.js +26 -0
- package/build/features/shared/ClearIcon/index.d.ts +2 -0
- package/build/features/shared/ClearIcon/index.js +2 -0
- package/build/features/shared/Containers/FeatureContainer.d.ts +4 -0
- package/build/features/shared/Containers/FeatureContainer.js +33 -0
- package/build/features/shared/Containers/ScreenContainer.d.ts +4 -0
- package/build/features/shared/Containers/ScreenContainer.js +28 -0
- package/build/features/shared/Containers/index.d.ts +3 -0
- package/build/features/shared/Containers/index.js +3 -0
- package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +7 -0
- package/build/features/shared/ExpandIcon/ExpandIcon.js +24 -0
- package/build/features/shared/ExpandIcon/index.d.ts +2 -0
- package/build/features/shared/ExpandIcon/index.js +2 -0
- package/build/features/shared/Footer/Footer.d.ts +2 -0
- package/build/features/shared/Footer/Footer.js +16 -0
- package/build/features/shared/Footer/index.d.ts +2 -0
- package/build/features/shared/Footer/index.js +2 -0
- package/build/features/shared/Input/Input.d.ts +27 -0
- package/build/features/shared/Input/Input.js +59 -0
- package/build/features/shared/Input/index.d.ts +2 -0
- package/build/features/shared/Input/index.js +2 -0
- package/build/features/shared/OTP/OTP.d.ts +9 -0
- package/build/features/shared/OTP/OTP.js +85 -0
- package/build/features/shared/OTP/index.d.ts +2 -0
- package/build/features/shared/OTP/index.js +2 -0
- package/build/features/shared/PasswordIcon/PasswordIcon.d.ts +8 -0
- package/build/features/shared/PasswordIcon/PasswordIcon.js +37 -0
- package/build/features/shared/PasswordIcon/index.d.ts +2 -0
- package/build/features/shared/PasswordIcon/index.js +2 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +7 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.js +54 -0
- package/build/features/shared/SuccessScreen/index.d.ts +2 -0
- package/build/features/shared/SuccessScreen/index.js +2 -0
- package/build/features/tax/Tax.d.ts +6 -0
- package/build/features/tax/Tax.js +50 -0
- package/build/features/tax/index.d.ts +1 -0
- package/build/features/tax/index.js +1 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.d.ts +5 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +45 -0
- package/build/features/tax/screens/TaxDetails/VATId.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/VATId.js +27 -0
- package/build/features/tax/screens/TaxDetails/index.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/index.js +2 -0
- package/build/features/tax/screens/TaxDetails/validation.d.ts +8 -0
- package/build/features/tax/screens/TaxDetails/validation.js +4 -0
- package/build/hooks/index.d.ts +5 -0
- package/build/hooks/index.js +5 -0
- package/build/hooks/useAppDispatch.d.ts +4 -0
- package/build/hooks/useAppDispatch.js +2 -0
- package/build/hooks/useAppSelector.d.ts +3 -0
- package/build/hooks/useAppSelector.js +2 -0
- package/build/hooks/useAppTheme.js +3 -2
- package/build/hooks/useContainerDimensions.d.ts +4 -0
- package/build/hooks/useContainerDimensions.js +21 -0
- package/build/hooks/useEventListener.d.ts +5 -0
- package/build/hooks/useEventListener.js +20 -0
- package/build/hooks/useLanguage.d.ts +4 -0
- package/build/hooks/useLanguage.js +8 -0
- package/build/index.css +6 -1
- package/build/index.d.ts +7 -2
- package/build/index.js +17 -2
- package/build/theme/palette.js +11 -4
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +0 -1
- package/build/theme/typography.js +2 -2
- package/build/utils/array.d.ts +3 -1
- package/build/utils/array.js +7 -3
- package/build/utils/string.d.ts +3 -1
- package/build/utils/string.js +11 -2
- package/build/utils/validation.d.ts +10 -0
- package/build/utils/validation.js +30 -0
- package/package.json +120 -116
- package/build/app/hooks.d.ts +0 -7
- package/build/app/hooks.js +0 -3
|
@@ -0,0 +1,69 @@
|
|
|
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 Box from '@mui/material/Box';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
import Input from '../../../../components/Input';
|
|
20
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
21
|
+
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
22
|
+
import { ID_NUMBER_LENGTH } from '../../../../constants';
|
|
23
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
direction: theme.direction
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
34
|
+
});
|
|
35
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
36
|
+
var theme = _a.theme;
|
|
37
|
+
return ({
|
|
38
|
+
padding: theme.spacing(0, 2, 0, 0)
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
42
|
+
var theme = _a.theme;
|
|
43
|
+
return ({
|
|
44
|
+
width: theme.spacing(2),
|
|
45
|
+
height: theme.spacing(2),
|
|
46
|
+
cursor: 'pointer',
|
|
47
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var IDNumber = function (_a) {
|
|
51
|
+
var _b;
|
|
52
|
+
var t = useTranslation().t;
|
|
53
|
+
var control = useFormContext().control;
|
|
54
|
+
var nidControl = useController({ control: control, name: 'nid' });
|
|
55
|
+
var handleIdChange = function (_a) {
|
|
56
|
+
var target = _a.target;
|
|
57
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
58
|
+
nidControl.field.onChange(value);
|
|
59
|
+
};
|
|
60
|
+
var clearIdNumber = function () {
|
|
61
|
+
nidControl.field.onChange('');
|
|
62
|
+
};
|
|
63
|
+
var nidValue = nidControl.field.value;
|
|
64
|
+
return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
65
|
+
var spacing = _a.spacing;
|
|
66
|
+
return spacing(2.5, 2.5, 1.5, 2.5);
|
|
67
|
+
} } }, { children: t('id_number_label') })), _jsx(InputStyled, { inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: nidValue && _jsx(ClearIconStyled, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message })] }));
|
|
68
|
+
};
|
|
69
|
+
export default React.memo(IDNumber);
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Box from '@mui/material/Box';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
17
|
+
import ID from './ID';
|
|
18
|
+
import DOB from './DOB';
|
|
19
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
20
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
|
+
import { NIDValidationSchema } from './validation';
|
|
22
|
+
import Loader from '../../../../components/Loader';
|
|
23
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
24
|
+
import Button from '../../../../components/Button';
|
|
25
|
+
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
26
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
27
|
+
import Icon from '../../../../components/Icon';
|
|
28
|
+
import Form from '../../../../components/Form';
|
|
29
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return ({
|
|
32
|
+
direction: theme.direction,
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
overflow: 'hidden'
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
39
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
40
|
+
return ({
|
|
41
|
+
width: theme.spacing(3),
|
|
42
|
+
height: theme.spacing(3),
|
|
43
|
+
paddingInlineStart: theme.spacing(1.5),
|
|
44
|
+
paddingInlineEnd: theme.spacing(0.5),
|
|
45
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var ButtonContainer = styled(Box)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return ({
|
|
51
|
+
margin: theme.spacing(5, 2.5, 2.5, 2.5)
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
var LoaderStyled = styled(Loader)(function (_a) {
|
|
55
|
+
var theme = _a.theme;
|
|
56
|
+
return ({
|
|
57
|
+
marginInlineStart: theme.spacing(-6.25),
|
|
58
|
+
'& .loader-box-container': {
|
|
59
|
+
marginInlineStart: theme.spacing(2.5)
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'column'
|
|
66
|
+
}); });
|
|
67
|
+
var IDBOD = function (_a) {
|
|
68
|
+
var isAr = useLanguage().isAr;
|
|
69
|
+
var dispatch = useAppDispatch();
|
|
70
|
+
var t = useTranslation().t;
|
|
71
|
+
var methods = useForm({
|
|
72
|
+
resolver: yupResolver(NIDValidationSchema),
|
|
73
|
+
defaultValues: {
|
|
74
|
+
nid: '',
|
|
75
|
+
dob: ''
|
|
76
|
+
},
|
|
77
|
+
mode: 'onChange'
|
|
78
|
+
});
|
|
79
|
+
var onSubmit = function (data) {
|
|
80
|
+
console.log('data', data);
|
|
81
|
+
dispatch(handleNextScreenStep());
|
|
82
|
+
};
|
|
83
|
+
return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ID, {}), _jsx(DOB, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
|
|
84
|
+
};
|
|
85
|
+
export default React.memo(IDBOD);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const NIDValidationSchema: 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
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface OTPProps {
|
|
3
|
+
idNumber?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: React.MemoExoticComponent<{
|
|
6
|
+
({ idNumber }: OTPProps): JSX.Element;
|
|
7
|
+
defaultProps: {
|
|
8
|
+
idNumber: string;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,112 @@
|
|
|
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 Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import Text from '../../../../components/Text';
|
|
18
|
+
import OTPTimer from './OTPTimer';
|
|
19
|
+
import Icon from '../../../../components/Icon';
|
|
20
|
+
import Button from '../../../../components/Button';
|
|
21
|
+
import Loader from '../../../../components/Loader';
|
|
22
|
+
import { ICONS_NAMES } from '../../../../constants/assets';
|
|
23
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
24
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
26
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
27
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
28
|
+
import Form from '../../../../components/Form';
|
|
29
|
+
import { maskID } from '../../../../utils';
|
|
30
|
+
import { OTPValidation } from './validation';
|
|
31
|
+
import OTPInput from './OTPInput';
|
|
32
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
direction: theme.direction
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
42
|
+
var _b;
|
|
43
|
+
var theme = _a.theme;
|
|
44
|
+
return (_b = {
|
|
45
|
+
background: theme.palette.common.white,
|
|
46
|
+
border: '1px solid',
|
|
47
|
+
borderColor: theme.palette.divider,
|
|
48
|
+
direction: theme.direction,
|
|
49
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25)
|
|
50
|
+
},
|
|
51
|
+
_b[theme.breakpoints.up('sm')] = {
|
|
52
|
+
marginBottom: theme.spacing(6)
|
|
53
|
+
},
|
|
54
|
+
_b);
|
|
55
|
+
});
|
|
56
|
+
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
|
|
59
|
+
});
|
|
60
|
+
var LoaderStyled = styled(Loader)(function (_a) {
|
|
61
|
+
var theme = _a.theme;
|
|
62
|
+
return ({
|
|
63
|
+
marginInlineStart: theme.spacing(-6.25),
|
|
64
|
+
'& .loader-box-container': {
|
|
65
|
+
marginInlineStart: theme.spacing(2.5)
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexDirection: 'column'
|
|
72
|
+
}); });
|
|
73
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
74
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
75
|
+
return ({
|
|
76
|
+
width: theme.spacing(3),
|
|
77
|
+
height: theme.spacing(3),
|
|
78
|
+
paddingInlineStart: theme.spacing(1.5),
|
|
79
|
+
paddingInlineEnd: theme.spacing(0.5),
|
|
80
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var ButtonContainer = styled(Box)(function (_a) {
|
|
84
|
+
var theme = _a.theme;
|
|
85
|
+
return ({
|
|
86
|
+
margin: theme.spacing(2.5)
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
var OTP = function (_a) {
|
|
90
|
+
var idNumber = _a.idNumber;
|
|
91
|
+
var dispatch = useAppDispatch();
|
|
92
|
+
var methods = useForm({
|
|
93
|
+
resolver: yupResolver(OTPValidation),
|
|
94
|
+
defaultValues: {
|
|
95
|
+
otp: ''
|
|
96
|
+
},
|
|
97
|
+
mode: 'onChange'
|
|
98
|
+
});
|
|
99
|
+
var t = useTranslation().t;
|
|
100
|
+
var isAr = useLanguage().isAr;
|
|
101
|
+
var onSubmit = function (data) {
|
|
102
|
+
console.log('data', data);
|
|
103
|
+
if (data.otp === '123456')
|
|
104
|
+
return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
105
|
+
dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
106
|
+
};
|
|
107
|
+
return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('opt_nid_sent_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
|
|
108
|
+
};
|
|
109
|
+
OTP.defaultProps = {
|
|
110
|
+
idNumber: '1234567891'
|
|
111
|
+
};
|
|
112
|
+
export default React.memo(OTP);
|
|
@@ -0,0 +1,51 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import OTPField from '../../../../components/OTPField';
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return ({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'column'
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
var OTPStyled = styled(OTPField)(function (_a) {
|
|
26
|
+
var _b;
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return (_b = {
|
|
29
|
+
marginInlineStart: theme.spacing(2.0),
|
|
30
|
+
input: {
|
|
31
|
+
width: "".concat(theme.spacing(3.75), " !important")
|
|
32
|
+
},
|
|
33
|
+
'& :focus': {
|
|
34
|
+
borderColor: theme.palette.primary.main
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
_b[theme.breakpoints.down('sm')] = {
|
|
38
|
+
marginInlineStart: theme.spacing(3)
|
|
39
|
+
},
|
|
40
|
+
_b);
|
|
41
|
+
});
|
|
42
|
+
var OTPInput = function (_a) {
|
|
43
|
+
var control = useFormContext().control;
|
|
44
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
45
|
+
var handleOnOTPChange = function (otp) {
|
|
46
|
+
otpControl.field.onChange(otp);
|
|
47
|
+
};
|
|
48
|
+
var otpValue = otpControl.field.value;
|
|
49
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
50
|
+
};
|
|
51
|
+
export default React.memo(OTPInput);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Box from '@mui/material/Box/Box';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import OTPTimer from '../../../../components/OTPTimer';
|
|
7
|
+
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
8
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
9
|
+
var theme = _a.theme;
|
|
10
|
+
return ({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
padding: theme.spacing(2.5, 0, 6.5, 0)
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
var Timer = function (_a) {
|
|
17
|
+
var t = useTranslation().t;
|
|
18
|
+
return (_jsx(BoxStyled, { children: _jsx(OTPTimer, { timeEndLabel: t('resend_otp'), timeInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { } }) }));
|
|
19
|
+
};
|
|
20
|
+
export default React.memo(Timer);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var Success = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
var onSuccess = function () {
|
|
8
|
+
console.log('success');
|
|
9
|
+
alert('Account created successfully, please check your email');
|
|
10
|
+
alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
|
|
11
|
+
window.location.href = '/new/business';
|
|
12
|
+
};
|
|
13
|
+
return _jsx(SuccessScreen, { title: t('success_message'), onSuccess: onSuccess });
|
|
14
|
+
};
|
|
15
|
+
export default React.memo(Success);
|
|
@@ -0,0 +1,68 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import OTPField from '../../../../components/OTPField';
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import { useForm, FormProvider, useController, useFormContext } from 'react-hook-form';
|
|
18
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
|
+
import { OTPValidation } from './validation';
|
|
20
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
21
|
+
var _b;
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return (_b = {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
direction: theme.direction
|
|
27
|
+
},
|
|
28
|
+
_b[theme.breakpoints.down('sm')] = {
|
|
29
|
+
paddingTop: theme.spacing(2.5)
|
|
30
|
+
},
|
|
31
|
+
_b);
|
|
32
|
+
});
|
|
33
|
+
var OTPStyled = styled(OTPField)(function (_a) {
|
|
34
|
+
var _b;
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return (_b = {
|
|
37
|
+
marginInlineStart: theme.spacing(2.0),
|
|
38
|
+
input: {
|
|
39
|
+
width: "".concat(theme.spacing(3.75), " !important")
|
|
40
|
+
},
|
|
41
|
+
'& :focus': {
|
|
42
|
+
borderColor: theme.palette.primary.main
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
_b[theme.breakpoints.down('sm')] = {
|
|
46
|
+
marginInlineStart: theme.spacing(3)
|
|
47
|
+
},
|
|
48
|
+
_b);
|
|
49
|
+
});
|
|
50
|
+
var OTPInput = function (_a) {
|
|
51
|
+
var onOTPChange = _a.onOTPChange;
|
|
52
|
+
var methods = useForm({
|
|
53
|
+
resolver: yupResolver(OTPValidation),
|
|
54
|
+
defaultValues: {
|
|
55
|
+
otp: ''
|
|
56
|
+
},
|
|
57
|
+
mode: 'onChange'
|
|
58
|
+
});
|
|
59
|
+
var control = useFormContext().control;
|
|
60
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
61
|
+
var handleOnOTPChange = function (otp) {
|
|
62
|
+
otpControl.field.onChange(otp);
|
|
63
|
+
onOTPChange === null || onOTPChange === void 0 ? void 0 : onOTPChange(otp);
|
|
64
|
+
};
|
|
65
|
+
var otpValue = otpControl.field.value;
|
|
66
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })) })));
|
|
67
|
+
};
|
|
68
|
+
export default React.memo(OTPInput);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Box from '@mui/material/Box/Box';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import OTPTimer from '../../../../components/OTPTimer';
|
|
7
|
+
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
8
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
9
|
+
var theme = _a.theme;
|
|
10
|
+
return ({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
padding: theme.spacing(2.5, 0, 3.75, 0)
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
var Timer = function (_a) {
|
|
17
|
+
var t = useTranslation().t;
|
|
18
|
+
return (_jsx(BoxStyled, { children: _jsx(OTPTimer, { timeEndLabel: t('resend_otp'), timeInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { } }) }));
|
|
19
|
+
};
|
|
20
|
+
export default React.memo(Timer);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface OTPProps {
|
|
3
|
+
phone?: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.MemoExoticComponent<{
|
|
7
|
+
({ phone, code }: OTPProps): JSX.Element;
|
|
8
|
+
defaultProps: {
|
|
9
|
+
phone: string;
|
|
10
|
+
code: string;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|