react-gldn-kit 0.1.171 → 0.1.173
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/README.md +0 -165
- package/dist/index.js +1 -1
- package/dist/lib/components/Profile/AssignEmail/index.d.ts +1 -0
- package/dist/lib/components/Profile/AssignEmail/index.js +129 -0
- package/dist/lib/components/Profile/AssignEmail/types.d.ts +53 -0
- package/dist/lib/components/Profile/AssignEmail/types.js +9 -0
- package/dist/lib/components/ui/Icons/Profile/EditPencilSvg.d.ts +2 -0
- package/dist/lib/components/ui/Icons/Profile/EditPencilSvg.js +20 -0
- package/dist/lib/components/ui/Icons/Profile/UnverifiedSvg.d.ts +2 -0
- package/dist/lib/components/ui/Icons/Profile/UnverifiedSvg.js +20 -0
- package/dist/lib/components/ui/Icons/SocialMedia/TwitterSvg.js +1 -1
- package/dist/lib/components/ui/Inputs/BaseInput/BaseInputUi.js +11 -10
- package/dist/lib/components/ui/Inputs/BaseInput/types.d.ts +2 -1
- package/dist/lib/components/ui/Inputs/EmailInput/index.d.ts +5 -1
- package/dist/lib/components/ui/Inputs/EmailInput/index.js +109 -16
- package/dist/lib/components/ui/Timer/index.d.ts +4 -1
- package/dist/lib/components/ui/Timer/index.js +10 -6
- package/dist/lib/context/logic/ModalContext.d.ts +1 -0
- package/dist/lib/index.d.ts +4 -1
- package/dist/lib/index.js +10 -4
- package/dist/main.css +139 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AssignEmail: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.AssignEmail = void 0;
|
|
41
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
44
|
+
var types_1 = require("react-memory-optimization/dist/lib/binary/types");
|
|
45
|
+
var CrossSvg_1 = require("components/ui/Icons/Base/CrossSvg");
|
|
46
|
+
var HOCRequestLoader_1 = require("components/HOCs/HOCRequestLoader");
|
|
47
|
+
var EmailInput_1 = require("components/ui/Inputs/EmailInput");
|
|
48
|
+
var BaseInput_1 = require("components/ui/Inputs/BaseInput");
|
|
49
|
+
var Buttons_1 = require("components/ui/Buttons");
|
|
50
|
+
var store_1 = require("zustandStore/alerts/modal/store");
|
|
51
|
+
var selectors_1 = require("zustandStore/alerts/modal/selectors");
|
|
52
|
+
var types_2 = require("zustandStore/alerts/modal/types");
|
|
53
|
+
var styles = __importStar(require("./AssignEmail.module.css"));
|
|
54
|
+
var types_3 = require("./types");
|
|
55
|
+
var useHookFabric_1 = require("hooks/useHookFabric");
|
|
56
|
+
var ModalContext_1 = require("context/logic/ModalContext");
|
|
57
|
+
var DEFAULT_VALUE = {
|
|
58
|
+
value: '',
|
|
59
|
+
errorText: '',
|
|
60
|
+
};
|
|
61
|
+
// TODO: Props
|
|
62
|
+
var AssignEmail = function (props) {
|
|
63
|
+
var sendCommand = props.sendCommand, updateUserInfo = props.updateUserInfo, status = props.status, setStatus = props.setStatus, classes = props.classes, getUpdateUserData = props.getUpdateUserData, resetFormType = props.resetFormType, _a = props.initialEmail, initialEmail = _a === void 0 ? '' : _a;
|
|
64
|
+
var useProfileInfoController = (0, ModalContext_1.useHookProvider)().useProfileInfoController;
|
|
65
|
+
var _b = (0, react_1.useState)(!!initialEmail), isAllowed = _b[0], setAllow = _b[1];
|
|
66
|
+
var _c = (0, react_1.useState)(initialEmail || ''), email = _c[0], setEmail = _c[1];
|
|
67
|
+
var _d = (0, react_1.useState)(DEFAULT_VALUE), code = _d[0], setCode = _d[1];
|
|
68
|
+
var isNotUpdateBtn = Boolean(!email || !code.value || code.errorText);
|
|
69
|
+
var setModal = (0, store_1.useZustandModalKitStore)(selectors_1.zustandModalKitSelector.closeAndOpenModalAction);
|
|
70
|
+
var _e = (0, useHookFabric_1.useHookFabric)({
|
|
71
|
+
fn: useProfileInfoController,
|
|
72
|
+
}), handleConfirmEmailByCode = _e.handleConfirmEmailByCode, confirmEmailByCodeStatus = _e.confirmEmailByCodeStatus;
|
|
73
|
+
var handleAllowInputCode = function () {
|
|
74
|
+
setAllow(true);
|
|
75
|
+
};
|
|
76
|
+
var changeInput = function (type) { return function (value) {
|
|
77
|
+
if (type === 'code') {
|
|
78
|
+
setCode({
|
|
79
|
+
value: value,
|
|
80
|
+
errorText: '',
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}; };
|
|
85
|
+
var assignEmail = function () {
|
|
86
|
+
if (initialEmail) {
|
|
87
|
+
if (!email || !code.value) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
handleConfirmEmailByCode({ email: email, code: code.value });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
var requestId = types_1.ERequestIds.UpdateUserEmail;
|
|
94
|
+
var key = '29x';
|
|
95
|
+
if (!email || !code.value || !requestId) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
var data = getUpdateUserData({
|
|
99
|
+
email: email,
|
|
100
|
+
requestId: requestId,
|
|
101
|
+
code: code.value,
|
|
102
|
+
});
|
|
103
|
+
console.log('data', data);
|
|
104
|
+
if (!data) {
|
|
105
|
+
console.error('No update user data');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
sendCommand(key, data, true);
|
|
109
|
+
};
|
|
110
|
+
(0, react_1.useEffect)(function () {
|
|
111
|
+
if (code.value.length >= 4) {
|
|
112
|
+
assignEmail();
|
|
113
|
+
}
|
|
114
|
+
}, [code]);
|
|
115
|
+
(0, react_1.useEffect)(function () {
|
|
116
|
+
if ((initialEmail && confirmEmailByCodeStatus === 'success') ||
|
|
117
|
+
status === types_3.UpdateStatus.Success) {
|
|
118
|
+
setStatus(types_3.UpdateStatus.Unknown);
|
|
119
|
+
updateUserInfo('email', email);
|
|
120
|
+
resetFormType();
|
|
121
|
+
setModal(types_2.EModalTypes.Info, {
|
|
122
|
+
text: 'profile.content.myAccount.form.dataChanged',
|
|
123
|
+
specValue: 'profile.content.myAccount.form.email',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}, [status, resetFormType, email]);
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.wrapperEmail, classes) }, { children: [(0, jsx_runtime_1.jsx)(EmailInput_1.EmailInput, { size: "full", onChange: setEmail, callbackFn: handleAllowInputCode, classesWrapper: styles.wrapperEmailInput, label: "profile.content.myAccount.form.email", placeholder: "profile.content.myAccount.form.enterEmail", requestId: types_1.ERequestIds.UpdateUserEmail, sendCommand: sendCommand, classes: styles.wrapperEmailInput, defaultValue: initialEmail, isRestEmail: !!initialEmail }), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "profile.content.myAccount.form.code", size: "full", defaultValue: "", disabled: !isAllowed, onChange: changeInput('code'), classes: styles.wrapperInput }), (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.buttons }, { children: [initialEmail ? ((0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: "profile.content.myAccount.form.verification", color: "primary", disabled: isNotUpdateBtn, size: "--button-full", buttonHeight: "--button-height-l", classes: styles.verificationButton, handleClick: assignEmail, centreText: true })) : ((0, jsx_runtime_1.jsx)(HOCRequestLoader_1.HOCRequestLoader, __assign({ command: "\\\\29x", requestId: types_1.ERequestIds.UpdateUserEmail }, { children: (0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: "profile.content.myAccount.form.verification", color: "primary", disabled: isNotUpdateBtn, size: "--button-full", buttonHeight: "--button-height-l", classes: styles.verificationButton, handleClick: assignEmail, centreText: true }) }))), (0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: "", color: "dark", size: "--button-s", classes: styles.closeButton, handleClick: resetFormType, startIcon: (0, jsx_runtime_1.jsx)(CrossSvg_1.CrossSvg, { width: "10", height: "10", classes: styles.closeButtonSvg }) })] }))] })));
|
|
128
|
+
};
|
|
129
|
+
exports.AssignEmail = AssignEmail;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ERequestIds, RegistrationSubType } from 'react-memory-optimization/dist/lib/binary/types';
|
|
2
|
+
import { UserInfo } from 'react-memory-optimization/dist/lib/store/user/types';
|
|
3
|
+
export declare enum UpdateStatus {
|
|
4
|
+
Unknown = 0,
|
|
5
|
+
Rejected = 1,
|
|
6
|
+
Success = 2
|
|
7
|
+
}
|
|
8
|
+
type UpdateUserProps = {
|
|
9
|
+
phoneNumber?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
code: string;
|
|
12
|
+
requestId: ERequestIds;
|
|
13
|
+
};
|
|
14
|
+
type UpdateUserData = {
|
|
15
|
+
registerType: RegistrationSubType;
|
|
16
|
+
clientId: number;
|
|
17
|
+
appType: string | number;
|
|
18
|
+
surname: string;
|
|
19
|
+
name: string;
|
|
20
|
+
patronymic: string;
|
|
21
|
+
birthDay: number;
|
|
22
|
+
month: number;
|
|
23
|
+
year: number;
|
|
24
|
+
country: string;
|
|
25
|
+
countryId: number;
|
|
26
|
+
city: string;
|
|
27
|
+
cityId: number;
|
|
28
|
+
postal: string;
|
|
29
|
+
regionName: string;
|
|
30
|
+
regionId: number;
|
|
31
|
+
address: string;
|
|
32
|
+
login: string;
|
|
33
|
+
password: string;
|
|
34
|
+
currencyId: number;
|
|
35
|
+
newsletters: number;
|
|
36
|
+
timeZone: number;
|
|
37
|
+
domain: string;
|
|
38
|
+
phoneNumber: string;
|
|
39
|
+
email: string;
|
|
40
|
+
sms: string;
|
|
41
|
+
requestId: ERequestIds;
|
|
42
|
+
};
|
|
43
|
+
export type AssignEmailProps = {
|
|
44
|
+
resetFormType: () => void;
|
|
45
|
+
sendCommand: any;
|
|
46
|
+
status: UpdateStatus;
|
|
47
|
+
setStatus: (status: UpdateStatus) => void;
|
|
48
|
+
getUpdateUserData: (data: UpdateUserProps) => UpdateUserData | null;
|
|
49
|
+
updateUserInfo: (key: keyof UserInfo, value: string | number | null) => void;
|
|
50
|
+
inputLabelType?: 'labelUp' | 'base' | 'secondary' | 'separated' | 'secondaryUp';
|
|
51
|
+
classes?: string;
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateStatus = void 0;
|
|
4
|
+
var UpdateStatus;
|
|
5
|
+
(function (UpdateStatus) {
|
|
6
|
+
UpdateStatus[UpdateStatus["Unknown"] = 0] = "Unknown";
|
|
7
|
+
UpdateStatus[UpdateStatus["Rejected"] = 1] = "Rejected";
|
|
8
|
+
UpdateStatus[UpdateStatus["Success"] = 2] = "Success";
|
|
9
|
+
})(UpdateStatus = exports.UpdateStatus || (exports.UpdateStatus = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.EditPencilSvg = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var EditPencilSvg = function (props) {
|
|
17
|
+
var _a = props.width, width = _a === void 0 ? '12' : _a, _b = props.height, height = _b === void 0 ? '14' : _b, classes = props.classes, handleClick = props.handleClick;
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 12 14", fill: "none" }, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.7763 0.621683C11.6052 1.45059 11.6052 2.79452 10.7763 3.62343L10.2974 4.10231C10.2777 4.09578 10.2577 4.08901 10.2375 4.08199C9.73166 3.9065 9.06856 3.57538 8.44567 2.95249C7.82278 2.3296 7.49167 1.6665 7.31617 1.16067C7.30912 1.14034 7.30232 1.12027 7.29576 1.10047L7.77455 0.621683C8.60346 -0.207228 9.94739 -0.207228 10.7763 0.621683ZM5.67659 8.72314C5.36508 9.03466 5.2093 9.19044 5.03755 9.32439C4.83495 9.48242 4.61574 9.61789 4.3838 9.72843C4.18718 9.82214 3.97819 9.8918 3.56024 10.0311L1.35622 10.7658C1.15054 10.8344 0.923774 10.7808 0.770468 10.6275C0.617162 10.4742 0.56363 10.2474 0.632191 10.0418L1.36686 7.83775C1.50618 7.41979 1.57584 7.21081 1.66955 7.01418C1.78009 6.78224 1.91557 6.56303 2.07359 6.36043C2.20754 6.18869 2.36331 6.03292 2.67481 5.72142L2.67484 5.72139L6.6669 1.72933C6.89302 2.2727 7.26448 2.91631 7.87317 3.52499C8.48176 4.13359 9.12526 4.50503 9.66857 4.73116L5.67659 8.72314ZM0.602704 12.988C0.323234 12.988 0.0966797 13.2146 0.0966797 13.494C0.0966797 13.7735 0.323234 14.0001 0.602704 14.0001H11.3979C11.6774 14.0001 11.9039 13.7735 11.9039 13.494C11.9039 13.2146 11.6774 12.988 11.3979 12.988H0.602704Z", fill: "var(--edit-pencil-svg-path-fill, var(--base-0))" }) })));
|
|
19
|
+
};
|
|
20
|
+
exports.EditPencilSvg = EditPencilSvg;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.UnverifiedSvg = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var UnverifiedSvg = function (props) {
|
|
17
|
+
var _a = props.width, width = _a === void 0 ? '24' : _a, _b = props.height, height = _b === void 0 ? '24' : _b, classes = props.classes, handleClick = props.handleClick;
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("svg", __assign({ width: width, height: height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: classes, onClick: handleClick }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V12C12.75 12.4142 12.4142 12.75 12 12.75C11.5858 12.75 11.25 12.4142 11.25 12V8C11.25 7.58579 11.5858 7.25 12 7.25Z", fill: "#E2516C" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 16C12.5523 16 13 15.5523 13 15C13 14.4477 12.5523 14 12 14C11.4477 14 11 14.4477 11 15C11 15.5523 11.4477 16 12 16Z", fill: "#E2516C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.72339 2.05112C10.1673 1.55658 11.0625 1.25 12 1.25C12.9375 1.25 13.8327 1.55658 15.2766 2.05112L16.004 2.30013C17.4854 2.8072 18.6286 3.19852 19.447 3.53099C19.8592 3.69846 20.2136 3.86067 20.499 4.02641C20.7737 4.1859 21.0492 4.38484 21.2364 4.65154C21.4214 4.91516 21.5171 5.23924 21.5772 5.55122C21.6397 5.87556 21.6774 6.26464 21.7017 6.71136C21.75 7.5984 21.75 8.81361 21.75 10.3898V11.9914C21.75 18.0924 17.142 21.0175 14.4017 22.2146L14.3746 22.2264C14.0348 22.3749 13.7154 22.5144 13.3484 22.6084C12.9609 22.7076 12.5493 22.75 12 22.75C11.4507 22.75 11.0391 22.7076 10.6516 22.6084C10.2846 22.5144 9.96523 22.3749 9.62543 22.2264L9.59833 22.2146C6.85803 21.0175 2.25 18.0924 2.25 11.9914V10.3899C2.25 8.81366 2.25 7.59841 2.2983 6.71136C2.32262 6.26464 2.36031 5.87556 2.42281 5.55122C2.48293 5.23924 2.5786 4.91516 2.76363 4.65154C2.95082 4.38484 3.22634 4.1859 3.50098 4.02641C3.78637 3.86067 4.14078 3.69846 4.55303 3.53099C5.3714 3.19852 6.51462 2.8072 7.99595 2.30014L8.72339 2.05112ZM12 2.75C11.3423 2.75 10.6951 2.96164 9.08062 3.5143L8.5078 3.71037C6.99521 4.22814 5.8921 4.60605 5.11759 4.92069C4.731 5.07774 4.4509 5.20935 4.25429 5.32353C4.15722 5.3799 4.09034 5.42642 4.04567 5.46273C4.0078 5.49351 3.99336 5.51095 3.99129 5.51349C3.98936 5.51663 3.97693 5.5374 3.95943 5.58654C3.93944 5.64265 3.91729 5.72309 3.89571 5.83506C3.85204 6.06169 3.81894 6.37301 3.79608 6.79292C3.75028 7.63411 3.75 8.80833 3.75 10.4167V11.9914C3.75 17.1665 7.6199 19.7135 10.1988 20.84C10.5703 21.0023 10.7848 21.0941 11.0236 21.1552C11.2517 21.2136 11.53 21.25 12 21.25C12.47 21.25 12.7483 21.2136 12.9764 21.1552C13.2152 21.0941 13.4297 21.0023 13.8012 20.84C16.3801 19.7135 20.25 17.1665 20.25 11.9914V10.4167C20.25 8.80833 20.2497 7.63411 20.2039 6.79292C20.1811 6.37301 20.148 6.06169 20.1043 5.83506C20.0827 5.72309 20.0606 5.64265 20.0406 5.58654C20.0231 5.53737 20.0106 5.5166 20.0087 5.51348C20.0066 5.51092 19.9922 5.49349 19.9543 5.46273C19.9097 5.42642 19.8428 5.3799 19.7457 5.32353C19.5491 5.20935 19.269 5.07774 18.8824 4.92069C18.1079 4.60605 17.0048 4.22814 15.4922 3.71037L14.9194 3.5143C13.3049 2.96164 12.6577 2.75 12 2.75Z", fill: "#E2516C" })] })));
|
|
19
|
+
};
|
|
20
|
+
exports.UnverifiedSvg = UnverifiedSvg;
|
|
@@ -15,6 +15,6 @@ exports.TwitterSvg = void 0;
|
|
|
15
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
var TwitterSvg = function (props) {
|
|
17
17
|
var _a = props.width, width = _a === void 0 ? '18' : _a, _b = props.height, height = _b === void 0 ? '14' : _b, classes = props.classes;
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: width, height: height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: classes }, { children: (0, jsx_runtime_1.jsx)("path", {
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: width, height: height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: classes }, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.6667 3.66817C15.6667 3.66768 15.6667 3.66719 15.6667 3.66671C15.6667 3.66666 15.6667 3.66661 15.6667 3.66656L17.2292 1.98064C17.4839 1.70583 17.2548 1.26307 16.8834 1.31219L14.9257 1.57111C14.3146 0.816091 13.3804 0.333374 12.3334 0.333374C10.4924 0.333374 9.00004 1.82576 9.00004 3.66671C9.00004 4.10624 9.08511 4.52591 9.23968 4.91014C6.74269 4.85175 4.06912 4.35765 2.71742 1.67954C2.55016 1.34815 2.07066 1.32895 1.96418 1.68457C0.98607 4.95124 2.70742 9.19562 6.49986 10.3334C5.55379 11.2584 3.12181 11.5096 1.13163 11.3273C0.744351 11.2918 0.501222 11.733 0.800709 11.9811C2.46948 13.3635 4.78396 13.6667 6.91659 13.6667C12.3327 13.6667 16.0825 9.08419 15.6667 3.66817Z", fill: "rgb(var(--gray))" }) })));
|
|
19
19
|
};
|
|
20
20
|
exports.TwitterSvg = TwitterSvg;
|
|
@@ -48,12 +48,12 @@ var Text_1 = require("components/Text");
|
|
|
48
48
|
var useTranslate_1 = require("hooks/useTranslate");
|
|
49
49
|
var styles = __importStar(require("./BaseInputUi.module.css"));
|
|
50
50
|
var BaseInputUi = function (props) {
|
|
51
|
-
var _a, _b, _c;
|
|
52
|
-
var startIcon = props.startIcon, value = props.value, type = props.type, placeholder = props.placeholder, handleChange = props.handleChange, children = props.children, isHidePlaceholder = props.isHidePlaceholder, inputLabelType = props.inputLabelType, errorText = props.errorText, inputStyleType = props.inputStyleType, size = props.size, classes = props.classes, inputMode = props.inputMode, disabled = props.disabled,
|
|
51
|
+
var _a, _b, _c, _d;
|
|
52
|
+
var startIcon = props.startIcon, value = props.value, type = props.type, placeholder = props.placeholder, handleChange = props.handleChange, children = props.children, isHidePlaceholder = props.isHidePlaceholder, inputLabelType = props.inputLabelType, errorText = props.errorText, inputStyleType = props.inputStyleType, size = props.size, classes = props.classes, inputMode = props.inputMode, disabled = props.disabled, _e = props.bottomText, bottomText = _e === void 0 ? '' : _e, _f = props.withErrorSvg, withErrorSvg = _f === void 0 ? false : _f, onFocus = props.onFocus, _g = props.withClearValue, withClearValue = _g === void 0 ? false : _g, handleClearInputValue = props.handleClearInputValue, labelClasses = props.labelClasses, inputClasses = props.inputClasses, inputWrapperClasses = props.inputWrapperClasses, label = props.label, classesChildrenWrapper = props.classesChildrenWrapper, autoComplete = props.autoComplete;
|
|
53
53
|
var getText = (0, useTranslate_1.useTranslate)('', '').getText;
|
|
54
54
|
var isBorderColorful = inputStyleType === 'border-colorful';
|
|
55
55
|
var sizeModifier = "inputWrapperSize-".concat(size);
|
|
56
|
-
var
|
|
56
|
+
var _h = (0, react_1.useState)(false), isFocused = _h[0], setFocusState = _h[1];
|
|
57
57
|
var handleFocus = function () {
|
|
58
58
|
setFocusState(true);
|
|
59
59
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
@@ -61,20 +61,21 @@ var BaseInputUi = function (props) {
|
|
|
61
61
|
var handleBlur = function () {
|
|
62
62
|
setFocusState(false);
|
|
63
63
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// [styles.hideLabel]: isHidePlaceholder,
|
|
67
|
-
}, labelClasses) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: label }) }))), (0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.inputWrapper, (_a = {},
|
|
64
|
+
var isLabelOnTop = inputLabelType === 'separated' || inputLabelType === 'secondaryUp';
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.mainContainer, styles[sizeModifier], classes) }, { children: [label && isLabelOnTop && ((0, jsx_runtime_1.jsx)("label", __assign({ className: (0, classnames_1.default)(styles.labelTop, labelClasses) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: label }) }))), (0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.inputWrapper, (_a = {},
|
|
68
66
|
_a[styles.fistIcon] = startIcon,
|
|
69
67
|
_a[styles.borderColorfulGreen] = isBorderColorful && isFocused,
|
|
70
68
|
_a[styles.borderColorfulRed] = errorText,
|
|
71
69
|
_a), inputWrapperClasses) }, { children: [startIcon, (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.inputWithLabel }, { children: [(0, jsx_runtime_1.jsx)("input", { onFocus: handleFocus, onBlur: handleBlur, inputMode: inputMode, className: (0, classnames_1.default)(styles.input, (_b = {},
|
|
72
70
|
_b[styles.disabled] = disabled,
|
|
73
|
-
_b[styles.
|
|
74
|
-
_b
|
|
71
|
+
_b[styles.secondary] = inputLabelType === 'secondary',
|
|
72
|
+
_b[styles.secondaryUp] = inputLabelType === 'secondaryUp',
|
|
73
|
+
_b), inputClasses), value: value, type: type, placeholder: placeholder ? getText(placeholder) : '', onChange: handleChange, autoComplete: autoComplete }), label && !isLabelOnTop && ((0, jsx_runtime_1.jsx)("label", __assign({ className: (0, classnames_1.default)(styles.label, (_c = {},
|
|
75
74
|
_c[styles.labelRight] = startIcon,
|
|
76
75
|
_c[styles.hideLabel] = isHidePlaceholder,
|
|
77
76
|
_c[styles.labelUp] = inputLabelType === 'labelUp' || value,
|
|
78
|
-
_c), labelClasses) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: label }) })))] })), value && withClearValue && !errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.searchButton, styles.clearButton), onClick: handleClearInputValue }, { children: (0, jsx_runtime_1.jsx)(CrossSvg_1.CrossSvg, { classes: styles.crossSvg }) }))), value && withClearValue && errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.searchButton }, { children: (0, jsx_runtime_1.jsx)(WarningSvg_1.WarningSvg, {}) }))), children && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.rowChildrenData, classesChildrenWrapper) }, { children: children }))), errorText && withErrorSvg && ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.rowChildrenData }, { children: (0, jsx_runtime_1.jsx)(inputError_svg_1.ReactComponent, {}) }))), !errorText && bottomText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.errorText, styles.animationFadeIn, styles.resetErrorColor) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: bottomText }) })))] })), errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.errorText, styles.animationFadeIn
|
|
77
|
+
_c), labelClasses) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: label }) })))] })), value && withClearValue && !errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.searchButton, styles.clearButton), onClick: handleClearInputValue }, { children: (0, jsx_runtime_1.jsx)(CrossSvg_1.CrossSvg, { classes: styles.crossSvg }) }))), value && withClearValue && errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.searchButton }, { children: (0, jsx_runtime_1.jsx)(WarningSvg_1.WarningSvg, {}) }))), children && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.rowChildrenData, classesChildrenWrapper) }, { children: children }))), errorText && withErrorSvg && ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.rowChildrenData }, { children: (0, jsx_runtime_1.jsx)(inputError_svg_1.ReactComponent, {}) }))), !errorText && bottomText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.errorText, styles.animationFadeIn, styles.resetErrorColor) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: bottomText }) })))] })), errorText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.errorText, styles.animationFadeIn, (_d = {},
|
|
78
|
+
_d[styles.errorTextAbsolute] = inputLabelType === 'secondaryUp',
|
|
79
|
+
_d)) }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: errorText }) })))] })));
|
|
79
80
|
};
|
|
80
81
|
exports.BaseInputUi = BaseInputUi;
|
|
@@ -3,7 +3,7 @@ import { Size } from 'types/ui';
|
|
|
3
3
|
export type BaseInputProps = InputBase;
|
|
4
4
|
type InputBase = {
|
|
5
5
|
inputMode?: 'tel' | 'numeric' | 'email' | 'search' | 'none';
|
|
6
|
-
inputLabelType?: 'labelUp' | 'base' | 'secondary' | 'separated';
|
|
6
|
+
inputLabelType?: 'labelUp' | 'base' | 'secondary' | 'separated' | 'secondaryUp';
|
|
7
7
|
inputStyleType?: 'base' | 'border-colorful';
|
|
8
8
|
defaultValue?: string;
|
|
9
9
|
placeholder?: string;
|
|
@@ -29,6 +29,7 @@ type InputBase = {
|
|
|
29
29
|
inputClasses?: string;
|
|
30
30
|
inputWrapperClasses?: string;
|
|
31
31
|
label?: string;
|
|
32
|
+
autoComplete?: 'username' | 'tel';
|
|
32
33
|
};
|
|
33
34
|
export type DefaultInputType = {
|
|
34
35
|
value: string;
|
|
@@ -7,11 +7,15 @@ type Props = BaseInputProps & {
|
|
|
7
7
|
requestId: ERequestIds;
|
|
8
8
|
classesWrapper?: string;
|
|
9
9
|
requestCallback?: () => void;
|
|
10
|
+
callbackFn?: () => void;
|
|
11
|
+
isRestEmail?: boolean;
|
|
10
12
|
} | {
|
|
11
13
|
withoutConfirmCode: true;
|
|
12
14
|
classesWrapper?: string;
|
|
13
15
|
requestId?: ERequestIds;
|
|
14
16
|
requestCallback?: () => void;
|
|
17
|
+
callbackFn?: () => void;
|
|
18
|
+
isRestEmail?: boolean;
|
|
15
19
|
});
|
|
16
|
-
export declare const EmailInput: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const EmailInput: (props: Props | any) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export {};
|
|
@@ -10,6 +10,65 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
13
72
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
74
|
};
|
|
@@ -23,25 +82,45 @@ var BaseInput_1 = require("../BaseInput");
|
|
|
23
82
|
var constant_1 = require("../BaseInput/constant");
|
|
24
83
|
var selectors_1 = require("zustandStore/settings/selectors");
|
|
25
84
|
var store_1 = require("zustandStore/settings/store");
|
|
85
|
+
var ModalContext_1 = require("context/logic/ModalContext");
|
|
86
|
+
var useHookFabric_1 = require("hooks/useHookFabric");
|
|
26
87
|
var validation_1 = require("service/validation");
|
|
88
|
+
var styles = __importStar(require("./EmailInput.module.css"));
|
|
27
89
|
var EmailInput = function (props) {
|
|
28
|
-
var requestId = props.requestId, children = props.children, classesWrapper = props.classesWrapper, requestCallback = props.requestCallback, onChange = props.onChange, withoutConfirmCode = props.withoutConfirmCode, sendCommand = props.sendCommand, errorText = props.errorText;
|
|
29
|
-
var
|
|
30
|
-
var _b = (0, react_1.useState)(
|
|
90
|
+
var requestId = props.requestId, children = props.children, classesWrapper = props.classesWrapper, requestCallback = props.requestCallback, onChange = props.onChange, withoutConfirmCode = props.withoutConfirmCode, sendCommand = props.sendCommand, errorText = props.errorText, callbackFn = props.callbackFn, _a = props.isRestEmail, isRestEmail = _a === void 0 ? false : _a, defaultValue = props.defaultValue;
|
|
91
|
+
var useProfileInfoController = (0, ModalContext_1.useHookProvider)().useProfileInfoController;
|
|
92
|
+
var _b = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), email = _b[0], setEmail = _b[1];
|
|
93
|
+
var _c = (0, react_1.useState)(false), isRequestedCode = _c[0], setRequestedCodeStatus = _c[1];
|
|
31
94
|
var appType = (0, store_1.useZustandKitSettings)(selectors_1.getKitAppTypeSelector);
|
|
32
95
|
var isValidEmail = (0, react_1.useMemo)(function () { return email.value && !email.errorText; }, [email]);
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var baseData
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
96
|
+
var _d = (0, useHookFabric_1.useHookFabric)({
|
|
97
|
+
fn: useProfileInfoController,
|
|
98
|
+
}), handleConfirmEmail = _d.handleConfirmEmail, confirmStatus = _d.confirmStatus;
|
|
99
|
+
var handleRequestCode = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
100
|
+
var res, baseData, baseKey;
|
|
101
|
+
return __generator(this, function (_a) {
|
|
102
|
+
switch (_a.label) {
|
|
103
|
+
case 0:
|
|
104
|
+
if (withoutConfirmCode) {
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
if (!isRestEmail) return [3 /*break*/, 2];
|
|
108
|
+
return [4 /*yield*/, handleConfirmEmail(email.value)];
|
|
109
|
+
case 1:
|
|
110
|
+
res = _a.sent();
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
case 2:
|
|
113
|
+
baseData = {
|
|
114
|
+
appType: appType,
|
|
115
|
+
value: email.value,
|
|
116
|
+
requestId: requestId,
|
|
117
|
+
};
|
|
118
|
+
baseKey = '10x';
|
|
119
|
+
sendCommand(baseKey, baseData);
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); };
|
|
45
124
|
var handleSetValue = function (value) {
|
|
46
125
|
var errorText = (0, validation_1.composeValidations)([
|
|
47
126
|
(0, validation_1.isRequired)({ value: value, errorText: 'errors.required' }),
|
|
@@ -58,7 +137,21 @@ var EmailInput = function (props) {
|
|
|
58
137
|
handleRequestCode();
|
|
59
138
|
setRequestedCodeStatus(true);
|
|
60
139
|
requestCallback === null || requestCallback === void 0 ? void 0 : requestCallback();
|
|
140
|
+
callbackFn === null || callbackFn === void 0 ? void 0 : callbackFn();
|
|
61
141
|
};
|
|
62
|
-
|
|
142
|
+
(0, react_1.useEffect)(function () {
|
|
143
|
+
if (!defaultValue) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
var errorText = (0, validation_1.composeValidations)([
|
|
147
|
+
(0, validation_1.isRequired)({ value: defaultValue, errorText: 'errors.required' }),
|
|
148
|
+
(0, validation_1.isEmail)({ value: defaultValue, errorText: 'errors.email' }),
|
|
149
|
+
]);
|
|
150
|
+
setEmail({ value: defaultValue, errorText: errorText });
|
|
151
|
+
if (!errorText) {
|
|
152
|
+
onChange(defaultValue);
|
|
153
|
+
}
|
|
154
|
+
}, [defaultValue, onChange]);
|
|
155
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: classesWrapper }, { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.row }, { children: [(0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, __assign({}, props, { onChange: handleSetValue, errorText: errorText || email.errorText, inputMode: "email", classes: styles.emailInput, defaultValue: defaultValue }, { children: children })), !withoutConfirmCode ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isRequestedCode ? ((0, jsx_runtime_1.jsx)(Timer_1.default, { handleRequestCode: handleRequestCode, classes: styles.timerBlock, timerTextClasses: styles.timerText, textBlockClasses: styles.timerTextBlock, buttonClasses: styles.getCodeButton })) : ((0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { color: "primary", handleClick: showTimer, disabled: !isValidEmail || isRequestedCode, size: "--button-xl", buttonHeight: "--button-height-l", text: "getCodeBtn", centreText: true, classes: styles.getCodeButton })) })) : undefined] })) })));
|
|
63
156
|
};
|
|
64
157
|
exports.EmailInput = EmailInput;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
handleRequestCode: () => void;
|
|
3
3
|
timerTextClasses?: string;
|
|
4
|
+
classes?: string;
|
|
5
|
+
textBlockClasses?: string;
|
|
6
|
+
buttonClasses?: string;
|
|
4
7
|
};
|
|
5
|
-
declare const Timer: (
|
|
8
|
+
declare const Timer: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export default Timer;
|
|
@@ -33,17 +33,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
40
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
41
|
var react_1 = require("react");
|
|
39
|
-
var
|
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
40
43
|
var Buttons_1 = require("../Buttons");
|
|
41
|
-
var useCountDown_1 = require("hooks/useCountDown");
|
|
42
44
|
var Text_1 = require("components/Text");
|
|
45
|
+
var useCountDown_1 = require("hooks/useCountDown");
|
|
46
|
+
var constants_1 = require("./constants");
|
|
43
47
|
var styles = __importStar(require("./Timer.module.css"));
|
|
44
|
-
var Timer = function (
|
|
45
|
-
var handleRequestCode =
|
|
46
|
-
var
|
|
48
|
+
var Timer = function (props) {
|
|
49
|
+
var handleRequestCode = props.handleRequestCode, timerTextClasses = props.timerTextClasses, classes = props.classes, textBlockClasses = props.textBlockClasses, buttonClasses = props.buttonClasses;
|
|
50
|
+
var _a = (0, react_1.useState)(false), isShowButton = _a[0], setButtonState = _a[1];
|
|
47
51
|
var timerValue = (0, react_1.useRef)(new Date().getTime() + constants_1.DEFAULT_TIMER_VALUE);
|
|
48
52
|
var callback = function () {
|
|
49
53
|
setButtonState(true);
|
|
@@ -57,6 +61,6 @@ var Timer = function (_a) {
|
|
|
57
61
|
handleRequestCode();
|
|
58
62
|
setButtonState(false);
|
|
59
63
|
};
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.wrapperTimer }, { children: !isShowButton ? ((0, jsx_runtime_1.jsxs)(
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.wrapperTimer, classes) }, { children: !isShowButton ? ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)(styles.textBlock, textBlockClasses) }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: timerTextClasses }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: "getAgainAfterTime" }) })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.time }, { children: [countDown.formatTime[2], ":", countDown.formatTime[3]] }))] }))) : ((0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: "getCodeBtn", color: "primary", handleClick: handleResend, size: "--button-full", buttonHeight: "--button-height-l", centreText: true, classes: buttonClasses })) })));
|
|
61
65
|
};
|
|
62
66
|
exports.default = Timer;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -180,7 +180,9 @@ import { UkrSvg } from 'components/ui/Icons/FlagIcons/UkrSvg';
|
|
|
180
180
|
import { UzSvg } from 'components/ui/Icons/FlagIcons/UzSvg';
|
|
181
181
|
import { PKSvg } from 'components/ui/Icons/FlagIcons/PKSvg';
|
|
182
182
|
import { UrSvg } from 'components/ui/Icons/FlagIcons/UrSvg';
|
|
183
|
+
import { UnverifiedSvg } from 'components/ui/Icons/Profile/UnverifiedSvg';
|
|
183
184
|
import { VerifiedSvg } from 'components/ui/Icons/Profile/VerifiedSvg';
|
|
185
|
+
import { EditPencilSvg } from 'components/ui/Icons/Profile/EditPencilSvg';
|
|
184
186
|
import { TournamentWagerSvg } from './components/ui/Icons/Casino/TournamentWagerSvg';
|
|
185
187
|
import { ProvidersSvg } from 'components/ui/Icons/Casino/ProvidersSvg';
|
|
186
188
|
import { DefaultImgSvg } from 'components/ui/Icons/Casino/DefaultImgSvg';
|
|
@@ -233,6 +235,7 @@ import { NavCasinoSvg } from 'components/ui/Icons/Navigation/NavCasinoSvg';
|
|
|
233
235
|
import { NavBonusesSvg } from 'components/ui/Icons/Navigation/NavBonusesSvg';
|
|
234
236
|
import { NavBettingLiveSvg } from 'components/ui/Icons/Navigation/NavBettingLiveSvg';
|
|
235
237
|
import { NavBettingSvg } from 'components/ui/Icons/Navigation/NavBettingSvg';
|
|
238
|
+
import { AssignEmail } from 'components/Profile/AssignEmail';
|
|
236
239
|
import { getCasinoCategoryIcon } from 'components/ui/Icons/Categories';
|
|
237
240
|
import { NotFoundData } from 'components/ui/NotFoundData';
|
|
238
241
|
import { ClaimBonus } from 'components/ui/Bonuses/ClaimBonus';
|
|
@@ -305,7 +308,7 @@ import { getFlagIcon, getVipClubIcon, getSportIcon, getHorizontalFlagIcon } from
|
|
|
305
308
|
import { composeValidations, isEmail, isPassword, isRequired, upperCase, prepareStringAsPhoneNumber, extractNumbersFromString, isMinMax, isFilledForm, validationBankCode, validationNameSurname, validationPatternByName, replaceValueByMask, replaceValueByMaskReturnMask, replaceCodeToMask, validateEmailValue, validateAccountName, validateAccountNumber, validateBankCode, isPhone, validationTRC, validateLuhnAlgorithm, valdiationCardNumber } from 'service/validation';
|
|
306
309
|
import { setToLocalStorage, getFromLocalStorage, removeFromLocalStorage } from 'utils/localstorage';
|
|
307
310
|
import { formattedDate, getNext15thDate, getNextSaturday } from 'utils/date';
|
|
308
|
-
export { Logo, BaseButton, CloseButton, DrawerButton, AppSwitcher, CasinoCategoryButton, CasinoSubCategoriesButton, ProviderNameButton, DepositButton, ShowAllCard, ArrowButton, ButtonLanguage, FavoriteButton, SocialMediaButton, ButtonCancelBonus, BaseInput, BaseInputUi, PhoneInput, CheckBox, EmailInput, PasswordInput, CasinoSearchBlock, CasinoSearchInput, JivoChatButton, JivoChatButtonProps, PaymentsMethods, PaymentMethodProps, EActiveMethodTab, PaymentFrame, PaymentMessage, DepositSkelet, DepositSkeletProps, DepositQrFormProps, PopUpHeader, PageTitle, LeftSection, Footer, XACFooter, Tabs, MainLoader, CircularLoader, Image, SkeletLoader, BonusCancelLoader, BettingSkelet, HOCImageLoader, HOCOutsideClick, HOCErrorBoundary, HOCRequestLoader, HOCKitConfigure, useHookFabric, useElementResize, useOnClickOutside, useCountDown, useTranslate, useInView, useHotJarAnalytics, useHotJarControllers, useIFrameMode, Presets, Wheel, Scratch, TournamentCard, ReferralTable, ReferralTableProps, ReferralTitle, ReferralCard, ReferralDetails, ReferralShare, ReferralCopyContent, ReferralInviteBanner, ReferralBonus, Pagination, ModalLayout, Alerts, BonusCardLayout, DrawerLayout, LandingLayoutTemplate, PortalLayout, CountDown, LastBigWinners, Banners, PromotionMobileApp, PromotionBanner, OneClick, DocsCheckBox, CurrencySelector, CountrySelector, RegistrationPromoCode, SignUp, SignUpTypeTwo, SignUpTypeThree, EmailSignUp, PhoneSignUp, Selector, LanguageSelector, SignIn, SignInThird, IconProps, ArrowSvg, DownloadSvg, LockSvg, CloseSvg, CrossSvg, JabiInHouseSvg, ProviderSvg, HotSvg, WagerSvg, ElonHouseSvg, FSWinHouseSvg, ElonTreasureSvg, FSWinTreasureSvg, JabibetTreasureSvg, PlaySvg, InfoSvg, InstagramSvg, TelegramSvg, FacebookSvg, AvatarSvg, ProfileSvg, BonusGiftSvg, BurgerSvg, CalendarSvg, CashSvg, CloseEyeSvg, OpenEyeSvg, CoinSvg, CoinsSvg, CopySvg, DocSvg, FavoritesSvg, GoogleSvg, GrowSvg, DrawerTogglerSvg, LotterySvg, InfoLotterySvg, PlusSvg, SearchSvg, ProvidersBlocksSvg, SelectedSvg, ShareSvg, StarSvg, SupportSvg, ThreeDotsSvg, TrashSvg, WalletSvg, FirstBonusSvg, SecondBonusSvg, ThirdBonusSvg, VipClubSvg, InfoSecondSvg, FireSvg, AddCircleSvg, MinusCircleSvg, BronzeSvg, SilverSvg, DiamondSvg, GoldSvg, GreenSvg, PlatinumSvg, PlatinumOneSvg, AzeSvg, BnSvg, BsSvg, ChSvg, DeSvg, EnSvg, EsSvg, FrSvg, HiSvg, ItSvg, KoSvg, KzSvg, NoSvg, PtSvg, PhpSvg, RoSvg, RuSvg, TrSvg, UkrSvg, UzSvg, PKSvg, UrSvg, VerifiedSvg, TournamentWagerSvg, ProvidersSvg, DefaultImgSvg, CasinoCoinSvg, RecommendedSvg, DepositSvg, ErrorSvg, SuccessSvg, WaitingSvg, WithdrawSvg, SecondErrorSvg, SecondSuccessSvg, SecondWaitingSvg, AmericanFootballSvg, AussieRulesSvg, BadmintonSvg, BaseballSvg, BasketballSvg, Basketball3x3Svg, BeachSoccerSvg, BoxingSvg, ChessSvg, CricketSvg, DartsSvg, EFifaSvg, ENbaSvg, ENhlSvg, EsportSvg, FieldHockeySvg, FutsalSvg, IceHockeySvg, KabaddiSvg, MmaSvg, RugbySvg, SnookerSvg, SoccerSvg, SquashSvg, TableTennisSvg, TennisSvg, VolleyballSvg, NotFoundBonusesSvg, NotificationWarningSvg, NotificationErrorSvg, NotificationSuccessSvg, Notifications, NavTournamentSvg, NavReferralSvg, NavMyBetsSvg, NavCasinoSvg, NavBonusesSvg, NavBettingLiveSvg, NavBettingSvg, BattlesCard, Step, Section, BattleBanner, Leaderboard, BattleWinners, Winner, Accordion, AccordionGroup, Timer, NotFoundData, ClaimBonus, TitleForm, BalanceList, DesktopProfile, BalanceInfo, DefaultGameImg, Question, FaqSection, FAQ, ProgressBar, ProgressWagering, ProgressBarProps, AppNotify, Carousel, CarouselVipClub, VipSteps, useZustandLanguagesKitStore, languageSelectors, Text, useZustandRecoveryKitStore, zustandRecoveryKitSelectors, useZustandNotificationKitStore, notificationKitSelectors, useZustandModalKitStore, zustandModalKitSelector, useZustandDeviceKitStore, zustandDeviceKitSelector, useZustandRegistrationKitStore, zustandRegistrationKitSelector, useZustandSignInKitStore, zustandSignInKitSelectors, useZustandRequestKitStore, requestSelectors, useZustandCasinoGamesKitStore, gamesSelectors, useZustandConnectionKitStore, connectionSelectors, useZustandWheelPromoKitStore, wheelPromoSelectors, EDirection, searchSelectors, useZustandCasinoSearchKitStore, useZustandSupportKitStore, supportSelectors, useZustandCasinoDrawerKitStore, casinoDrawerKitSelectors, getCasinoCategoryIcon, sleep, getAuthorizationData, getRegistrationData, copyToClipboard, getFlagIcon, getVipClubIcon, getSportIcon, getHorizontalFlagIcon, composeValidations, isEmail, isPassword, isRequired, upperCase, prepareStringAsPhoneNumber, extractNumbersFromString, isMinMax, isFilledForm, validationBankCode, validationNameSurname, validationPatternByName, replaceValueByMask, replaceValueByMaskReturnMask, replaceCodeToMask, validateEmailValue, validateAccountName, validateAccountNumber, validateBankCode, isPhone, validationTRC, validateLuhnAlgorithm, valdiationCardNumber, getValueByIdFromUrl, setToLocalStorage, getFromLocalStorage, removeFromLocalStorage, formattedDate, getNext15thDate, getNextSaturday, };
|
|
311
|
+
export { Logo, BaseButton, CloseButton, DrawerButton, AppSwitcher, CasinoCategoryButton, CasinoSubCategoriesButton, ProviderNameButton, DepositButton, ShowAllCard, ArrowButton, ButtonLanguage, FavoriteButton, SocialMediaButton, ButtonCancelBonus, BaseInput, BaseInputUi, PhoneInput, CheckBox, EmailInput, PasswordInput, CasinoSearchBlock, CasinoSearchInput, JivoChatButton, JivoChatButtonProps, PaymentsMethods, PaymentMethodProps, EActiveMethodTab, PaymentFrame, PaymentMessage, DepositSkelet, DepositSkeletProps, DepositQrFormProps, PopUpHeader, PageTitle, LeftSection, Footer, XACFooter, Tabs, MainLoader, CircularLoader, Image, SkeletLoader, BonusCancelLoader, BettingSkelet, HOCImageLoader, HOCOutsideClick, HOCErrorBoundary, HOCRequestLoader, HOCKitConfigure, useHookFabric, useElementResize, useOnClickOutside, useCountDown, useTranslate, useInView, useHotJarAnalytics, useHotJarControllers, useIFrameMode, Presets, Wheel, Scratch, TournamentCard, ReferralTable, ReferralTableProps, ReferralTitle, ReferralCard, ReferralDetails, ReferralShare, ReferralCopyContent, ReferralInviteBanner, ReferralBonus, Pagination, ModalLayout, Alerts, BonusCardLayout, DrawerLayout, LandingLayoutTemplate, PortalLayout, CountDown, LastBigWinners, Banners, PromotionMobileApp, PromotionBanner, OneClick, DocsCheckBox, CurrencySelector, CountrySelector, RegistrationPromoCode, SignUp, SignUpTypeTwo, SignUpTypeThree, EmailSignUp, PhoneSignUp, Selector, LanguageSelector, SignIn, SignInThird, IconProps, ArrowSvg, DownloadSvg, LockSvg, CloseSvg, CrossSvg, JabiInHouseSvg, ProviderSvg, HotSvg, WagerSvg, ElonHouseSvg, FSWinHouseSvg, ElonTreasureSvg, FSWinTreasureSvg, JabibetTreasureSvg, PlaySvg, InfoSvg, InstagramSvg, TelegramSvg, FacebookSvg, AvatarSvg, ProfileSvg, BonusGiftSvg, BurgerSvg, CalendarSvg, CashSvg, CloseEyeSvg, OpenEyeSvg, CoinSvg, CoinsSvg, CopySvg, DocSvg, FavoritesSvg, GoogleSvg, GrowSvg, DrawerTogglerSvg, LotterySvg, InfoLotterySvg, PlusSvg, SearchSvg, ProvidersBlocksSvg, SelectedSvg, ShareSvg, StarSvg, SupportSvg, ThreeDotsSvg, TrashSvg, WalletSvg, FirstBonusSvg, SecondBonusSvg, ThirdBonusSvg, VipClubSvg, InfoSecondSvg, FireSvg, AddCircleSvg, MinusCircleSvg, BronzeSvg, SilverSvg, DiamondSvg, GoldSvg, GreenSvg, PlatinumSvg, PlatinumOneSvg, AzeSvg, BnSvg, BsSvg, ChSvg, DeSvg, EnSvg, EsSvg, FrSvg, HiSvg, ItSvg, KoSvg, KzSvg, NoSvg, PtSvg, PhpSvg, RoSvg, RuSvg, TrSvg, UkrSvg, UzSvg, PKSvg, UrSvg, VerifiedSvg, UnverifiedSvg, EditPencilSvg, TournamentWagerSvg, ProvidersSvg, DefaultImgSvg, CasinoCoinSvg, RecommendedSvg, DepositSvg, ErrorSvg, SuccessSvg, WaitingSvg, WithdrawSvg, SecondErrorSvg, SecondSuccessSvg, SecondWaitingSvg, AmericanFootballSvg, AussieRulesSvg, BadmintonSvg, BaseballSvg, BasketballSvg, Basketball3x3Svg, BeachSoccerSvg, BoxingSvg, ChessSvg, CricketSvg, DartsSvg, EFifaSvg, ENbaSvg, ENhlSvg, EsportSvg, FieldHockeySvg, FutsalSvg, IceHockeySvg, KabaddiSvg, MmaSvg, RugbySvg, SnookerSvg, SoccerSvg, SquashSvg, TableTennisSvg, TennisSvg, VolleyballSvg, NotFoundBonusesSvg, NotificationWarningSvg, NotificationErrorSvg, NotificationSuccessSvg, Notifications, NavTournamentSvg, NavReferralSvg, NavMyBetsSvg, NavCasinoSvg, NavBonusesSvg, NavBettingLiveSvg, NavBettingSvg, BattlesCard, Step, Section, BattleBanner, Leaderboard, BattleWinners, Winner, Accordion, AccordionGroup, Timer, NotFoundData, ClaimBonus, TitleForm, BalanceList, DesktopProfile, BalanceInfo, DefaultGameImg, AssignEmail, Question, FaqSection, FAQ, ProgressBar, ProgressWagering, ProgressBarProps, AppNotify, Carousel, CarouselVipClub, VipSteps, useZustandLanguagesKitStore, languageSelectors, Text, useZustandRecoveryKitStore, zustandRecoveryKitSelectors, useZustandNotificationKitStore, notificationKitSelectors, useZustandModalKitStore, zustandModalKitSelector, useZustandDeviceKitStore, zustandDeviceKitSelector, useZustandRegistrationKitStore, zustandRegistrationKitSelector, useZustandSignInKitStore, zustandSignInKitSelectors, useZustandRequestKitStore, requestSelectors, useZustandCasinoGamesKitStore, gamesSelectors, useZustandConnectionKitStore, connectionSelectors, useZustandWheelPromoKitStore, wheelPromoSelectors, EDirection, searchSelectors, useZustandCasinoSearchKitStore, useZustandSupportKitStore, supportSelectors, useZustandCasinoDrawerKitStore, casinoDrawerKitSelectors, getCasinoCategoryIcon, sleep, getAuthorizationData, getRegistrationData, copyToClipboard, getFlagIcon, getVipClubIcon, getSportIcon, getHorizontalFlagIcon, composeValidations, isEmail, isPassword, isRequired, upperCase, prepareStringAsPhoneNumber, extractNumbersFromString, isMinMax, isFilledForm, validationBankCode, validationNameSurname, validationPatternByName, replaceValueByMask, replaceValueByMaskReturnMask, replaceCodeToMask, validateEmailValue, validateAccountName, validateAccountNumber, validateBankCode, isPhone, validationTRC, validateLuhnAlgorithm, valdiationCardNumber, getValueByIdFromUrl, setToLocalStorage, getFromLocalStorage, removeFromLocalStorage, formattedDate, getNext15thDate, getNextSaturday, };
|
|
309
312
|
export { Size, Color, EAppType } from 'types/ui';
|
|
310
313
|
export { COUNTRY_MOCK } from 'constants/mock';
|
|
311
314
|
export { REFERRAL_KEY, REFERRAL_CODE, } from 'components/SignUp/PromoCode/constants';
|