@tap-payments/auth-jsconnect 2.8.65-development → 2.8.68-development

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.
Files changed (102) hide show
  1. package/build/@types/form.d.ts +1 -1
  2. package/build/api/auth.d.ts +13 -0
  3. package/build/api/index.d.ts +2 -2
  4. package/build/api/lead.d.ts +6 -0
  5. package/build/assets/locales/ar.json +10 -1
  6. package/build/assets/locales/en.json +10 -1
  7. package/build/constants/app.d.ts +1 -0
  8. package/build/constants/app.js +35 -12
  9. package/build/constants/assets.d.ts +2 -0
  10. package/build/constants/assets.js +2 -0
  11. package/build/features/app/auth/authStore.d.ts +5 -15
  12. package/build/features/app/auth/authStore.js +58 -113
  13. package/build/features/app/business/businessStore.d.ts +16 -11
  14. package/build/features/app/business/businessStore.js +58 -44
  15. package/build/features/app/connect/connectStore.d.ts +19 -12
  16. package/build/features/app/connect/connectStore.js +151 -82
  17. package/build/features/app/connectExpress/connectExpressStore.d.ts +10 -33
  18. package/build/features/app/connectExpress/connectExpressStore.js +156 -251
  19. package/build/features/app/individual/individualStore.js +4 -1
  20. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
  21. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  22. package/build/features/auth/screens/NID/NID.js +4 -10
  23. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  24. package/build/features/auth/screens/NID/validation.js +0 -1
  25. package/build/features/auth/screens/OTP/OTP.js +1 -5
  26. package/build/features/auth/screens/OTP/OTPInput.js +2 -13
  27. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → auth/screens/VerifyNafath/VerifyNafath.d.ts} +2 -2
  28. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +34 -0
  29. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  30. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  31. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  32. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +34 -0
  33. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  34. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  35. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  36. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  37. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  38. package/build/features/connect/screens/NID/NID.js +5 -11
  39. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  40. package/build/features/connect/screens/NID/validation.js +0 -1
  41. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  42. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  43. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +34 -0
  44. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  45. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  46. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  47. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +34 -0
  48. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  49. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  50. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
  51. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  52. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  53. package/build/features/connectExpress/screens/NID/NID.js +4 -9
  54. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  55. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  56. package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
  57. package/build/features/connectExpress/screens/OTP/OTP.js +5 -13
  58. package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -11
  59. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  60. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +34 -0
  61. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  62. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  63. package/build/features/featuresScreens.js +21 -6
  64. package/build/features/shared/Button/NafathButton.d.ts +7 -0
  65. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +13 -3
  66. package/build/features/shared/Button/index.d.ts +2 -2
  67. package/build/features/shared/Button/index.js +2 -2
  68. package/build/features/shared/NafathVerification/NafathVerification.d.ts +13 -0
  69. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  70. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  71. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  72. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  73. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  74. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  75. package/build/features/shared/NafathVerification/index.js +2 -0
  76. package/build/hooks/useAppTheme.js +4 -3
  77. package/build/theme/palette.js +2 -1
  78. package/build/theme/theme.d.ts +1 -1
  79. package/build/theme/theme.js +2 -2
  80. package/package.json +1 -1
  81. package/build/features/auth/screens/NID/DOB.d.ts +0 -6
  82. package/build/features/auth/screens/NID/DOB.js +0 -47
  83. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  84. package/build/features/business/screens/OTP/OTP.js +0 -90
  85. package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
  86. package/build/features/business/screens/OTP/OTPInput.js +0 -49
  87. package/build/features/business/screens/OTP/index.d.ts +0 -3
  88. package/build/features/business/screens/OTP/index.js +0 -2
  89. package/build/features/business/screens/OTP/validation.d.ts +0 -8
  90. package/build/features/business/screens/OTP/validation.js +0 -4
  91. package/build/features/connect/screens/NID/DOB.d.ts +0 -5
  92. package/build/features/connect/screens/NID/DOB.js +0 -47
  93. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -88
  94. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  95. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -56
  96. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  97. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  98. package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +0 -8
  99. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  100. package/build/features/connectExpress/screens/NID/DOB.d.ts +0 -6
  101. package/build/features/connectExpress/screens/NID/DOB.js +0 -47
  102. package/build/features/shared/Button/AbsherButton.d.ts +0 -7
