@tap-payments/auth-jsconnect 2.0.21-test → 2.0.21
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/api/availabilityServices.d.ts +1 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +2 -2
- package/build/constants/app.d.ts +5 -0
- package/build/constants/app.js +1 -0
- package/build/constants/assets.js +1 -1
- package/build/constants/validation.d.ts +1 -1
- package/build/constants/validation.js +1 -1
- package/build/features/app/bank/bankStore.d.ts +5 -1
- package/build/features/app/bank/bankStore.js +13 -12
- package/build/features/app/business/businessStore.d.ts +1 -3
- package/build/features/app/business/businessStore.js +136 -106
- package/build/features/app/connect/connectStore.js +9 -5
- package/build/features/app/individual/individualStore.d.ts +5 -1
- package/build/features/app/individual/individualStore.js +3 -3
- package/build/features/app/password/passwordStore.d.ts +10 -2
- package/build/features/app/password/passwordStore.js +4 -4
- package/build/features/app/signIn/signInStore.js +2 -2
- package/build/features/app/tax/taxStore.js +3 -3
- package/build/features/bank/screens/BankDetails/BankDetails.js +6 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +6 -3
- package/build/features/bank/screens/BankDetails/validation.js +4 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/bank/screens/Verify/Verify.js +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +6 -0
- package/build/features/business/screens/Activities/SalesChannels.js +8 -4
- package/build/features/business/screens/Customers/CustomerLocations.js +6 -3
- package/build/features/business/screens/Customers/ExpectedCustomers.js +6 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/business/screens/Verify/Verify.js +2 -2
- package/build/features/connect/screens/Merchant/SocialMediaCopy.d.ts +9 -0
- package/build/features/connect/screens/Merchant/SocialMediaCopy.js +117 -0
- package/build/features/connect/screens/Merchant/validationCopy.d.ts +133 -0
- package/build/features/connect/screens/Merchant/validationCopy.js +185 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +0 -6
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/individual/screens/Verify/Verify.js +2 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/password/screens/Verify/Verify.js +2 -2
- package/build/features/shared/Button/Button.d.ts +2 -1
- package/build/features/shared/Button/Button.js +2 -2
- package/build/features/shared/Button/SuccessButton.js +1 -1
- package/build/features/shared/UploadFile/UploadFile.js +2 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/tax/screens/Verify/Verify.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { REGEX_WEBSITE, REGEX_BRAND_NAME } from '../../../../constants';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
export var ValidationOptions;
|
|
4
|
+
(function (ValidationOptions) {
|
|
5
|
+
ValidationOptions["NEW_USER"] = "NEW_USER";
|
|
6
|
+
ValidationOptions["EXISTING_USER_WITH_EXIST_BRAND"] = "EXISTING_USER_WITH_EXIST_BRAND";
|
|
7
|
+
ValidationOptions["EXISTING_USER_WITH_OTHER_BRAND"] = "EXISTING_USER_WITH_OTHER_BRAND";
|
|
8
|
+
})(ValidationOptions || (ValidationOptions = {}));
|
|
9
|
+
export var MerchantValidationSchema = function (userType) {
|
|
10
|
+
var askingForBrandInfo = userType === ValidationOptions.NEW_USER || userType === ValidationOptions.EXISTING_USER_WITH_OTHER_BRAND;
|
|
11
|
+
if (askingForBrandInfo) {
|
|
12
|
+
return yup.object().shape({
|
|
13
|
+
brandName: yup
|
|
14
|
+
.string()
|
|
15
|
+
.test({
|
|
16
|
+
test: function (value) {
|
|
17
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
18
|
+
if (length === 0)
|
|
19
|
+
return true;
|
|
20
|
+
return !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)) || (value === null || value === void 0 ? void 0 : value.length) < 3
|
|
21
|
+
? this.createError({ message: 'enter_brand_name_english_chars_numbers_space' })
|
|
22
|
+
: true;
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
.required(''),
|
|
26
|
+
termAndConditionChecked: yup.boolean().required().isTrue('check_terms_cond'),
|
|
27
|
+
salesChannels: yup
|
|
28
|
+
.array()
|
|
29
|
+
.min(1, 'choose_atleast_one_channel')
|
|
30
|
+
.of(yup.object().shape({
|
|
31
|
+
id: yup.string(),
|
|
32
|
+
name_en: yup.string(),
|
|
33
|
+
name_ar: yup.string()
|
|
34
|
+
}))
|
|
35
|
+
.required('choose_atleast_one_channel'),
|
|
36
|
+
links: yup.object().shape({
|
|
37
|
+
website: yup.string().when(['instagram', 'twitter'], function (instagram, twitter) {
|
|
38
|
+
if (!instagram && !twitter) {
|
|
39
|
+
return yup
|
|
40
|
+
.string()
|
|
41
|
+
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
42
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
43
|
+
.nullable()
|
|
44
|
+
.required('enter_at_least_one');
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return yup
|
|
48
|
+
.string()
|
|
49
|
+
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
50
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
51
|
+
.nullable()
|
|
52
|
+
.optional();
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
instagram: yup
|
|
56
|
+
.string()
|
|
57
|
+
.nullable()
|
|
58
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
59
|
+
.when(['twitter', 'website'], function (twitter, website) {
|
|
60
|
+
if (!website && !twitter) {
|
|
61
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return yup.string().optional();
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
twitter: yup
|
|
68
|
+
.string()
|
|
69
|
+
.nullable()
|
|
70
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
71
|
+
.min(2, 'enter_at_least_one')
|
|
72
|
+
.when(['website', 'instagram'], function (website, instagram) {
|
|
73
|
+
if (!website && !instagram) {
|
|
74
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return yup.string().optional();
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
app: yup
|
|
81
|
+
.string()
|
|
82
|
+
.nullable()
|
|
83
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
84
|
+
.min(2, 'enter_at_least_one')
|
|
85
|
+
.optional(),
|
|
86
|
+
call_center: yup
|
|
87
|
+
.string()
|
|
88
|
+
.nullable()
|
|
89
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
90
|
+
.min(2, 'enter_at_least_one')
|
|
91
|
+
.optional(),
|
|
92
|
+
physical_store: yup
|
|
93
|
+
.string()
|
|
94
|
+
.nullable()
|
|
95
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
96
|
+
.min(2, 'enter_at_least_one')
|
|
97
|
+
.optional()
|
|
98
|
+
}, [
|
|
99
|
+
['instagram', 'website'],
|
|
100
|
+
['twitter', 'website'],
|
|
101
|
+
['instagram', 'twitter']
|
|
102
|
+
])
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return yup.object().shape({
|
|
106
|
+
brandName: yup.string().optional(),
|
|
107
|
+
termAndConditionChecked: yup.boolean().optional(),
|
|
108
|
+
salesChannels: yup
|
|
109
|
+
.array()
|
|
110
|
+
.min(1, 'choose_atleast_one_channel')
|
|
111
|
+
.of(yup.object().shape({
|
|
112
|
+
id: yup.string(),
|
|
113
|
+
name_en: yup.string(),
|
|
114
|
+
name_ar: yup.string()
|
|
115
|
+
}))
|
|
116
|
+
.required('choose_atleast_one_channel'),
|
|
117
|
+
links: yup.object().shape({
|
|
118
|
+
website: yup.string().when(['instagram', 'twitter'], function (instagram, twitter) {
|
|
119
|
+
if (!instagram && !twitter) {
|
|
120
|
+
return yup
|
|
121
|
+
.string()
|
|
122
|
+
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
123
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
124
|
+
.nullable()
|
|
125
|
+
.required('enter_at_least_one');
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return yup
|
|
129
|
+
.string()
|
|
130
|
+
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
131
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
132
|
+
.nullable()
|
|
133
|
+
.optional();
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
instagram: yup
|
|
137
|
+
.string()
|
|
138
|
+
.nullable()
|
|
139
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
140
|
+
.when(['twitter', 'website'], function (twitter, website) {
|
|
141
|
+
if (!website && !twitter) {
|
|
142
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return yup.string().optional();
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
twitter: yup
|
|
149
|
+
.string()
|
|
150
|
+
.nullable()
|
|
151
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
152
|
+
.min(2, 'enter_at_least_one')
|
|
153
|
+
.when(['website', 'instagram'], function (website, instagram) {
|
|
154
|
+
if (!website && !instagram) {
|
|
155
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
return yup.string().optional();
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
app: yup
|
|
162
|
+
.string()
|
|
163
|
+
.nullable()
|
|
164
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
165
|
+
.min(2, 'enter_at_least_one')
|
|
166
|
+
.optional(),
|
|
167
|
+
call_center: yup
|
|
168
|
+
.string()
|
|
169
|
+
.nullable()
|
|
170
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
171
|
+
.min(2, 'enter_at_least_one')
|
|
172
|
+
.optional(),
|
|
173
|
+
physical_store: yup
|
|
174
|
+
.string()
|
|
175
|
+
.nullable()
|
|
176
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
177
|
+
.min(2, 'enter_at_least_one')
|
|
178
|
+
.optional()
|
|
179
|
+
}, [
|
|
180
|
+
['instagram', 'website'],
|
|
181
|
+
['twitter', 'website'],
|
|
182
|
+
['instagram', 'twitter']
|
|
183
|
+
])
|
|
184
|
+
});
|
|
185
|
+
};
|
|
@@ -2,14 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
6
|
-
import { updateLeadSuccess } from '../../../app/connect/connectStore';
|
|
7
5
|
var ThankYou = function (_a) {
|
|
8
6
|
var t = useTranslation().t;
|
|
9
|
-
var dispatch = useAppDispatch();
|
|
10
|
-
React.useEffect(function () {
|
|
11
|
-
dispatch(updateLeadSuccess());
|
|
12
|
-
}, []);
|
|
13
7
|
return (_jsx(SuccessScreen, { title: t("connect_completed_title"), description: t("connect_completed_description"), showEmailProviders: true }));
|
|
14
8
|
};
|
|
15
9
|
export default React.memo(ThankYou);
|
|
@@ -67,7 +67,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
67
67
|
if (flows === void 0) { flows = []; }
|
|
68
68
|
var images = ICONS_NAMES;
|
|
69
69
|
var mappedFlows = flows
|
|
70
|
-
.filter(function (item) { return item.name; })
|
|
70
|
+
.filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
|
|
71
71
|
.map(function (_a) {
|
|
72
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
73
73
|
var type = status === 'completed' ? 'completed' : 'pending';
|
|
@@ -58,8 +58,9 @@ var VerifyNumber = function (_a) {
|
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
60
|
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
61
|
+
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
61
62
|
React.useEffect(function () {
|
|
62
|
-
if (error)
|
|
63
|
+
if (error && methods.formState.isValid && phone)
|
|
63
64
|
dispatch(clearError());
|
|
64
65
|
return function () {
|
|
65
66
|
dispatch(resetOTPScreen());
|
|
@@ -71,7 +72,6 @@ var VerifyNumber = function (_a) {
|
|
|
71
72
|
var onBack = function () {
|
|
72
73
|
dispatch(handlePrevScreenStep());
|
|
73
74
|
};
|
|
74
|
-
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
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'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|
|
@@ -68,7 +68,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
68
68
|
if (flows === void 0) { flows = []; }
|
|
69
69
|
var images = ICONS_NAMES;
|
|
70
70
|
var mappedFlows = flows
|
|
71
|
-
.filter(function (item) { return item.name; })
|
|
71
|
+
.filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
|
|
72
72
|
.map(function (_a) {
|
|
73
73
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
74
74
|
var type = status === 'completed' ? 'completed' : 'pending';
|
|
@@ -58,8 +58,9 @@ var VerifyNumber = function (_a) {
|
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
60
|
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
61
|
+
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
61
62
|
React.useEffect(function () {
|
|
62
|
-
if (error)
|
|
63
|
+
if (error && methods.formState.isValid && phone)
|
|
63
64
|
dispatch(clearError());
|
|
64
65
|
return function () {
|
|
65
66
|
dispatch(resetOTPScreen());
|
|
@@ -71,7 +72,6 @@ var VerifyNumber = function (_a) {
|
|
|
71
72
|
var onBack = function () {
|
|
72
73
|
dispatch(handlePrevScreenStep());
|
|
73
74
|
};
|
|
74
|
-
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
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'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|
|
@@ -7,5 +7,6 @@ export interface CustomButtonProps extends ButtonProps {
|
|
|
7
7
|
disableNextIcon?: boolean;
|
|
8
8
|
onBackClicked?: () => void;
|
|
9
9
|
error?: string;
|
|
10
|
+
hideError?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export default function CustomButton({ children, disabled, isAr, loading, disableBack, onBackClicked, error, disableNextIcon, ...props }: CustomButtonProps): JSX.Element;
|
|
12
|
+
export default function CustomButton({ children, disabled, isAr, loading, disableBack, onBackClicked, error, hideError, disableNextIcon, ...props }: CustomButtonProps): JSX.Element;
|
|
@@ -83,7 +83,7 @@ var BackButtonStyled = styled(Button, { shouldForwardProp: function (prop) { ret
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
export default function CustomButton(_a) {
|
|
86
|
-
var children = _a.children, disabled = _a.disabled, isAr = _a.isAr, loading = _a.loading, disableBack = _a.disableBack, onBackClicked = _a.onBackClicked, error = _a.error, disableNextIcon = _a.disableNextIcon, props = __rest(_a, ["children", "disabled", "isAr", "loading", "disableBack", "onBackClicked", "error", "disableNextIcon"]);
|
|
86
|
+
var children = _a.children, disabled = _a.disabled, isAr = _a.isAr, loading = _a.loading, disableBack = _a.disableBack, onBackClicked = _a.onBackClicked, error = _a.error, hideError = _a.hideError, disableNextIcon = _a.disableNextIcon, props = __rest(_a, ["children", "disabled", "isAr", "loading", "disableBack", "onBackClicked", "error", "hideError", "disableNextIcon"]);
|
|
87
87
|
var _b = React.useState(false), btnLoading = _b[0], setBtnLoading = _b[1];
|
|
88
88
|
var isBackEnabled = !disableBack && !btnLoading;
|
|
89
89
|
React.useEffect(function () {
|
|
@@ -95,7 +95,7 @@ export default function CustomButton(_a) {
|
|
|
95
95
|
React.useEffect(function () {
|
|
96
96
|
setBtnLoading(false);
|
|
97
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 === false
|
|
98
|
+
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { 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 === false
|
|
99
99
|
? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW })
|
|
100
100
|
: undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!loading })) }))] })] }));
|
|
101
101
|
}
|
|
@@ -82,5 +82,5 @@ export default function SuccessButton(_a) {
|
|
|
82
82
|
React.useEffect(function () {
|
|
83
83
|
setBtnLoading(false);
|
|
84
84
|
}, []);
|
|
85
|
-
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, loading: btnLoading, disabled: disabled, type: 'button', variant: btnLoading ? 'contained' : 'outlined' }, props, { children: children })) }));
|
|
85
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, loading: btnLoading, disabled: disabled, type: 'button', variant: btnLoading ? 'contained' : 'outlined', error: error, hideError: true }, props, { children: children })) }));
|
|
86
86
|
}
|
|
@@ -36,16 +36,15 @@ var LabelContainerStyled = styled(Box)(function (_a) {
|
|
|
36
36
|
});
|
|
37
37
|
var BoxStyled = styled(Box)(function (_a) {
|
|
38
38
|
var theme = _a.theme;
|
|
39
|
-
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%' }));
|
|
39
|
+
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%', wordBreak: 'break-all' }));
|
|
40
40
|
});
|
|
41
41
|
var UploadBoxStyled = styled(Box)(function (_a) {
|
|
42
42
|
var theme = _a.theme;
|
|
43
|
-
return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular,
|
|
43
|
+
return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '15%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
|
|
44
44
|
});
|
|
45
45
|
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
46
46
|
var theme = _a.theme;
|
|
47
47
|
return ({
|
|
48
|
-
marginBlockStart: theme.spacing(0.25),
|
|
49
48
|
width: theme.spacing(3),
|
|
50
49
|
height: theme.spacing(3),
|
|
51
50
|
cursor: 'pointer',
|
|
@@ -67,7 +67,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
67
67
|
if (flows === void 0) { flows = []; }
|
|
68
68
|
var images = ICONS_NAMES;
|
|
69
69
|
var mappedFlows = flows
|
|
70
|
-
.filter(function (item) { return item.name; })
|
|
70
|
+
.filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
|
|
71
71
|
.map(function (_a) {
|
|
72
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
73
73
|
var type = status === 'initiated' || status === 'in_progress' ? 'pending' : 'completed';
|
|
@@ -58,8 +58,9 @@ var VerifyNumber = function (_a) {
|
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
60
|
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
61
|
+
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
61
62
|
React.useEffect(function () {
|
|
62
|
-
if (error)
|
|
63
|
+
if (error && methods.formState.isValid && phone)
|
|
63
64
|
dispatch(clearError());
|
|
64
65
|
return function () {
|
|
65
66
|
dispatch(resetOTPScreen());
|
|
@@ -71,7 +72,6 @@ var VerifyNumber = function (_a) {
|
|
|
71
72
|
var onBack = function () {
|
|
72
73
|
dispatch(handlePrevScreenStep());
|
|
73
74
|
};
|
|
74
|
-
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
75
|
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
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'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|