@tap-payments/auth-jsconnect 2.0.3 → 2.0.6
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 +5 -0
- package/build/@types/form.d.ts +4 -1
- package/build/api/auth.d.ts +20 -3
- package/build/api/axios.js +8 -9
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +9 -2
- package/build/api/entity.d.ts +13 -1
- package/build/api/entity.js +20 -2
- package/build/api/index.d.ts +7 -4
- package/build/api/lead.d.ts +3 -1
- package/build/api/lead.js +14 -2
- package/build/assets/locales/ar.json +4 -1
- package/build/assets/locales/en.json +4 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +2 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -4
- package/build/components/FileInput/DragAndDrop.d.ts +7 -0
- package/build/components/FileInput/DragAndDrop.js +39 -0
- package/build/components/FileInput/UploadInput.d.ts +7 -0
- package/build/components/FileInput/UploadInput.js +38 -0
- package/build/components/FileInput/index.d.ts +3 -0
- package/build/components/FileInput/index.js +3 -0
- package/build/constants/api.d.ts +3 -1
- package/build/constants/api.js +7 -3
- package/build/constants/app.d.ts +5 -0
- package/build/constants/app.js +55 -9
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +61 -20
- package/build/features/app/business/businessStore.d.ts +3 -5
- package/build/features/app/business/businessStore.js +149 -50
- package/build/features/app/connect/connectStore.d.ts +5 -10
- package/build/features/app/connect/connectStore.js +135 -41
- package/build/features/app/individual/individualStore.d.ts +3 -2
- package/build/features/app/individual/individualStore.js +52 -39
- package/build/features/app/password/passwordStore.d.ts +32 -1
- package/build/features/app/password/passwordStore.js +199 -16
- package/build/features/app/tax/taxStore.js +21 -14
- package/build/features/bank/Bank.js +3 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/BankStatement.js +38 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +1 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/features/business/Business.js +3 -4
- package/build/features/business/screens/Activities/Activities.js +2 -1
- package/build/features/business/screens/Activities/LicenseName.d.ts +5 -0
- package/build/features/business/screens/Activities/LicenseName.js +30 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
- package/build/features/business/screens/OTP/OTPInput.js +3 -9
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -17
- package/build/features/connect/Connect.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -5
- package/build/features/connect/screens/Merchant/Merchant.js +10 -8
- package/build/features/connect/screens/Merchant/validation.js +4 -2
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/Mobile/MobileNumber.js +1 -1
- package/build/features/connect/screens/NID/IDNumber.js +1 -1
- package/build/features/connect/screens/NID/NID.js +2 -2
- package/build/features/connect/screens/OTP/OTPInput.js +3 -13
- package/build/features/featuresScreens.js +20 -5
- package/build/features/individual/Individual.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/features/password/Password.js +11 -6
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
- package/build/features/password/screens/OTP/OTP.d.ts +8 -0
- package/build/features/password/screens/OTP/OTP.js +78 -0
- package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/password/screens/OTP/OTPInput.js +46 -0
- package/build/features/password/screens/OTP/index.d.ts +3 -0
- package/build/features/password/screens/OTP/index.js +2 -0
- package/build/features/password/screens/OTP/validation.d.ts +8 -0
- package/build/features/password/screens/OTP/validation.js +4 -0
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/password/screens/Success/Success.js +8 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -16
- package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
- package/build/features/password/screens/Verify/OTPInput.js +1 -1
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
- package/build/features/shared/Button/FlowsButtons.js +90 -6
- package/build/features/shared/Button/SuccessButton.js +31 -13
- package/build/features/shared/UploadFile/UploadFile.d.ts +21 -0
- package/build/features/shared/UploadFile/UploadFile.js +77 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -0
- package/build/features/shared/UploadFile/index.js +2 -0
- package/build/features/tax/Tax.js +3 -4
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/hooks/useAppTheme.js +3 -2
- package/build/index.css +4 -0
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +1 -2
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +6 -1
- package/package.json +2 -1
|
@@ -25,25 +25,43 @@ import React from 'react';
|
|
|
25
25
|
import Button from './Button';
|
|
26
26
|
import { styled } from '@mui/material/styles';
|
|
27
27
|
import Box from '@mui/material/Box';
|
|
28
|
-
var ButtonStyled = styled(Button
|
|
29
|
-
|
|
30
|
-
})(function (_a) {
|
|
31
|
-
var theme = _a.theme, isLoading = _a.isLoading;
|
|
28
|
+
var ButtonStyled = styled(Button)(function (_a) {
|
|
29
|
+
var theme = _a.theme;
|
|
32
30
|
return ({
|
|
33
|
-
'&.MuiButton-outlined':
|
|
31
|
+
'&.MuiButton-outlined': {
|
|
32
|
+
width: '100%',
|
|
33
|
+
textTransform: 'none',
|
|
34
|
+
paddingInlineStart: theme.spacing(0.75),
|
|
35
|
+
backgroundColor: theme.palette.common.white,
|
|
36
|
+
color: theme.palette.primary.main,
|
|
37
|
+
border: "1px solid ".concat(theme.palette.primary.main),
|
|
38
|
+
'&:hover': {
|
|
34
39
|
backgroundColor: theme.palette.common.white,
|
|
35
40
|
color: theme.palette.primary.main
|
|
36
|
-
},
|
|
41
|
+
},
|
|
42
|
+
'&:disabled': {
|
|
37
43
|
backgroundColor: theme.palette.primary.main,
|
|
38
44
|
color: theme.palette.common.white
|
|
39
|
-
},
|
|
45
|
+
},
|
|
46
|
+
transition: theme.transitions.create(['width', 'padding'], {
|
|
40
47
|
easing: theme.transitions.easing.easeInOut,
|
|
41
48
|
duration: theme.transitions.duration.complex * 2
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
'&.MuiButton-contained': {
|
|
52
|
+
color: theme.palette.common.white,
|
|
53
|
+
backgroundColor: theme.palette.primary.main,
|
|
54
|
+
'&:hover': {
|
|
55
|
+
backgroundColor: theme.palette.primary.main
|
|
56
|
+
},
|
|
57
|
+
'&:active': {
|
|
58
|
+
backgroundColor: theme.palette.primary.main
|
|
59
|
+
},
|
|
60
|
+
':disabled': {
|
|
61
|
+
backgroundColor: theme.palette.primary.main,
|
|
62
|
+
color: theme.palette.common.white
|
|
63
|
+
}
|
|
64
|
+
}
|
|
47
65
|
});
|
|
48
66
|
});
|
|
49
67
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
@@ -64,5 +82,5 @@ export default function SuccessButton(_a) {
|
|
|
64
82
|
React.useEffect(function () {
|
|
65
83
|
setBtnLoading(false);
|
|
66
84
|
}, []);
|
|
67
|
-
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr,
|
|
85
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, loading: btnLoading, disabled: disabled, type: 'button', variant: btnLoading ? 'contained' : 'outlined' }, props, { children: children })) }));
|
|
68
86
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const InputContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
component?: React.ElementType<any> | undefined;
|
|
5
|
+
ref?: React.Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
7
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
|
+
interface UploadFileProps {
|
|
11
|
+
label: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
dragTitle: string;
|
|
14
|
+
uploadTitle: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
onFileUploaded: (file: File) => void;
|
|
18
|
+
onReset: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const UploadFile: ({ label, required, dragTitle, uploadTitle, loading, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
|
|
21
|
+
export default UploadFile;
|
|
@@ -0,0 +1,77 @@
|
|
|
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 React from 'react';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import { ScreenContainer } from '../../shared/Containers';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { InputLabelStyled } from '../../shared/Input/Input';
|
|
18
|
+
import Mandatory from '../../shared/Mandatory';
|
|
19
|
+
import { DragAndDrop, UploadInput } from '../../../components/FileInput';
|
|
20
|
+
import Collapse from '../../../components/Collapse';
|
|
21
|
+
import Warning from '../../../components/Warning';
|
|
22
|
+
import Icon from '../../../components/Icon';
|
|
23
|
+
import { ICONS_NAMES } from '../../../constants';
|
|
24
|
+
import { useTranslation } from 'react-i18next';
|
|
25
|
+
import Loader from '../../../components/Loader';
|
|
26
|
+
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return ({
|
|
29
|
+
marginBlockStart: theme.spacing(0)
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return ({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
justifyContent: 'flex-start',
|
|
37
|
+
padding: theme.spacing(0, 2.5, 1.25, 2.5)
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '85%' }));
|
|
43
|
+
});
|
|
44
|
+
var UploadBoxStyled = styled(Box)(function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, padding: theme.spacing(0.75, 1.75, 0), cursor: 'pointer', width: '15%', display: 'flex', justifyContent: 'center' }));
|
|
47
|
+
});
|
|
48
|
+
var IconStyled = styled(Icon)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return ({
|
|
51
|
+
marginBlockStart: theme.spacing(0),
|
|
52
|
+
width: theme.spacing(3.5),
|
|
53
|
+
height: theme.spacing(3.5)
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export var InputContainerStyled = styled(Box)(function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return ({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
width: '100%'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var UploadFile = function (_a) {
|
|
64
|
+
var label = _a.label, required = _a.required, dragTitle = _a.dragTitle, uploadTitle = _a.uploadTitle, loading = _a.loading, error = _a.error, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset;
|
|
65
|
+
var _b = React.useState(''), fileName = _b[0], setFileName = _b[1];
|
|
66
|
+
var t = useTranslation().t;
|
|
67
|
+
var handleFileChange = function (file) {
|
|
68
|
+
setFileName(file === null || file === void 0 ? void 0 : file.name);
|
|
69
|
+
onFileUploaded === null || onFileUploaded === void 0 ? void 0 : onFileUploaded(file);
|
|
70
|
+
};
|
|
71
|
+
var handleReset = function () {
|
|
72
|
+
setFileName('');
|
|
73
|
+
onReset === null || onReset === void 0 ? void 0 : onReset();
|
|
74
|
+
};
|
|
75
|
+
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(DragAndDrop, { title: dragTitle, onSuccess: handleFileChange }), _jsx(UploadInput, { title: uploadTitle, onChange: handleFileChange })] }) })), _jsx(Collapse, __assign({ in: !!fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(BoxStyled, { children: loading ? t('loading_bank_statement') : fileName }), _jsxs(UploadBoxStyled, __assign({ onClick: handleReset }, { children: [_jsx(Collapse, __assign({ in: !loading }, { children: _jsx(IconStyled, { src: ICONS_NAMES.DELETE_ICON }) })), _jsx(Collapse, __assign({ in: loading }, { children: _jsx(Loader, { innerColor: 'white', outerColor: 'white', toggleAnimation: true, style: { width: 30, height: 30 }, svgStyle: { width: 30, height: 30 } }) }))] }))] }) })), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: error })) }))] }));
|
|
76
|
+
};
|
|
77
|
+
export default UploadFile;
|
|
@@ -36,18 +36,17 @@ var Tax = memo(function (props) {
|
|
|
36
36
|
var verifyToken = function () {
|
|
37
37
|
var token = getParameterByName('token');
|
|
38
38
|
var lang = getParameterByName('lang');
|
|
39
|
+
if (lang)
|
|
40
|
+
dispatch(handleLanguage(lang));
|
|
39
41
|
if (!token)
|
|
40
42
|
throw new Error('Auth token is not found!');
|
|
41
|
-
if (!lang)
|
|
42
|
-
throw new Error('Language is not found!');
|
|
43
|
-
dispatch(handleLanguage(lang));
|
|
44
43
|
dispatch(verifyLeadToken(token));
|
|
45
44
|
};
|
|
46
45
|
useEffect(function () {
|
|
47
46
|
if (!loading)
|
|
48
47
|
verifyToken();
|
|
49
48
|
}, [loading]);
|
|
50
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
51
50
|
var Element = _a.element, name = _a.name;
|
|
52
51
|
var isActive = activeScreen.name === name;
|
|
53
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -0,0 +1,9 @@
|
|
|
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 ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -10,18 +10,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { taxSelector } from '../../../app/tax/taxStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -46,39 +47,45 @@ var SuccessWithFlowButtons = function () {
|
|
|
46
47
|
var _a, _b, _c;
|
|
47
48
|
var t = useTranslation().t;
|
|
48
49
|
var isAr = useLanguage().isAr;
|
|
49
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
50
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
51
50
|
var data = useAppSelector(taxSelector).data;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
54
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
55
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
56
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
57
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
58
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
59
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
62
|
+
var settings = useAppSelector(settingsSelector);
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
64
|
+
var email = (contact || { email: '' }).email;
|
|
65
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
60
66
|
var reMapFlowData = function (flows) {
|
|
61
67
|
if (flows === void 0) { flows = []; }
|
|
62
68
|
var images = ICONS_NAMES;
|
|
63
|
-
var mappedFlows = flows
|
|
69
|
+
var mappedFlows = flows
|
|
70
|
+
.filter(function (item) { return item.name; })
|
|
71
|
+
.map(function (_a) {
|
|
64
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
65
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
66
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
67
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
68
76
|
business_type: brandName,
|
|
69
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
70
78
|
bank_name: bankName,
|
|
71
79
|
iban: t('masking_symbols') + iban,
|
|
72
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
73
81
|
});
|
|
74
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
75
|
-
setIsAcceptance(true);
|
|
76
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
77
83
|
var isIndividual = name === 'individual';
|
|
78
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
79
85
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
80
86
|
return {
|
|
81
87
|
name: name,
|
|
88
|
+
status: status,
|
|
82
89
|
title: title,
|
|
83
90
|
href: url,
|
|
84
91
|
src: images[src],
|
|
@@ -88,14 +95,15 @@ var SuccessWithFlowButtons = function () {
|
|
|
88
95
|
};
|
|
89
96
|
});
|
|
90
97
|
setButtons(mappedFlows);
|
|
91
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
92
|
-
if (isAllCompleted)
|
|
93
|
-
setIsPayout(true);
|
|
94
98
|
};
|
|
95
99
|
useEffect(function () {
|
|
96
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
97
101
|
reMapFlowData(flows);
|
|
98
102
|
}, [flows, isAr]);
|
|
99
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons,
|
|
103
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
104
|
+
flowName: data.flowName,
|
|
105
|
+
email: email,
|
|
106
|
+
emailUrl: url
|
|
107
|
+
} }) })] }));
|
|
100
108
|
};
|
|
101
109
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -1,6 +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
5
|
import { useAppSelector } from './useAppSelector';
|
|
5
6
|
import { appTheme } from '../theme';
|
|
6
7
|
export var useAppTheme = function () {
|
|
@@ -8,7 +9,7 @@ export var useAppTheme = function () {
|
|
|
8
9
|
var data = useAppSelector(settingsSelector).data;
|
|
9
10
|
useEffect(function () {
|
|
10
11
|
var dir = data.language === LanguageMode.AR ? DirectionMode.RTL : DirectionMode.LTR;
|
|
11
|
-
setTheme(appTheme(data.skin, dir));
|
|
12
|
-
}, [data.skin, data.language]);
|
|
12
|
+
setTheme(appTheme(data.skin, isMobile, dir));
|
|
13
|
+
}, [data.skin, data.language, isMobile]);
|
|
13
14
|
return { theme: theme };
|
|
14
15
|
};
|
package/build/index.css
CHANGED
package/build/theme/theme.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DirectionMode, ThemeMode } from '../@types';
|
|
2
|
-
export declare const appTheme: (mode: ThemeMode, dir: DirectionMode) => import("@mui/material/styles").Theme;
|
|
2
|
+
export declare const appTheme: (mode: ThemeMode, isMobile: boolean, dir: DirectionMode) => import("@mui/material/styles").Theme;
|
package/build/theme/theme.js
CHANGED
|
@@ -3,8 +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
|
-
|
|
7
|
-
export var appTheme = function (mode, dir) {
|
|
6
|
+
export var appTheme = function (mode, isMobile, dir) {
|
|
8
7
|
return createTheme({
|
|
9
8
|
palette: mode === 'dark' ? darkPalette : lightPalette,
|
|
10
9
|
direction: dir,
|
package/build/utils/string.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const convertNumbers2English: (str: string) => string;
|
|
|
11
11
|
export declare const getParameterByName: (name: string) => string | null;
|
|
12
12
|
export declare const getClientEmailUrl: () => string;
|
|
13
13
|
export declare const getFlowUrl: (path: string, lang: string) => string;
|
|
14
|
+
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, leadId: string) => string;
|
|
14
15
|
export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
|
|
15
16
|
export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
16
17
|
al: string;
|
package/build/utils/string.js
CHANGED
|
@@ -62,6 +62,10 @@ export var getFlowUrl = function (path, lang) {
|
|
|
62
62
|
var origin = window.location.origin;
|
|
63
63
|
return origin + path + "?lang=".concat(lang, "&token=");
|
|
64
64
|
};
|
|
65
|
+
export var getResetFlowUrl = function (path, lang, operationType, leadId) {
|
|
66
|
+
var origin = window.location.origin;
|
|
67
|
+
return origin + path + "?lang=".concat(lang, "&operation_type=").concat(operationType, "&lead_id=").concat(leadId, "&token=");
|
|
68
|
+
};
|
|
65
69
|
export var capitalizeTheFirstLetterOfEachWord = function (words) {
|
|
66
70
|
var separateWord = words.toLowerCase().split(' ');
|
|
67
71
|
for (var i = 0; i < separateWord.length; i++) {
|
|
@@ -71,6 +75,7 @@ export var capitalizeTheFirstLetterOfEachWord = function (words) {
|
|
|
71
75
|
};
|
|
72
76
|
export var getRequestHeaders = function (deviceInfo) {
|
|
73
77
|
var app = deviceInfo.app, browser = deviceInfo.browser, connection = deviceInfo.connection, device = deviceInfo.device, source = deviceInfo.source;
|
|
78
|
+
console.log('bi:', browser.browser_id);
|
|
74
79
|
return {
|
|
75
80
|
al: encryptString(app.language || ''),
|
|
76
81
|
at: encryptString(source || ''),
|
|
@@ -89,7 +94,7 @@ export var getRequestHeaders = function (deviceInfo) {
|
|
|
89
94
|
bb: encryptString(''),
|
|
90
95
|
bv: encryptString(browser.version || ''),
|
|
91
96
|
bua: encryptString((browser.user_agent || '').substring(0, 80)),
|
|
92
|
-
bi:
|
|
97
|
+
bi: browser.browser_id || '',
|
|
93
98
|
ci: encryptString(connection.ip || ''),
|
|
94
99
|
cm: encryptString(connection.mac || ''),
|
|
95
100
|
l: encryptString((connection.latitude || 0).toString() + '-' + (connection.longitude || 0).toString())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"react-calendar": "~3.7.0",
|
|
95
95
|
"react-device-detect": "^2.2.2",
|
|
96
96
|
"react-dom": "^18.2.0",
|
|
97
|
+
"react-dropzone": "^14.2.2",
|
|
97
98
|
"react-hook-form": "^7.33.1",
|
|
98
99
|
"react-i18next": "^11.18.1",
|
|
99
100
|
"react-otp-input": "^2.4.0",
|