@@ -1,11 +1,8 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const NIDValidationSchema: (isLeadIdPassed: boolean) => 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
3
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
4
  }>, 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
5
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
6
  }>>, 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
7
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
8
  }>>>;
@@ -2,7 +2,6 @@ import * as yup from 'yup';
2
2
  export var NIDValidationSchema = function (isLeadIdPassed) {
3
3
  if (isLeadIdPassed) {
4
4
  return yup.object().shape({
5
- dob: yup.string().min(5).required('enter_valid_birth_date'),
6
5
  termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
7
6
  nid: yup
8
7
  .string()
@@ -12,7 +11,6 @@ export var NIDValidationSchema = function (isLeadIdPassed) {
12
11
  });
13
12
  }
14
13
  return yup.object().shape({
15
- dob: yup.string().min(5).required('enter_valid_birth_date'),
16
14
  nid: yup
17
15
  .string()
18
16
  .matches(/^(1|2)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { NIDOtherCountryValidationSchema, NIDValidationSchema } from './validation';
19
19
  import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
20
20
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
- import { clearError, connectExpressSelector, createNIDAuthIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
21
+ import { clearError, connectExpressSelector, createNIDNafathAuthIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
22
22
  import Form from '../../../../components/Form';
23
23
  import Button from '../../../shared/Button';
24
24
  import { ScreenContainer } from '../../../shared/Containers';
@@ -48,7 +48,7 @@ var NID = function (_a) {
48
48
  dispatch(clearError());
49
49
  }, [methods.formState.isValid]);
50
50
  var onSubmit = function (data) {
51
- dispatch(createNIDAuthIdentityAsync(deepCopy(data)));
51
+ dispatch(createNIDNafathAuthIdentityAsync(deepCopy(data)));
52
52
  };
53
53
  var handleCollapseOpenClose = function (flag) {
54
54
  setCollapse(flag);
@@ -15,17 +15,16 @@ import { styled } from '@mui/material/styles';
15
15
  import * as React from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import Text from '../../../../components/Text';
18
- import { clearError, connectExpressSelector, verifyMobileOtpAsync, verifyNIDOtpAsync, resetOTPValue } from '../../../app/connectExpress/connectExpressStore';
18
+ import { clearError, connectExpressSelector, verifyMobileOtpAsync, resetOTPValue } from '../../../app/connectExpress/connectExpressStore';
19
19
  import Button from '../../../shared/Button';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  import { handlePrevScreenStep } from '../../../../app/settings';
23
23
  import { useLanguage } from '../../../../hooks';
24
- import { AuthForType } from '../../../../@types';
25
24
  import { useForm, FormProvider } from 'react-hook-form';
26
25
  import { yupResolver } from '@hookform/resolvers/yup';
27
26
  import Form from '../../../../components/Form';
28
- import { maskPhone, maskID, deepCopy, sendCustomEventToGTM } from '../../../../utils';
27
+ import { maskPhone, deepCopy, sendCustomEventToGTM } from '../../../../utils';
29
28
  import { OTPValidation } from './validation';
30
29
  import OTPInput from './OTPInput';
31
30
  var OTPTitleContainerStyled = styled(Box)(function (_a) {
@@ -58,7 +57,6 @@ var OTP = function () {
58
57
  defaultValues: data.otpData,
59
58
  mode: 'onChange'
60
59
  });
61
- var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
62
60
  React.useEffect(function () {
63
61
  if (error)
64
62
  dispatch(clearError());
@@ -74,20 +72,14 @@ var OTP = function () {
74
72
  };
75
73
  }, []);
76
74
  var onSubmit = function (formData) {
77
- if (isNidAuth) {
78
- dispatch(verifyNIDOtpAsync(deepCopy(formData)));
79
- return;
80
- }
81
75
  dispatch(verifyMobileOtpAsync(deepCopy(formData)));
82
76
  };
83
77
  var onBack = function () {
84
- var screen = isNidAuth ? 'CONNECT_EXPRESS_NID_STEP' : 'CONNECT_EXPRESS_MOBILE_STEP';
85
- dispatch(handlePrevScreenStep(screen));
78
+ dispatch(handlePrevScreenStep());
86
79
  };
87
80
  var disabled = !methods.formState.isValid;
88
81
  var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
89
- var idNumber = data.nidData.nid;
90
- var title = isNidAuth ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
91
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: isNidAuth ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
82
+ var title = t('ide_opt_sent_title');
83
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
92
84
  };
93
85
  export default React.memo(OTP);
@@ -17,8 +17,7 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { AuthForType } from '../../../../@types';
21
- import { resendMobileAuthOTP, resendNIDAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
20
+ import { resendMobileAuthOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
22
  import { sendCustomEventToGTM } from '../../../../utils';
24
23
  var BoxStyled = styled(Box)(function (_a) {
@@ -35,8 +34,7 @@ var OTPInput = function (_a) {
35
34
  var dispatch = useAppDispatch();
36
35
  var otpControl = useController({ name: 'otp', control: control });
37
36
  var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
38
- var mobileData = data.mobileData, nidData = data.nidData;
39
- var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
37
+ var mobileData = data.mobileData;
40
38
  var sendEventAskAnotherOTP = function () {
41
39
  sendCustomEventToGTM({
42
40
  event: 'Send Event',
@@ -55,13 +53,7 @@ var OTPInput = function (_a) {
55
53
  sendEventAskAnotherOTP();
56
54
  dispatch(resendMobileAuthOTP(mobileData));
57
55
  };
58
- var handleOnResendAbsherOTP = function () {
59
- if (otpControl.field.value)
60
- setValue('otp', '', { shouldValidate: true });
61
- sendEventAskAnotherOTP();
62
- dispatch(resendNIDAuthOTP(nidData));
63
- };
64
56
  var otpValue = otpControl.field.value;
65
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: isNidAuth ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
57
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
66
58
  };
67
59
  export default React.memo(OTPInput);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface VerifyNafathProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
5
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectExpress/connectExpressStore';
4
+ import NafathVerification from '../../../shared/NafathVerification';
5
+ import { handlePrevScreenStep } from '../../../../app/settings';
6
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
+ var VerifyNafath = function () {
8
+ var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
+ var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
10
+ var dispatch = useAppDispatch();
11
+ var data = useAppSelector(connectExpressSelector).data;
12
+ var authData = (data.responseData || {}).authData;
13
+ var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
14
+ React.useEffect(function () {
15
+ if (authData && !isReady) {
16
+ setIsReady(true);
17
+ }
18
+ }, [authData]);
19
+ React.useEffect(function () {
20
+ if (!isReady)
21
+ return;
22
+ var promise = dispatch(verifyNafathAsync({ onSuccess: function () { return setSuccess(true); } }));
23
+ return function () {
24
+ promise === null || promise === void 0 ? void 0 : promise.abort();
25
+ };
26
+ }, [isReady]);
27
+ var onBack = React.useCallback(function () {
28
+ dispatch(handlePrevScreenStep());
29
+ }, []);
30
+ if (!isReady)
31
+ return null;
32
+ return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
+ };
34
+ export default React.memo(VerifyNafath);
@@ -0,0 +1,3 @@
1
+ import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
+ export type { VerifyNafathProps };
3
+ export default VerifyNafath;
@@ -0,0 +1,2 @@
1
+ import VerifyNafath from './VerifyNafath';
2
+ export default VerifyNafath;
@@ -3,6 +3,7 @@ import MobileScreen from './connect/screens/Mobile';
3
3
  import NIDScreen from './connect/screens/NID';
4
4
  import ConnectCivilIDScreen from '../features/connect/screens/CivilID';
5
5
  import ConnectVerifyPACIScreen from './connect/screens/VerifyPACI';
6
+ import ConnectVerifyNafathScreen from './connect/screens/VerifyNafath';
6
7
  import IndividualScreen from './connect/screens/Individual';
7
8
  import MerchantInfoScreen from './connect/screens/Merchant';
8
9
  import BrandSegmentInfoScreen from './connect/screens/BrandSegment';
@@ -12,13 +13,14 @@ import OperatorError from './connect/screens/OperatorError';
12
13
  import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
13
14
  import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
14
15
  import ConnectExpressNIDScreen from './connectExpress/screens/NID';
16
+ import ConnectExpressVerifyNafathScreen from './connectExpress/screens/VerifyNafath';
15
17
  import ConnectExpressCivilIDScreen from './connectExpress/screens/CivilID';
16
18
  import ConnectExpressVerifyPACIScreen from './connectExpress/screens/VerifyPACI';
17
19
  import ConnectExpressOTPScreen from './connectExpress/screens/OTP';
18
20
  import ConnectExpressNIDMissedScreen from './connectExpress/screens/NIDMissed';
19
21
  import ConnectExpressCivilIDMissedScreen from './connectExpress/screens/CivilIDMissed';
20
22
  import ConnectExpressIdentityVerifyPACIScreen from './connectExpress/screens/IdentityVerifyPACI';
21
- import ConnectExpressIdentityVerifyOTPScreen from './connectExpress/screens/IdentityOTP';
23
+ import ConnectExpressIdentityVerifyNafathScreen from './connectExpress/screens/IdentityVerifyNafath';
22
24
  import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
23
25
  import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
24
26
  import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
@@ -36,6 +38,7 @@ import AuthNIDScreen from './auth/screens/NID';
36
38
  import AuthEmailScreen from './auth/screens/Email';
37
39
  import AuthCivilIDScreen from './auth/screens/CivilID';
38
40
  import AuthVerifyPACIScreen from './auth/screens/VerifyPACI';
41
+ import AuthVerifyNafathScreen from './auth/screens/VerifyNafath';
39
42
  import AuthOTPScreen from './auth/screens/OTP';
40
43
  import AuthPasswordScreen from './auth/screens/Password';
41
44
  import AuthResetPasswordMessageScreen from './auth/screens/ResetPasswordMessage';
@@ -50,7 +53,7 @@ import AuthOperatorError from './auth/screens/OperatorError';
50
53
  import CustomersPage from './business/screens/Customers';
51
54
  import IDBODPage from './business/screens/IDBOD';
52
55
  import BusinessVerifyPage from './business/screens/Verify';
53
- import BusinessOTPPage from './business/screens/OTP';
56
+ import BusinessVerifyNafathPage from './business/screens/VerifyNafath';
54
57
  import BusinessTypePage from './business/screens/BusinessType';
55
58
  import ActivitiesPage from './business/screens/Activities';
56
59
  import SuccessPage from './business/screens/Success';
@@ -143,6 +146,10 @@ export var connectFeatureScreens = [
143
146
  name: 'CONNECT_VERIFY_PACI_STEP',
144
147
  element: ConnectVerifyPACIScreen
145
148
  },
149
+ {
150
+ name: 'CONNECT_VERIFY_NAFATH_STEP',
151
+ element: ConnectVerifyNafathScreen
152
+ },
146
153
  {
147
154
  name: 'CONNECT_INDIVIDUAL_STEP',
148
155
  element: IndividualScreen
@@ -185,6 +192,10 @@ export var connectExpressFeatureScreens = [
185
192
  name: 'CONNECT_EXPRESS_OTP_STEP',
186
193
  element: ConnectExpressOTPScreen
187
194
  },
195
+ {
196
+ name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
197
+ element: ConnectExpressVerifyNafathScreen
198
+ },
188
199
  {
189
200
  name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
190
201
  element: ConnectExpressVerifyPACIScreen
@@ -202,8 +213,8 @@ export var connectExpressFeatureScreens = [
202
213
  element: ConnectExpressIdentityVerifyPACIScreen
203
214
  },
204
215
  {
205
- name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
206
- element: ConnectExpressIdentityVerifyOTPScreen
216
+ name: 'CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP',
217
+ element: ConnectExpressIdentityVerifyNafathScreen
207
218
  },
208
219
  {
209
220
  name: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
@@ -287,6 +298,10 @@ export var authFeatureScreens = [
287
298
  name: 'AUTH_VERIFY_PACI_STEP',
288
299
  element: AuthVerifyPACIScreen
289
300
  },
301
+ {
302
+ name: 'AUTH_NAFATH_VERIFY_STEP',
303
+ element: AuthVerifyNafathScreen
304
+ },
290
305
  {
291
306
  name: 'AUTH_ACCOUNT_NOT_FOUND_STEP',
292
307
  element: AccountNotFoundScreen
@@ -338,8 +353,8 @@ export var businessFeatureScreens = [
338
353
  element: BusVerifyPACIScreen
339
354
  },
340
355
  {
341
- name: 'BUSINESS_OTP_STEP',
342
- element: BusinessOTPPage
356
+ name: 'BUSINESS_VERIFY_NAFATH_STEP',
357
+ element: BusinessVerifyNafathPage
343
358
  },
344
359
  {
345
360
  name: 'BUSINESS_BUSINESS_TYPE_STEP',
@@ -0,0 +1,7 @@
1
+ import { ButtonProps } from '../../../components/Button';
2
+ interface NafathButtonProps extends ButtonProps {
3
+ loading?: boolean;
4
+ hideIcon?: boolean;
5
+ }
6
+ export default function NafathButton({ children, hideIcon, disabled, ...props }: NafathButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -28,7 +28,7 @@ import Box from '@mui/material/Box';
28
28
  import { ICONS_NAMES } from '../../../constants';
29
29
  var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
30
30
  var theme = _a.theme, disabled = _a.disabled;
31
- return (__assign({ width: theme.spacing(3), height: theme.spacing(3), marginInlineStart: theme.spacing(0.75) }, (disabled && {
31
+ return (__assign({ width: theme.spacing(3), height: theme.spacing(3) }, (disabled && {
32
32
  opacity: 0.3
33
33
  })));
34
34
  });
@@ -38,9 +38,19 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
38
38
  margin: theme.spacing(0, 2.5, 2.5, 2.5)
39
39
  });
40
40
  });
41
- export default function AbsherButton(_a) {
41
+ var ButtonStyled = styled(Button)(function (_a) {
42
+ var theme = _a.theme;
43
+ return ({
44
+ paddingInlineStart: theme.spacing(1.75),
45
+ fontWeight: theme.typography.fontWeightRegular,
46
+ '& .MuiButton-startIcon': {
47
+ margin: theme.spacing(0)
48
+ }
49
+ });
50
+ });
51
+ export default function NafathButton(_a) {
42
52
  var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
43
53
  var theme = useTheme();
44
54
  var btnColor = theme.palette.primary.light;
45
- return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
55
+ return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.NAFATH_LOGO }) }, props, { children: children })) }));
46
56
  }
@@ -1,9 +1,9 @@
1
1
  import Button from './Button';
2
- import AbsherButton from './AbsherButton';
2
+ import NafathButton from './NafathButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
7
  import ListButton from './IndividualActionButtons';
8
- export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
8
+ export { NafathButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -1,9 +1,9 @@
1
1
  import Button from './Button';
2
- import AbsherButton from './AbsherButton';
2
+ import NafathButton from './NafathButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
7
  import ListButton from './IndividualActionButtons';
8
- export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
8
+ export { NafathButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface VerifyNafathProps {
3
+ randomNumber: string;
4
+ success: boolean;
5
+ expiryInSeconds: number;
6
+ urls?: {
7
+ android: string;
8
+ ios: string;
9
+ };
10
+ onFinish?: () => void;
11
+ }
12
+ declare const _default: React.MemoExoticComponent<({ randomNumber, success, expiryInSeconds, urls, onFinish }: VerifyNafathProps) => import("react/jsx-runtime").JSX.Element>;
13
+ export default _default;
@@ -0,0 +1,92 @@
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import { useTranslation } from 'react-i18next';
17
+ import Text from '../../../components/Text';
18
+ import { ScreenContainer } from '../../shared/Containers';
19
+ import { MobileButton } from '../../shared/Button';
20
+ import { mobileOS } from '../../../utils';
21
+ import { useCountUp } from '../../../hooks';
22
+ import VerifyNafathLoading from './VerifyNafathLoading';
23
+ import VerifyNafathSuccess from './VerifyNafathSuccess';
24
+ var VerifyNafathTitleContainerStyled = styled(Box)(function (_a) {
25
+ var theme = _a.theme;
26
+ return ({
27
+ direction: theme.direction,
28
+ display: 'flex',
29
+ flexDirection: 'column',
30
+ alignItems: 'center',
31
+ marginBottom: theme.spacing(2.5)
32
+ });
33
+ });
34
+ var VerifyNafathTitleStyled = styled(Text)(function (_a) {
35
+ var theme = _a.theme;
36
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBottom: theme.spacing(2.4), lineHeight: '19.2px' }));
37
+ });
38
+ var VerifyNafathSubTitleStyled = styled(Text)(function (_a) {
39
+ var theme = _a.theme;
40
+ return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center', marginLeft: theme.spacing(3), marginRight: theme.spacing(3) }));
41
+ });
42
+ var Container = styled(Box)(function (_a) {
43
+ var theme = _a.theme;
44
+ return ({
45
+ position: 'relative',
46
+ display: 'flex',
47
+ justifyContent: 'center',
48
+ alignItems: 'center',
49
+ maxHeight: '300px',
50
+ marginBottom: theme.spacing(3.25)
51
+ });
52
+ });
53
+ var VerifyNafath = function (_a) {
54
+ var randomNumber = _a.randomNumber, success = _a.success, expiryInSeconds = _a.expiryInSeconds, urls = _a.urls, onFinish = _a.onFinish;
55
+ var t = useTranslation().t;
56
+ var count = useCountUp({ start: 0, end: expiryInSeconds, sleepMS: 1000 }).count;
57
+ var errorWaitingTime = 3;
58
+ var phases = 2;
59
+ var remainingTime = expiryInSeconds - errorWaitingTime;
60
+ var phaseNumber = Math.floor((count / remainingTime) * phases) + 1;
61
+ var isEnded = count === expiryInSeconds;
62
+ var endPhaseStarted = count >= remainingTime;
63
+ console.log('VerifyNafath', VerifyNafath);
64
+ React.useEffect(function () {
65
+ if (isEnded && onFinish)
66
+ onFinish();
67
+ }, [isEnded]);
68
+ var onRedirect = React.useCallback(function () {
69
+ if (os === 'Android') {
70
+ window.open(urls === null || urls === void 0 ? void 0 : urls.android, '_blank');
71
+ }
72
+ if (os === 'iOS') {
73
+ window.open(urls === null || urls === void 0 ? void 0 : urls.ios, '_blank');
74
+ }
75
+ }, [urls]);
76
+ var os = React.useMemo(function () { return mobileOS(); }, []);
77
+ var isAndroid = React.useMemo(function () { return os === 'Android' && (urls === null || urls === void 0 ? void 0 : urls.android); }, [os, urls]);
78
+ var isIOS = React.useMemo(function () { return os === 'iOS' && (urls === null || urls === void 0 ? void 0 : urls.ios); }, [os, urls]);
79
+ var title = React.useMemo(function () {
80
+ if (phaseNumber === 1)
81
+ return 'nafath_verification_title_wait';
82
+ return 'nafath_verification_title_check';
83
+ }, [phaseNumber]);
84
+ var description = React.useMemo(function () {
85
+ if (phaseNumber === 1)
86
+ return 'nafath_verification_description_wait';
87
+ return 'nafath_verification_description_check';
88
+ }, [phaseNumber]);
89
+ var isErrorPhase = endPhaseStarted && !success;
90
+ return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyNafathTitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyNafathSuccess, {}) : _jsx(VerifyNafathLoading, { randomNumber: randomNumber, type: isErrorPhase ? 3 : phaseNumber }) }), isErrorPhase ? (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t('nafath_verification_title_error') }), _jsx(VerifyNafathSubTitleStyled, __assign({ sx: { pb: 1 } }, { children: t('nafath_verification_description_error') })), _jsx(VerifyNafathSubTitleStyled, { children: t('nafath_verification_redirection_message') })] })) : (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t(title) }), _jsx(VerifyNafathSubTitleStyled, { children: t(description) })] }))] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('open_nafath_app') })))] })));
91
+ };
92
+ export default React.memo(VerifyNafath);
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface VerifyNafathLoadingProps {
3
+ loop?: boolean;
4
+ type: number;
5
+ randomNumber: string;
6
+ }
7
+ declare const _default: React.NamedExoticComponent<VerifyNafathLoadingProps>;
8
+ export default _default;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { styled } from '@mui/material/styles';
4
+ import LottieFile, { LottieAnimationFiles } from '../../../components/Lottie';
5
+ import Icon from '../../../components/Icon';
6
+ import { ICONS_NAMES } from '../../../constants';
7
+ import Text from '../../../components/Text';
8
+ import Box from '@mui/material/Box';
9
+ var IconStyled = styled(Icon)(function (_a) {
10
+ var theme = _a.theme;
11
+ return ({
12
+ position: 'absolute',
13
+ top: '50%',
14
+ left: '50%',
15
+ transform: 'translate(-50%, -50%)',
16
+ width: theme.spacing(10),
17
+ height: theme.spacing(10)
18
+ });
19
+ });
20
+ var NumberBoxStyled = styled(Box)(function (_a) {
21
+ var theme = _a.theme;
22
+ return ({
23
+ position: 'absolute',
24
+ top: '92%',
25
+ left: '50%',
26
+ transform: 'translate(-59%, -59%)',
27
+ width: 59,
28
+ height: 59,
29
+ background: theme.palette.primary.contrastText,
30
+ display: 'flex',
31
+ justifyContent: 'center',
32
+ alignItems: 'center',
33
+ borderRadius: '100%'
34
+ });
35
+ });
36
+ var NumberStyled = styled(Text)(function (_a) {
37
+ var theme = _a.theme;
38
+ return ({
39
+ fontWeight: theme.typography.fontWeightMedium,
40
+ fontSize: '26.47px',
41
+ lineHeight: '31.77px'
42
+ });
43
+ });
44
+ var VerifyNafathLoading = function (_a) {
45
+ var _b = _a.loop, loop = _b === void 0 ? true : _b, type = _a.type, randomNumber = _a.randomNumber;
46
+ if (type === 1)
47
+ return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.NAFATH_VERIFY_ICON }), _jsx(NumberBoxStyled, { children: _jsx(NumberStyled, { children: randomNumber }) })] }));
48
+ if (type === 2)
49
+ return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.NAFATH_VERIFY_ICON }), _jsx(NumberBoxStyled, { children: _jsx(NumberStyled, { children: randomNumber }) })] }));
50
+ return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.error, loop: false, width: '60%' }) }));
51
+ };
52
+ VerifyNafathLoading.defaultProps = {};
53
+ export default memo(VerifyNafathLoading);
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface VerifyPACISuccessProps {
3
+ }
4
+ declare const _default: React.NamedExoticComponent<VerifyPACISuccessProps>;
5
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import LottieFile, { LottieAnimationFiles } from '../../../components/Lottie';
4
+ var VerifyPACISuccess = function () {
5
+ return (_jsx(_Fragment, { children: _jsx(LottieFile, { loop: false, file: LottieAnimationFiles.success, width: '90%' }) }));
6
+ };
7
+ VerifyPACISuccess.defaultProps = {};
8
+ export default memo(VerifyPACISuccess);
@@ -0,0 +1,2 @@
1
+ import NafathVerification from './NafathVerification';
2
+ export default NafathVerification;
@@ -0,0 +1,2 @@
1
+ import NafathVerification from './NafathVerification';
2
+ export default NafathVerification;
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { LanguageMode, DirectionMode } from '../@types';
3
3
  import { settingsSelector } from '../app/settings';
