@tap-payments/auth-jsconnect 1.0.36 → 1.0.40
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 +4 -4
- package/build/components/AnimationFlow/BottomSheet.js +26 -2
- package/build/components/OTPTimer/OTPTimer.js +4 -2
- package/build/constants/app.js +2 -2
- package/build/constants/dummy.d.ts +2 -2
- package/build/constants/dummy.js +6 -6
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/business/businessStore.d.ts +4 -6
- package/build/features/app/business/businessStore.js +43 -30
- package/build/features/app/connect/connectStore.d.ts +1 -1
- package/build/features/app/connect/connectStore.js +23 -15
- package/build/features/business/screens/Activities/Activities.js +10 -5
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.js +1 -12
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +16 -23
- package/build/features/business/screens/BusinessType/CompanyLicense.js +23 -9
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +23 -9
- package/build/features/business/screens/Confirm/Confirm.js +4 -3
- package/build/features/business/screens/Customers/Customers.js +1 -1
- package/build/features/business/screens/OTP/OTP.js +5 -2
- package/build/features/business/screens/OTP/OTPInput.js +1 -2
- package/build/features/business/screens/Verify/OTPInput.js +1 -2
- package/build/features/business/screens/Verify/Verify.js +7 -4
- package/build/features/connect/screens/Individual/Email.js +10 -1
- package/build/features/connect/screens/Individual/Individual.js +8 -10
- package/build/features/connect/screens/Individual/MobileNumber.js +3 -16
- package/build/features/connect/screens/Merchant/BrandName.js +6 -2
- package/build/features/connect/screens/Merchant/Merchant.js +11 -11
- package/build/features/connect/screens/Merchant/SocialMedia.js +2 -1
- package/build/features/connect/screens/Merchant/TAC.js +1 -1
- package/build/features/connect/screens/Merchant/validation.js +3 -2
- package/build/features/connect/screens/Mobile/BusinessCountry.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +1 -9
- package/build/features/connect/screens/Mobile/MobileNumber.js +3 -16
- package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +1 -6
- package/build/features/connect/screens/OTP/OTP.js +2 -4
- package/build/features/connect/screens/Password/Password.js +1 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +1 -1
- package/build/features/shared/Button/Button.js +13 -3
- package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useWindowSize.d.ts +6 -0
- package/build/hooks/useWindowSize.js +19 -0
- package/package.json +126 -126
- package/build/features/app/business/midStore.d.ts +0 -10
- package/build/features/app/business/midStore.js +0 -18
- package/build/features/app/connect/midStore.d.ts +0 -10
- package/build/features/app/connect/midStore.js +0 -18
- package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +0 -5
- package/build/features/business/screens/VerifyNumber/OTPInput.js +0 -39
- package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +0 -13
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +0 -76
- package/build/features/business/screens/VerifyNumber/index.d.ts +0 -3
- package/build/features/business/screens/VerifyNumber/index.js +0 -2
- package/build/features/business/screens/VerifyNumber/validation.d.ts +0 -8
- package/build/features/business/screens/VerifyNumber/validation.js +0 -4
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +0 -11
- package/build/features/connect/screens/MID/BusinessCountry.js +0 -92
- package/build/features/connect/screens/MID/DOB.d.ts +0 -6
- package/build/features/connect/screens/MID/DOB.js +0 -38
- package/build/features/connect/screens/MID/IDNumber.d.ts +0 -7
- package/build/features/connect/screens/MID/IDNumber.js +0 -70
- package/build/features/connect/screens/MID/MID.d.ts +0 -5
- package/build/features/connect/screens/MID/MID.js +0 -87
- package/build/features/connect/screens/MID/MIDTitle.d.ts +0 -8
- package/build/features/connect/screens/MID/MIDTitle.js +0 -29
- package/build/features/connect/screens/MID/MobileNumber.d.ts +0 -12
- package/build/features/connect/screens/MID/MobileNumber.js +0 -148
- package/build/features/connect/screens/MID/index.d.ts +0 -3
- package/build/features/connect/screens/MID/index.js +0 -2
- package/build/features/connect/screens/MID/validation.d.ts +0 -18
- package/build/features/connect/screens/MID/validation.js +0 -15
- package/build/features/owner/Owner.d.ts +0 -6
- package/build/features/owner/Owner.js +0 -50
- package/build/features/owner/index.d.ts +0 -1
- package/build/features/owner/index.js +0 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +0 -8
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +0 -77
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +0 -10
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +0 -80
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +0 -6
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +0 -40
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +0 -6
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +0 -45
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +0 -6
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +0 -35
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +0 -6
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +0 -45
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +0 -9
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +0 -85
- package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +0 -3
- package/build/features/owner/screens/AdditionalOwnerInfo/index.js +0 -2
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +0 -25
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +0 -35
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +0 -19
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +0 -52
- package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +0 -3
- package/build/features/owner/screens/ShowOwnerInfo/index.js +0 -2
- package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +0 -7
- package/build/features/owner/screens/ShowOwnerInfo/info.js +0 -28
- package/build/features/owner/screens/Success/Success.d.ts +0 -5
- package/build/features/owner/screens/Success/Success.js +0 -14
- package/build/features/owner/screens/Success/index.d.ts +0 -3
- package/build/features/owner/screens/Success/index.js +0 -2
- package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +0 -7
- package/build/features/shared/ExpandIcon/ExpandIcon.js +0 -24
- package/build/features/shared/ExpandIcon/index.d.ts +0 -2
- package/build/features/shared/ExpandIcon/index.js +0 -2
|
@@ -19,7 +19,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
19
19
|
import { NIDValidationSchema } from './validation';
|
|
20
20
|
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
21
21
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
22
|
-
import { clearError,
|
|
22
|
+
import { clearError, connectSelector, createNIDAuth } from '../../../app/connect/connectStore';
|
|
23
23
|
import Form from '../../../../components/Form';
|
|
24
24
|
import Button, { AbsherButton } from '../../../shared/Button';
|
|
25
25
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -73,11 +73,6 @@ var NID = function (_a) {
|
|
|
73
73
|
React.useEffect(function () {
|
|
74
74
|
handleClearError();
|
|
75
75
|
}, [methods.formState.isValid]);
|
|
76
|
-
React.useEffect(function () {
|
|
77
|
-
return function () {
|
|
78
|
-
dispatch(resetNIDScreen());
|
|
79
|
-
};
|
|
80
|
-
}, []);
|
|
81
76
|
var onSubmit = function (data) {
|
|
82
77
|
dispatch(createNIDAuth(__assign(__assign({}, data), { isResend: false })));
|
|
83
78
|
};
|
|
@@ -41,7 +41,7 @@ var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
|
41
41
|
});
|
|
42
42
|
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
43
43
|
var theme = _a.theme;
|
|
44
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75),
|
|
44
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
45
45
|
});
|
|
46
46
|
var FormStyled = styled(Form)(function () { return ({
|
|
47
47
|
display: 'flex',
|
|
@@ -62,12 +62,10 @@ var OTP = function () {
|
|
|
62
62
|
React.useEffect(function () {
|
|
63
63
|
if (error)
|
|
64
64
|
dispatch(clearError());
|
|
65
|
-
}, [methods.formState.isValid]);
|
|
66
|
-
React.useEffect(function () {
|
|
67
65
|
return function () {
|
|
68
66
|
dispatch(resetOTPScreen());
|
|
69
67
|
};
|
|
70
|
-
}, []);
|
|
68
|
+
}, [methods.formState.isValid]);
|
|
71
69
|
var onSubmit = function (formData) {
|
|
72
70
|
dispatch(verifyAuth(formData));
|
|
73
71
|
};
|
|
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
18
18
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
19
|
import { styled } from '@mui/material/styles';
|
|
20
20
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
-
import { clearError, connectSelector, createVerifyAuthPassword
|
|
21
|
+
import { clearError, connectSelector, createVerifyAuthPassword } from '../../../app/connect/connectStore';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button from '../../../shared/Button';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -46,11 +46,6 @@ var Password = function (_a) {
|
|
|
46
46
|
if (error)
|
|
47
47
|
dispatch(clearError());
|
|
48
48
|
}, [methods.formState.isValid]);
|
|
49
|
-
React.useEffect(function () {
|
|
50
|
-
return function () {
|
|
51
|
-
dispatch(resetPasswordScreen());
|
|
52
|
-
};
|
|
53
|
-
}, []);
|
|
54
49
|
var onSubmit = function (formData) {
|
|
55
50
|
dispatch(createVerifyAuthPassword(formData));
|
|
56
51
|
};
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -69,7 +69,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
69
69
|
};
|
|
70
70
|
var handleSelectSource = function (country) {
|
|
71
71
|
var _a;
|
|
72
|
-
if (((_a = country.
|
|
72
|
+
if (((_a = country.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary')
|
|
73
73
|
setEmployerFieldsActive(true);
|
|
74
74
|
else {
|
|
75
75
|
setEmployerFieldsActive(false);
|
|
@@ -81,7 +81,7 @@ var SourceOfIncome = function (_a) {
|
|
|
81
81
|
var source = sourceIncomeControl.field.value;
|
|
82
82
|
var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
83
83
|
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name : source === null || source === void 0 ? void 0 : source.nameEn) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
84
|
-
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.
|
|
84
|
+
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.titleAr : item === null || item === void 0 ? void 0 : item.title })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
|
|
85
85
|
} }) }))] })) })));
|
|
86
86
|
};
|
|
87
87
|
export default React.memo(SourceOfIncome);
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { Fragment } from 'react';
|
|
24
|
+
import React, { Fragment } from 'react';
|
|
25
25
|
import Button from '../../../components/Button';
|
|
26
26
|
import Icon from '../../../components/Icon';
|
|
27
27
|
import { styled } from '@mui/material/styles';
|
|
@@ -84,6 +84,16 @@ var BackButtonStyled = styled(Button, { shouldForwardProp: function (prop) { ret
|
|
|
84
84
|
});
|
|
85
85
|
export default function CustomButton(_a) {
|
|
86
86
|
var children = _a.children, disabled = _a.disabled, isAr = _a.isAr, loading = _a.loading, disableBack = _a.disableBack, onBackClicked = _a.onBackClicked, error = _a.error, props = __rest(_a, ["children", "disabled", "isAr", "loading", "disableBack", "onBackClicked", "error"]);
|
|
87
|
-
var
|
|
88
|
-
|
|
87
|
+
var _b = React.useState(false), btnLoading = _b[0], setBtnLoading = _b[1];
|
|
88
|
+
var isBackEnabled = !disableBack && !btnLoading;
|
|
89
|
+
React.useEffect(function () {
|
|
90
|
+
if (loading)
|
|
91
|
+
setBtnLoading(true);
|
|
92
|
+
if (error)
|
|
93
|
+
setBtnLoading(false);
|
|
94
|
+
}, [loading, error]);
|
|
95
|
+
React.useEffect(function () {
|
|
96
|
+
setBtnLoading(false);
|
|
97
|
+
}, []);
|
|
98
|
+
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }, isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: !btnLoading && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!loading })) }))] })] }));
|
|
89
99
|
}
|
|
@@ -51,12 +51,17 @@ var ContainerStyled = styled(Container)(function (_a) {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
var IconStyled = styled(Icon)(function (_a) {
|
|
54
|
+
var _b;
|
|
54
55
|
var theme = _a.theme;
|
|
55
|
-
return ({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
return (_b = {
|
|
57
|
+
width: theme.spacing(10),
|
|
58
|
+
height: theme.spacing(10),
|
|
59
|
+
marginBlockEnd: theme.spacing(7.5)
|
|
60
|
+
},
|
|
61
|
+
_b[theme.breakpoints.down('sm')] = {
|
|
62
|
+
marginBlock: theme.spacing(7.5)
|
|
63
|
+
},
|
|
64
|
+
_b);
|
|
60
65
|
});
|
|
61
66
|
var ThankYou = function (_a) {
|
|
62
67
|
var onSuccess = _a.onSuccess, title = _a.title;
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export var useWindowSize = function () {
|
|
3
|
+
var _a = useState({
|
|
4
|
+
width: 0,
|
|
5
|
+
height: 0
|
|
6
|
+
}), windowSize = _a[0], setWindowSize = _a[1];
|
|
7
|
+
var handleSize = function () {
|
|
8
|
+
setWindowSize({
|
|
9
|
+
width: window.innerWidth,
|
|
10
|
+
height: window.innerHeight
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
window.addEventListener('resize', handleSize);
|
|
15
|
+
handleSize();
|
|
16
|
+
return function () { return window.removeEventListener('resize', handleSize); };
|
|
17
|
+
}, []);
|
|
18
|
+
return windowSize;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "connect library, auth",
|
|
5
|
-
"private": false,
|
|
6
|
-
"main": "build/index.js",
|
|
7
|
-
"module": "build/index.js",
|
|
8
|
-
"types": "build/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"build",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"husky:setup": "npx husky install",
|
|
15
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
-
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
-
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
-
"build": "cross-env NODE_ENV=production webpack",
|
|
21
|
-
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
-
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
-
"ts:build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [],
|
|
27
|
-
"author": {
|
|
28
|
-
"name": "Ahmed Elsharkawy",
|
|
29
|
-
"email": "a.elsharkawy@tap.company"
|
|
30
|
-
},
|
|
31
|
-
"license": "ISC",
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.18.6",
|
|
34
|
-
"@babel/preset-env": "^7.18.6",
|
|
35
|
-
"@babel/preset-react": "^7.18.6",
|
|
36
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
-
"@types/lodash-es": "^4.17.6",
|
|
38
|
-
"@types/moment-hijri": "^2.1.0",
|
|
39
|
-
"@types/react": "^18.0.15",
|
|
40
|
-
"@types/react-calendar": "~3.5.1",
|
|
41
|
-
"@types/react-dom": "^18.0.6",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
43
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
44
|
-
"babel-loader": "^8.2.5",
|
|
45
|
-
"copyfiles": "^2.4.1",
|
|
46
|
-
"cross-env": "^7.0.3",
|
|
47
|
-
"css-loader": "^6.7.1",
|
|
48
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
49
|
-
"eslint": "^8.19.0",
|
|
50
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
51
|
-
"eslint-config-prettier": "^8.5.0",
|
|
52
|
-
"eslint-plugin-import": "^2.26.0",
|
|
53
|
-
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
54
|
-
"eslint-plugin-node": "^11.1.0",
|
|
55
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
56
|
-
"eslint-plugin-react": "^7.30.1",
|
|
57
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
58
|
-
"file-loader": "^6.2.0",
|
|
59
|
-
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
60
|
-
"html-loader": "^3.1.2",
|
|
61
|
-
"html-webpack-plugin": "^5.5.0",
|
|
62
|
-
"husky": "^8.0.1",
|
|
63
|
-
"lint-staged": "^13.0.3",
|
|
64
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
-
"prettier": "^2.7.1",
|
|
66
|
-
"sass": "^1.53.0",
|
|
67
|
-
"sass-loader": "^13.0.2",
|
|
68
|
-
"style-loader": "^3.3.1",
|
|
69
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
70
|
-
"tsc-alias": "^1.6.11",
|
|
71
|
-
"typescript": "^4.7.4",
|
|
72
|
-
"webpack": "^5.73.0",
|
|
73
|
-
"webpack-cli": "^4.10.0",
|
|
74
|
-
"webpack-dev-server": "^4.9.3",
|
|
75
|
-
"webpack-merge": "^5.8.0"
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"@emotion/react": "^11.9.3",
|
|
79
|
-
"@emotion/styled": "^11.9.3",
|
|
80
|
-
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
81
|
-
"@hookform/resolvers": "^2.9.6",
|
|
82
|
-
"@mui/icons-material": "^5.8.4",
|
|
83
|
-
"@mui/material": "^5.8.7",
|
|
84
|
-
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
-
"axios": "^0.27.2",
|
|
86
|
-
"device-detector-js": "^3.0.3",
|
|
87
|
-
"i18next": "^21.8.14",
|
|
88
|
-
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
|
-
"i18next-http-backend": "^1.4.1",
|
|
90
|
-
"jsencrypt": "^3.2.1",
|
|
91
|
-
"lodash-es": "^4.17.21",
|
|
92
|
-
"moment-hijri": "~2.1.2",
|
|
93
|
-
"react": "^18.2.0",
|
|
94
|
-
"react-calendar": "~3.7.0",
|
|
95
|
-
"react-dom": "^18.2.0",
|
|
96
|
-
"react-hook-form": "^7.33.1",
|
|
97
|
-
"react-i18next": "^11.18.1",
|
|
98
|
-
"react-otp-input": "^2.4.0",
|
|
99
|
-
"react-redux": "^8.0.2",
|
|
100
|
-
"react-spring-bottom-sheet": "^3.4.1",
|
|
101
|
-
"yup": "^0.32.11"
|
|
102
|
-
},
|
|
103
|
-
"peerDependencies": {
|
|
104
|
-
"react": "^18.2.0",
|
|
105
|
-
"react-dom": "^18.2.0"
|
|
106
|
-
},
|
|
107
|
-
"lint-staged": {
|
|
108
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
109
|
-
"yarn run prettier:fix",
|
|
110
|
-
"yarn run lint",
|
|
111
|
-
"git add ."
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
"browserslist": {
|
|
115
|
-
"production": [
|
|
116
|
-
">0.2%",
|
|
117
|
-
"not dead",
|
|
118
|
-
"not op_mini all"
|
|
119
|
-
],
|
|
120
|
-
"development": [
|
|
121
|
-
"last 1 chrome version",
|
|
122
|
-
"last 1 firefox version",
|
|
123
|
-
"last 1 safari version"
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
+
"version": "1.0.40",
|
|
4
|
+
"description": "connect library, auth",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"types": "build/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"build",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"husky:setup": "npx husky install",
|
|
15
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
+
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
+
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
+
"build": "cross-env NODE_ENV=production webpack",
|
|
21
|
+
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
+
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
+
"ts:build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [],
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Ahmed Elsharkawy",
|
|
29
|
+
"email": "a.elsharkawy@tap.company"
|
|
30
|
+
},
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/core": "^7.18.6",
|
|
34
|
+
"@babel/preset-env": "^7.18.6",
|
|
35
|
+
"@babel/preset-react": "^7.18.6",
|
|
36
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
+
"@types/lodash-es": "^4.17.6",
|
|
38
|
+
"@types/moment-hijri": "^2.1.0",
|
|
39
|
+
"@types/react": "^18.0.15",
|
|
40
|
+
"@types/react-calendar": "~3.5.1",
|
|
41
|
+
"@types/react-dom": "^18.0.6",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
43
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
44
|
+
"babel-loader": "^8.2.5",
|
|
45
|
+
"copyfiles": "^2.4.1",
|
|
46
|
+
"cross-env": "^7.0.3",
|
|
47
|
+
"css-loader": "^6.7.1",
|
|
48
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
49
|
+
"eslint": "^8.19.0",
|
|
50
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
51
|
+
"eslint-config-prettier": "^8.5.0",
|
|
52
|
+
"eslint-plugin-import": "^2.26.0",
|
|
53
|
+
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
54
|
+
"eslint-plugin-node": "^11.1.0",
|
|
55
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
56
|
+
"eslint-plugin-react": "^7.30.1",
|
|
57
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
58
|
+
"file-loader": "^6.2.0",
|
|
59
|
+
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
60
|
+
"html-loader": "^3.1.2",
|
|
61
|
+
"html-webpack-plugin": "^5.5.0",
|
|
62
|
+
"husky": "^8.0.1",
|
|
63
|
+
"lint-staged": "^13.0.3",
|
|
64
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
+
"prettier": "^2.7.1",
|
|
66
|
+
"sass": "^1.53.0",
|
|
67
|
+
"sass-loader": "^13.0.2",
|
|
68
|
+
"style-loader": "^3.3.1",
|
|
69
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
70
|
+
"tsc-alias": "^1.6.11",
|
|
71
|
+
"typescript": "^4.7.4",
|
|
72
|
+
"webpack": "^5.73.0",
|
|
73
|
+
"webpack-cli": "^4.10.0",
|
|
74
|
+
"webpack-dev-server": "^4.9.3",
|
|
75
|
+
"webpack-merge": "^5.8.0"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@emotion/react": "^11.9.3",
|
|
79
|
+
"@emotion/styled": "^11.9.3",
|
|
80
|
+
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
81
|
+
"@hookform/resolvers": "^2.9.6",
|
|
82
|
+
"@mui/icons-material": "^5.8.4",
|
|
83
|
+
"@mui/material": "^5.8.7",
|
|
84
|
+
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
+
"axios": "^0.27.2",
|
|
86
|
+
"device-detector-js": "^3.0.3",
|
|
87
|
+
"i18next": "^21.8.14",
|
|
88
|
+
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
|
+
"i18next-http-backend": "^1.4.1",
|
|
90
|
+
"jsencrypt": "^3.2.1",
|
|
91
|
+
"lodash-es": "^4.17.21",
|
|
92
|
+
"moment-hijri": "~2.1.2",
|
|
93
|
+
"react": "^18.2.0",
|
|
94
|
+
"react-calendar": "~3.7.0",
|
|
95
|
+
"react-dom": "^18.2.0",
|
|
96
|
+
"react-hook-form": "^7.33.1",
|
|
97
|
+
"react-i18next": "^11.18.1",
|
|
98
|
+
"react-otp-input": "^2.4.0",
|
|
99
|
+
"react-redux": "^8.0.2",
|
|
100
|
+
"react-spring-bottom-sheet": "^3.4.1",
|
|
101
|
+
"yup": "^0.32.11"
|
|
102
|
+
},
|
|
103
|
+
"peerDependencies": {
|
|
104
|
+
"react": "^18.2.0",
|
|
105
|
+
"react-dom": "^18.2.0"
|
|
106
|
+
},
|
|
107
|
+
"lint-staged": {
|
|
108
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
109
|
+
"yarn run prettier:fix",
|
|
110
|
+
"yarn run lint",
|
|
111
|
+
"git add ."
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"browserslist": {
|
|
115
|
+
"production": [
|
|
116
|
+
">0.2%",
|
|
117
|
+
"not dead",
|
|
118
|
+
"not op_mini all"
|
|
119
|
+
],
|
|
120
|
+
"development": [
|
|
121
|
+
"last 1 chrome version",
|
|
122
|
+
"last 1 firefox version",
|
|
123
|
+
"last 1 safari version"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../app/store';
|
|
2
|
-
import { SharedState } from '../../../@types';
|
|
3
|
-
export interface MIDData {
|
|
4
|
-
}
|
|
5
|
-
export interface MIDState extends SharedState<MIDData> {
|
|
6
|
-
}
|
|
7
|
-
export declare const midSlice: import("@reduxjs/toolkit").Slice<MIDState, {}, "connect/mid">;
|
|
8
|
-
declare const _default: import("redux").Reducer<MIDState, import("redux").AnyAction>;
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const midSelector: (state: RootState) => MIDState;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
-
var initialState = {
|
|
4
|
-
error: null,
|
|
5
|
-
loading: false,
|
|
6
|
-
data: {}
|
|
7
|
-
};
|
|
8
|
-
export var midSlice = createSlice({
|
|
9
|
-
name: 'connect/mid',
|
|
10
|
-
initialState: initialState,
|
|
11
|
-
reducers: {},
|
|
12
|
-
extraReducers: function (builder) {
|
|
13
|
-
console.log(builder);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
export var _b = _a = midSlice.actions;
|
|
17
|
-
export default midSlice.reducer;
|
|
18
|
-
export var midSelector = function (state) { return state.connect; };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../app/store';
|
|
2
|
-
import { SharedState } from '../../../@types';
|
|
3
|
-
export interface MIDData {
|
|
4
|
-
}
|
|
5
|
-
export interface MIDState extends SharedState<MIDData> {
|
|
6
|
-
}
|
|
7
|
-
export declare const midSlice: import("@reduxjs/toolkit").Slice<MIDState, {}, "connect/mid">;
|
|
8
|
-
declare const _default: import("redux").Reducer<MIDState, import("redux").AnyAction>;
|
|
9
|
-
export default _default;
|
|
10
|
-
export declare const midSelector: (state: RootState) => MIDState;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
-
var initialState = {
|
|
4
|
-
error: null,
|
|
5
|
-
loading: false,
|
|
6
|
-
data: {}
|
|
7
|
-
};
|
|
8
|
-
export var midSlice = createSlice({
|
|
9
|
-
name: 'connect/mid',
|
|
10
|
-
initialState: initialState,
|
|
11
|
-
reducers: {},
|
|
12
|
-
extraReducers: function (builder) {
|
|
13
|
-
console.log(builder);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
export var _b = _a = midSlice.actions;
|
|
17
|
-
export default midSlice.reducer;
|
|
18
|
-
export var midSelector = function (state) { return state.mid; };
|
|
@@ -1,39 +0,0 @@
|
|
|
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 * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import OTPField from '../../../../features/shared/OTP';
|
|
17
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
-
import { useTranslation } from 'react-i18next';
|
|
19
|
-
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
21
|
-
var theme = _a.theme;
|
|
22
|
-
return ({
|
|
23
|
-
display: 'flex',
|
|
24
|
-
flexDirection: 'column',
|
|
25
|
-
fontFamily: theme.typography.fontFamily,
|
|
26
|
-
marginBottom: theme.spacing(5)
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
var OTPInput = function (_a) {
|
|
30
|
-
var control = useFormContext().control;
|
|
31
|
-
var t = useTranslation().t;
|
|
32
|
-
var otpControl = useController({ name: 'otp', control: control });
|
|
33
|
-
var handleOnOTPChange = function (otp) {
|
|
34
|
-
otpControl.field.onChange(otp);
|
|
35
|
-
};
|
|
36
|
-
var otpValue = otpControl.field.value;
|
|
37
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { }, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
38
|
-
};
|
|
39
|
-
export default React.memo(OTPInput);
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,76 +0,0 @@
|
|
|
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 { useAppDispatch } from '../../../../hooks';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
-
import Box from '@mui/material/Box/Box';
|
|
19
|
-
import { styled } from '@mui/material/styles';
|
|
20
|
-
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
-
import { useLanguage } from '../../../../hooks';
|
|
22
|
-
import Form from '../../../../components/Form';
|
|
23
|
-
import Text from '../../../../components/Text';
|
|
24
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import Button from '../../../shared/Button';
|
|
26
|
-
import { maskPhone } from '../../../../utils';
|
|
27
|
-
import { OTPValidation } from './validation';
|
|
28
|
-
import OTPInput from './OTPInput';
|
|
29
|
-
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return ({
|
|
32
|
-
background: theme.palette.common.white,
|
|
33
|
-
border: '1px solid',
|
|
34
|
-
borderColor: theme.palette.divider,
|
|
35
|
-
direction: theme.direction,
|
|
36
|
-
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
37
|
-
marginBottom: theme.spacing(5.75)
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
41
|
-
var theme = _a.theme;
|
|
42
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
|
|
43
|
-
});
|
|
44
|
-
var FormStyled = styled(Form)(function () { return ({
|
|
45
|
-
display: 'flex',
|
|
46
|
-
flexDirection: 'column'
|
|
47
|
-
}); });
|
|
48
|
-
var VerifyNumber = function (_a) {
|
|
49
|
-
var phone = _a.phone, code = _a.code;
|
|
50
|
-
var dispatch = useAppDispatch();
|
|
51
|
-
var methods = useForm({
|
|
52
|
-
resolver: yupResolver(OTPValidation),
|
|
53
|
-
defaultValues: {
|
|
54
|
-
otp: ''
|
|
55
|
-
},
|
|
56
|
-
mode: 'onChange'
|
|
57
|
-
});
|
|
58
|
-
var t = useTranslation().t;
|
|
59
|
-
var isAr = useLanguage().isAr;
|
|
60
|
-
var onSubmit = function (data) {
|
|
61
|
-
console.log('data', data);
|
|
62
|
-
if (data.otp === '123456')
|
|
63
|
-
return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
|
|
64
|
-
dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
65
|
-
};
|
|
66
|
-
var onBack = function () {
|
|
67
|
-
dispatch(handlePrevScreenStep());
|
|
68
|
-
};
|
|
69
|
-
var loading = false;
|
|
70
|
-
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') : t('ide_opt_sent_title'), _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
|
|
71
|
-
};
|
|
72
|
-
VerifyNumber.defaultProps = {
|
|
73
|
-
phone: '564656085',
|
|
74
|
-
code: '+996'
|
|
75
|
-
};
|
|
76
|
-
export default React.memo(VerifyNumber);
|