react-gldn-kit 0.1.4 → 0.1.5
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/dist/index.js +1 -1
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/index.d.ts +3 -1
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/index.js +26 -7
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/index.d.ts +2 -1
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/index.js +2 -2
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/types.d.ts +7 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/types.js +2 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/PhoneSignUp/index.d.ts +2 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/PhoneSignUp/index.js +149 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/PhoneSignUp/types.d.ts +10 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/PhoneSignUp/types.js +2 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/index.js +2 -1
- package/dist/lib/components/ui/Inputs/PhoneInput/index.d.ts +2 -22
- package/dist/lib/components/ui/Inputs/PhoneInput/index.js +11 -7
- package/dist/lib/components/ui/Inputs/PhoneInput/types.d.ts +25 -0
- package/dist/lib/components/ui/Inputs/PhoneInput/types.js +2 -0
- package/dist/lib/components/ui/Timer/constants.d.ts +1 -0
- package/dist/lib/components/ui/Timer/constants.js +4 -0
- package/dist/lib/components/ui/Timer/index.d.ts +5 -0
- package/dist/lib/components/ui/Timer/index.js +62 -0
- package/dist/main.css +79 -0
- package/package.json +1 -1
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.d.ts +0 -5
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.js +0 -129
- /package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/{Phone → PhoneSignUp}/constants.d.ts +0 -0
- /package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/{Phone → PhoneSignUp}/constants.js +0 -0
package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
|
-
var CountrySelector_1 = __importDefault(require("../../CountrySelector"));
|
|
20
|
-
var CurrencySelector_1 = __importDefault(require("../../CurrencySelector"));
|
|
21
|
-
var PromoCode_1 = __importDefault(require("../../PromoCode"));
|
|
22
|
-
var DocsCheckBox_1 = __importDefault(require("../DocsCheckBox"));
|
|
23
|
-
var constants_1 = require("./constants");
|
|
24
|
-
var SignUp_module_css_1 = __importDefault(require("../../../SignUp.module.css"));
|
|
25
|
-
var store_1 = require("zustandStore/forms/signUp/store");
|
|
26
|
-
var selectors_1 = require("zustandStore/forms/signUp/selectors");
|
|
27
|
-
var useTranslate_1 = require("hooks/useTranslate");
|
|
28
|
-
var constant_1 = require("components/ui/Inputs/BaseInput/constant");
|
|
29
|
-
var store_2 = require("zustandStore/languages/store");
|
|
30
|
-
var selectors_2 = require("zustandStore/languages/selectors");
|
|
31
|
-
var BaseInput_1 = require("components/ui/Inputs/BaseInput");
|
|
32
|
-
var BaseButton_1 = require("components/ui/Buttons/BaseButton");
|
|
33
|
-
var PhoneInput_1 = __importDefault(require("components/ui/Inputs/PhoneInput"));
|
|
34
|
-
var Phone = function (_a) {
|
|
35
|
-
var isSelected = _a.isSelected, _b = _a.withoutCode, withoutCode = _b === void 0 ? false : _b;
|
|
36
|
-
var setRegisteredLogin = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setRegisteredLoginAction);
|
|
37
|
-
// const { sendCommand } = useTransportControllers();
|
|
38
|
-
var getText = (0, useTranslate_1.useTranslate)('', '').getText;
|
|
39
|
-
var _c = (0, react_1.useState)(''), phone = _c[0], setPhone = _c[1];
|
|
40
|
-
var _d = (0, react_1.useState)(withoutCode
|
|
41
|
-
? {
|
|
42
|
-
value: ' ',
|
|
43
|
-
errorText: '',
|
|
44
|
-
}
|
|
45
|
-
: constant_1.DEFAULT_INPUT_VALUE), code = _d[0], setCode = _d[1];
|
|
46
|
-
var _e = (0, react_1.useState)(withoutCode), isRequestedCode = _e[0], setRequestedCodeState = _e[1];
|
|
47
|
-
var activeLang = (0, store_2.useZustandLanguagesKitStore)(selectors_2.languageSelectors.getActiveLanguageNameKitSelector);
|
|
48
|
-
var docs = {};
|
|
49
|
-
// useZustandWebConfiguration(getDocsSelector) || {};
|
|
50
|
-
var activeCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCountryIdSelector);
|
|
51
|
-
var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
|
|
52
|
-
var _f = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), password = _f[0], setPassword = _f[1];
|
|
53
|
-
var _g = (0, react_1.useState)(isSelected), terms = _g[0], setTermsState = _g[1];
|
|
54
|
-
var isPhoneError = Boolean(!phone);
|
|
55
|
-
var isDisabledSubmitButton = (0, react_1.useMemo)(function () {
|
|
56
|
-
return Boolean(isPhoneError ||
|
|
57
|
-
!password.value ||
|
|
58
|
-
password.errorText ||
|
|
59
|
-
code.errorText ||
|
|
60
|
-
!code.value ||
|
|
61
|
-
!isRequestedCode ||
|
|
62
|
-
!activeCountryId ||
|
|
63
|
-
!activeCurrencyId ||
|
|
64
|
-
!terms);
|
|
65
|
-
}, [
|
|
66
|
-
isPhoneError,
|
|
67
|
-
password,
|
|
68
|
-
code,
|
|
69
|
-
isRequestedCode,
|
|
70
|
-
activeCountryId,
|
|
71
|
-
activeCurrencyId,
|
|
72
|
-
terms,
|
|
73
|
-
]);
|
|
74
|
-
var _h = (0, react_1.useState)(''), promoCode = _h[0], setPromoCode = _h[1];
|
|
75
|
-
var handleIsRequested = function () {
|
|
76
|
-
setRequestedCodeState(true);
|
|
77
|
-
};
|
|
78
|
-
var handleChange = function (t) { return function (value) {
|
|
79
|
-
if (t === 'code') {
|
|
80
|
-
setCode({ value: value, errorText: '' });
|
|
81
|
-
}
|
|
82
|
-
if (t === 'password') {
|
|
83
|
-
setPassword({ value: value, errorText: '' });
|
|
84
|
-
}
|
|
85
|
-
}; };
|
|
86
|
-
var handleSubmitForm = function () {
|
|
87
|
-
if (!activeCountryId || !activeCurrencyId) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
// const sendData = {
|
|
91
|
-
// ...getRegistrationData({
|
|
92
|
-
// currencyId: activeCurrencyId,
|
|
93
|
-
// countryId: activeCountryId,
|
|
94
|
-
// registrationType: withoutCode
|
|
95
|
-
// ? RegistrationSubType.PhoneWithoutCode
|
|
96
|
-
// : RegistrationSubType.Phone,
|
|
97
|
-
// promoCode,
|
|
98
|
-
// countryName: '', // TODO back not validate this value
|
|
99
|
-
// }),
|
|
100
|
-
// letter: 0,
|
|
101
|
-
// login: phone,
|
|
102
|
-
// email: '',
|
|
103
|
-
// password: password.value,
|
|
104
|
-
// sms: code.value,
|
|
105
|
-
// requestId: ERequestIds.Registration,
|
|
106
|
-
// };
|
|
107
|
-
// setRegisteredLogin(phone);
|
|
108
|
-
// sendCommand('08x', sendData, true);
|
|
109
|
-
};
|
|
110
|
-
var handleToggleState = function () {
|
|
111
|
-
setTermsState(!terms);
|
|
112
|
-
};
|
|
113
|
-
var handleOpenDoc = function () {
|
|
114
|
-
if (!activeLang) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
// TODO terms
|
|
118
|
-
// const link = docs[1]?.link.replace('[lang]', activeLang);
|
|
119
|
-
// if (!link) {
|
|
120
|
-
// return;
|
|
121
|
-
// }
|
|
122
|
-
// openExternalLink(link, true);
|
|
123
|
-
};
|
|
124
|
-
var PHONE_PROPS = withoutCode
|
|
125
|
-
? constants_1.PHONE_PROPS_WITHOUT_CONFIRMATION
|
|
126
|
-
: constants_1.PHONE_PROPS_WITH_CONFIRMATION;
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PhoneInput_1.default, __assign({}, PHONE_PROPS, { placeholder: "registrations.inputs.phone", size: "full", defaultValue: "+", onChange: setPhone, requestCallback: handleIsRequested, classesWrapper: SignUp_module_css_1.default.marginB, disabled: isRequestedCode, classes: SignUp_module_css_1.default.marginB })), !withoutCode && ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.code", size: "full", isHidePlaceholder: true, disabled: !isRequestedCode, onChange: handleChange('code'), classes: SignUp_module_css_1.default.marginB })), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), classes: SignUp_module_css_1.default.marginB }), (0, jsx_runtime_1.jsx)(PromoCode_1.default, { setPromoCode: setPromoCode }), (0, jsx_runtime_1.jsx)(CountrySelector_1.default, {}), (0, jsx_runtime_1.jsx)(CurrencySelector_1.default, { availableCurrencies: [] }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.default, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, { text: getText('registrations.submitBtn'), disabled: isDisabledSubmitButton, color: "primary", handleClick: handleSubmitForm, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: SignUp_module_css_1.default.marginB })] }));
|
|
128
|
-
};
|
|
129
|
-
exports.default = Phone;
|
|
File without changes
|
|
File without changes
|