4
- import { isMobile } from 'react-device-detect';
4
+ import { isMobile, isTablet } from 'react-device-detect';
5
5
  import { useAppSelector } from './useAppSelector';
6
6
  import { appTheme } from '../theme';
7
7
  export var useAppTheme = function () {
@@ -9,7 +9,8 @@ export var useAppTheme = function () {
9
9
  var data = useAppSelector(settingsSelector).data;
10
10
  useEffect(function () {
11
11
  var dir = data.language === LanguageMode.AR ? DirectionMode.RTL : DirectionMode.LTR;
12
- setTheme(appTheme(data.skin, isMobile, dir));
13
- }, [data.skin, data.language, isMobile]);
12
+ var isSmallScreen = isMobile && !isTablet;
13
+ setTheme(appTheme(data.skin, dir, isSmallScreen));
14
+ }, [data.skin, data.language, isMobile, isTablet]);
14
15
  return { theme: theme };
15
16
  };
@@ -4,7 +4,8 @@ export var lightPalette = {
4
4
  primary: {
5
5
  main: '#007aff',
6
6
  dark: '#9CA0A94D',
7
- light: '#0E9346'
7
+ light: '#0A9A8F',
8
+ contrastText: '#e2e0f8'
8
9
  },
9
10
  success: {
10
11
  light: '#2CCE01',
@@ -1,2 +1,2 @@
1
1
  import { DirectionMode, ThemeMode } from '../@types';
2
- export declare const appTheme: (mode: ThemeMode, isMobile: boolean, dir: DirectionMode) => import("@mui/material/styles").Theme;
2
+ export declare const appTheme: (mode: ThemeMode, dir: DirectionMode, isSmallScreen: boolean) => import("@mui/material/styles").Theme;
@@ -3,7 +3,7 @@ import { typography } from './typography';
3
3
  import { darkPalette, lightPalette } from './palette';
4
4
  import { components } from './components';
5
5
  import { shadows } from './shadows';
6
- export var appTheme = function (mode, isMobile, dir) {
6
+ export var appTheme = function (mode, dir, isSmallScreen) {
7
7
  return createTheme({
8
8
  palette: mode === 'dark' ? darkPalette : lightPalette,
9
9
  direction: dir,
@@ -11,7 +11,7 @@ export var appTheme = function (mode, isMobile, dir) {
11
11
  breakpoints: {
12
12
  values: {
13
13
  xs: 0,
14
- sm: isMobile ? 1536 : 600,
14
+ sm: isSmallScreen ? 1536 : 600,
15
15
  md: 900,
16
16
  lg: 1200,
17
17
  xl: 1536
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.65-development",
3
+ "version": "2.8.68-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -1,6 +0,0 @@
1
- interface DOBProps {
2
- onDateClicked?: (flag: boolean) => void;
3
- readOnly?: boolean;
4
- }
5
- declare const DOB: ({ onDateClicked, readOnly }: DOBProps) => import("react/jsx-runtime").JSX.Element;
6
- export default DOB;