react-gldn-kit 0.1.0 → 0.1.2
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/Banners/components/BannerTemplate/index.d.ts +2 -2
- package/dist/lib/components/Banners/types.d.ts +2 -2
- package/dist/lib/components/Modals/Alert/components/Auth/Credentials/index.d.ts +4 -0
- package/dist/lib/components/Modals/Alert/components/Auth/Credentials/index.js +57 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/constants.d.ts +7 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/constants.js +815 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/index.d.ts +5 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/index.js +35 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CurrencySelector/index.d.ts +7 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CurrencySelector/index.js +59 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/DocsCheckBox/index.d.ts +7 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/DocsCheckBox/index.js +35 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/EmailSignUp/index.d.ts +9 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/EmailSignUp/index.js +130 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/index.d.ts +2 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/OneClickKit/index.js +60 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/constants.d.ts +2 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/constants.js +14 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.d.ts +5 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.js +129 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/PromoCode/index.d.ts +6 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/PromoCode/index.js +65 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/index.d.ts +9 -0
- package/dist/lib/components/Modals/Alert/components/Auth/SignUp/index.js +75 -0
- package/dist/lib/components/Modals/Alert/index.d.ts +3 -1
- package/dist/lib/components/Modals/Alert/index.js +16 -13
- package/dist/lib/components/ui/Headers/PopUpHeader/index.js +2 -1
- package/dist/lib/components/ui/Inputs/PhoneInput/index.d.ts +23 -0
- package/dist/lib/components/ui/Inputs/PhoneInput/index.js +125 -0
- package/dist/lib/components/ui/Tabs/index.js +2 -1
- package/dist/lib/hooks/useHookFabric.d.ts +6 -0
- package/dist/lib/hooks/useHookFabric.js +24 -0
- package/dist/lib/index.d.ts +12 -3
- package/dist/lib/index.js +40 -20
- package/dist/lib/utils/shared.d.ts +8 -0
- package/dist/lib/utils/shared.js +192 -0
- package/dist/lib/zustandStore/alerts/modal/constants.js +3 -3
- package/dist/lib/zustandStore/alerts/modal/store.js +3 -3
- package/dist/lib/zustandStore/forms/signUp/constants.d.ts +10 -0
- package/dist/lib/zustandStore/forms/signUp/constants.js +40 -0
- package/dist/lib/zustandStore/forms/signUp/selectors.d.ts +23 -0
- package/dist/lib/zustandStore/forms/signUp/selectors.js +84 -0
- package/dist/lib/zustandStore/forms/signUp/store.d.ts +2 -0
- package/dist/lib/zustandStore/forms/signUp/store.js +62 -0
- package/dist/lib/zustandStore/forms/signUp/types.d.ts +34 -0
- package/dist/lib/zustandStore/forms/signUp/types.js +10 -0
- package/dist/lib/zustandStore/forms/signUp/utils.d.ts +36 -0
- package/dist/lib/zustandStore/forms/signUp/utils.js +48 -0
- package/dist/lib/zustandStore/languages/selectors.d.ts +1 -1
- package/dist/main.css +223 -85
- package/package.json +8 -6
- package/dist/lib/zustandStore/alerts/modal/utils.d.ts +0 -2
- package/dist/lib/zustandStore/alerts/modal/utils.js +0 -11
package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CountrySelector/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
var SignUp_module_css_1 = __importDefault(require("../../SignUp.module.css"));
|
|
10
|
+
var store_1 = require("zustandStore/forms/signUp/store");
|
|
11
|
+
var selectors_1 = require("zustandStore/forms/signUp/selectors");
|
|
12
|
+
var constants_1 = require("./constants");
|
|
13
|
+
var Selector_1 = require("components/ui/Selector");
|
|
14
|
+
var CountrySelector = function (_a) {
|
|
15
|
+
var classes = _a.classes;
|
|
16
|
+
var activeCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCountryIdSelector);
|
|
17
|
+
var setActiveCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setActiveCountryIdAction);
|
|
18
|
+
var countryInfo = null;
|
|
19
|
+
// useHookFabric<CountryInfo>({
|
|
20
|
+
// fn: useCountryInfo,
|
|
21
|
+
// });
|
|
22
|
+
(0, react_1.useEffect)(function () {
|
|
23
|
+
if (activeCountryId || !countryInfo) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
var isExist = constants_1.COUNTRY_MOCK.find(function (c) { return c.id === countryInfo.countryId; });
|
|
27
|
+
if (isExist) {
|
|
28
|
+
setActiveCountryId(countryInfo.countryId);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setActiveCountryId(constants_1.COUNTRY_MOCK[0].id);
|
|
32
|
+
}, [activeCountryId, countryInfo]);
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(Selector_1.Selector, { size: "full", classes: (0, classnames_1.default)(SignUp_module_css_1.default.marginB, classes), activeId: activeCountryId, handleClick: setActiveCountryId, placeholder: "registrations.selectors.country", data: constants_1.COUNTRY_MOCK }));
|
|
34
|
+
};
|
|
35
|
+
exports.default = CountrySelector;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CurrencyInfo } from 'react-memory-optimization/dist/lib/store/user/types';
|
|
2
|
+
type Props = {
|
|
3
|
+
classes?: string;
|
|
4
|
+
availableCurrencies: CurrencyInfo[];
|
|
5
|
+
};
|
|
6
|
+
declare const CurrencySelector: ({ classes, availableCurrencies }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CurrencySelector;
|
package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/CurrencySelector/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
var store_1 = require("zustandStore/forms/signUp/store");
|
|
33
|
+
var selectors_1 = require("zustandStore/forms/signUp/selectors");
|
|
34
|
+
var Selector_1 = require("components/ui/Selector");
|
|
35
|
+
var styles = __importStar(require("../../SignUp.module.css"));
|
|
36
|
+
var CurrencySelector = function (_a) {
|
|
37
|
+
var classes = _a.classes, availableCurrencies = _a.availableCurrencies;
|
|
38
|
+
var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
|
|
39
|
+
var setActiveCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setActiveCurrencyIdAction);
|
|
40
|
+
var countryInfo = null;
|
|
41
|
+
(0, react_1.useEffect)(function () {
|
|
42
|
+
if (activeCurrencyId || !countryInfo) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var isExist = availableCurrencies.find(function (c) {
|
|
46
|
+
return countryInfo.currencyIds.includes(c.id);
|
|
47
|
+
});
|
|
48
|
+
if (isExist) {
|
|
49
|
+
setActiveCurrencyId(countryInfo.currencyIds[0]);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (!availableCurrencies[0]) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setActiveCurrencyId(availableCurrencies[0].id);
|
|
56
|
+
}, [availableCurrencies, activeCurrencyId, countryInfo]);
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(Selector_1.Selector, { classes: (0, classnames_1.default)(styles.marginB, classes), size: "full", placeholder: "registrations.selectors.currency", handleClick: setActiveCurrencyId, activeId: activeCurrencyId, data: availableCurrencies }));
|
|
58
|
+
};
|
|
59
|
+
exports.default = CurrencySelector;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var CheckBox_1 = require("components/ui/Inputs/CheckBox");
|
|
28
|
+
var styles = __importStar(require("../../../SignUp.module.css"));
|
|
29
|
+
var useTranslate_1 = require("hooks/useTranslate");
|
|
30
|
+
var DocsCheckBox = function (props) {
|
|
31
|
+
var terms = props.terms, handleToggleState = props.handleToggleState, handleOpenDoc = props.handleOpenDoc;
|
|
32
|
+
var getText = (0, useTranslate_1.useTranslate)('', '').getText;
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { value: terms, onChange: handleToggleState, text: getText('registrations.termsAndConditions'), classes: styles.checkbox, classesText: styles.link, handleText: handleOpenDoc }));
|
|
34
|
+
};
|
|
35
|
+
exports.default = DocsCheckBox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getRegistrationData } from 'zustandStore/forms/signUp/utils';
|
|
2
|
+
import { CurrencyInfo } from 'react-memory-optimization/dist/lib/store/user/types';
|
|
3
|
+
type Props = {
|
|
4
|
+
isSelected: boolean;
|
|
5
|
+
handleRegistration: (k: string, data: ReturnType<typeof getRegistrationData>) => void;
|
|
6
|
+
availableCurrencies: CurrencyInfo[];
|
|
7
|
+
};
|
|
8
|
+
export declare const EmailSignUp: ({ isSelected, handleRegistration, availableCurrencies, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
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.EmailSignUp = void 0;
|
|
41
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var types_1 = require("react-memory-optimization/dist/lib/binary/types");
|
|
44
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
45
|
+
var CurrencySelector_1 = __importDefault(require("../../CurrencySelector"));
|
|
46
|
+
var PromoCode_1 = __importDefault(require("../../PromoCode"));
|
|
47
|
+
var DocsCheckBox_1 = __importDefault(require("../DocsCheckBox"));
|
|
48
|
+
var styles = __importStar(require("../../../SignUp.module.css"));
|
|
49
|
+
var stylesEmailSignUp = __importStar(require("./EmailSignUp.module.css"));
|
|
50
|
+
var constant_1 = require("components/ui/Inputs/BaseInput/constant");
|
|
51
|
+
var store_1 = require("zustandStore/forms/signUp/store");
|
|
52
|
+
var selectors_1 = require("zustandStore/forms/signUp/selectors");
|
|
53
|
+
var selectors_2 = require("zustandStore/languages/selectors");
|
|
54
|
+
var store_2 = require("zustandStore/languages/store");
|
|
55
|
+
var validation_1 = require("service/validation");
|
|
56
|
+
var BaseInput_1 = require("components/ui/Inputs/BaseInput");
|
|
57
|
+
var BaseButton_1 = require("components/ui/Buttons/BaseButton");
|
|
58
|
+
var utils_1 = require("zustandStore/forms/signUp/utils");
|
|
59
|
+
var EmailSignUp = function (_a) {
|
|
60
|
+
var _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, handleRegistration = _a.handleRegistration, availableCurrencies = _a.availableCurrencies;
|
|
61
|
+
var _c = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), email = _c[0], setEmail = _c[1];
|
|
62
|
+
// const docs = useZustandWebConfiguration(getDocsSelector) || {};
|
|
63
|
+
var _d = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), password = _d[0], setPassword = _d[1];
|
|
64
|
+
var setRegisteredLogin = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setRegisteredLoginAction);
|
|
65
|
+
var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
|
|
66
|
+
var activeLang = (0, store_2.useZustandLanguagesKitStore)(selectors_2.languageSelectors.getActiveLanguageNameKitSelector);
|
|
67
|
+
var _e = (0, react_1.useState)(isSelected), terms = _e[0], setTermsState = _e[1];
|
|
68
|
+
var isDisabledSubmitButton = (0, react_1.useMemo)(function () {
|
|
69
|
+
return Boolean(!activeCurrencyId ||
|
|
70
|
+
!email.value ||
|
|
71
|
+
email.errorText ||
|
|
72
|
+
!password.value ||
|
|
73
|
+
password.errorText ||
|
|
74
|
+
!terms);
|
|
75
|
+
}, [activeCurrencyId, email, password, terms]);
|
|
76
|
+
var _f = (0, react_1.useState)(''), promoCode = _f[0], setPromoCode = _f[1];
|
|
77
|
+
var handleChange = function (t) { return function (value) {
|
|
78
|
+
if (t === 'password') {
|
|
79
|
+
var errorText = (0, validation_1.composeValidations)([
|
|
80
|
+
(0, validation_1.isPassword)({
|
|
81
|
+
value: value,
|
|
82
|
+
errorText: ['errors.passwordMin', 'errors.passwordMax'],
|
|
83
|
+
}),
|
|
84
|
+
]);
|
|
85
|
+
setPassword({
|
|
86
|
+
value: value,
|
|
87
|
+
errorText: errorText,
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
var emailResponse = (0, validation_1.isEmail)({
|
|
92
|
+
value: value,
|
|
93
|
+
errorText: 'errors.email',
|
|
94
|
+
})();
|
|
95
|
+
setEmail(emailResponse);
|
|
96
|
+
}; };
|
|
97
|
+
var handleSubmitForm = function () {
|
|
98
|
+
if (!activeCurrencyId) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
var sendData = (0, utils_1.getRegistrationData)({
|
|
102
|
+
registrationType: promoCode
|
|
103
|
+
? types_1.RegistrationSubType.PromoEmail
|
|
104
|
+
: types_1.RegistrationSubType.Email,
|
|
105
|
+
countryId: 0,
|
|
106
|
+
currencyId: activeCurrencyId,
|
|
107
|
+
promoCode: promoCode,
|
|
108
|
+
countryName: '', // TODO back not validate this value
|
|
109
|
+
});
|
|
110
|
+
setRegisteredLogin(email.value);
|
|
111
|
+
handleRegistration(promoCode ? '06x_with_promo' : '06x', __assign(__assign({}, sendData), { email: email.value, password: password.value, letters: 0, // mock
|
|
112
|
+
promoCode: promoCode }));
|
|
113
|
+
};
|
|
114
|
+
var handleToggleState = function () {
|
|
115
|
+
setTermsState(!terms);
|
|
116
|
+
};
|
|
117
|
+
var handleOpenDoc = function () {
|
|
118
|
+
if (!activeLang) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// TODO terms
|
|
122
|
+
// const link = docs[1]?.link.replace('[lang]', activeLang);
|
|
123
|
+
// if (!link) {
|
|
124
|
+
// return;
|
|
125
|
+
// }
|
|
126
|
+
// openExternalLink(link, true);
|
|
127
|
+
};
|
|
128
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: stylesEmailSignUp.animationFadeIn }, { children: [(0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.email", size: "full", isHidePlaceholder: true, onChange: handleChange('email'), errorText: email.errorText, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), errorText: password.errorText, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CurrencySelector_1.default, { availableCurrencies: availableCurrencies }), (0, jsx_runtime_1.jsx)(PromoCode_1.default, { setPromoCode: setPromoCode }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.default, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, { text: "registrations.submitBtn", disabled: isDisabledSubmitButton, color: "primary", handleClick: handleSubmitForm, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: (0, classnames_1.default)(styles.marginB, styles.authButton) })] })));
|
|
129
|
+
};
|
|
130
|
+
exports.EmailSignUp = EmailSignUp;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var selectors_1 = require("zustandStore/forms/signUp/selectors");
|
|
5
|
+
var store_1 = require("zustandStore/forms/signUp/store");
|
|
6
|
+
var selectors_2 = require("zustandStore/languages/selectors");
|
|
7
|
+
var store_2 = require("zustandStore/languages/store");
|
|
8
|
+
var OneClickKit = function (_a) {
|
|
9
|
+
// const { sendCommand } = useTransportControllers();
|
|
10
|
+
var isSelected = _a.isSelected;
|
|
11
|
+
// const isRequested = useZustandRequestStore(
|
|
12
|
+
// isRequestedCommandSelector(ERequestIds.Registration)
|
|
13
|
+
// );
|
|
14
|
+
var activeCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCountryIdSelector);
|
|
15
|
+
var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
|
|
16
|
+
var availableCurrencies = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getAvailableCurrenciesSelector);
|
|
17
|
+
var setActiveCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setActiveCurrencyIdAction);
|
|
18
|
+
var activeLang = (0, store_2.useZustandLanguagesKitStore)(selectors_2.languageSelectors.getActiveLanguageNameKitSelector);
|
|
19
|
+
// const docs = useZustandWebConfiguration(getDocsSelector) || {};
|
|
20
|
+
var setActiveCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setActiveCountryIdAction);
|
|
21
|
+
var handleRegistration = function (promoCode) {
|
|
22
|
+
if (!activeCurrencyId || !activeCountryId) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
// const customCurrencyId = getFromLocalStorage(CUSTOM_FAST_CURRENCY_ID);
|
|
26
|
+
// const data = getRegistrationData({
|
|
27
|
+
// countryId: activeCountryId,
|
|
28
|
+
// currencyId: Number(customCurrencyId) || activeCurrencyId,
|
|
29
|
+
// registrationType: RegistrationSubType.OneClick,
|
|
30
|
+
// promoCode,
|
|
31
|
+
// countryName: `${activeCountryId}`, // TODO back end is not validate this value
|
|
32
|
+
// });
|
|
33
|
+
// sendCommand('05x', data, true);
|
|
34
|
+
};
|
|
35
|
+
return (
|
|
36
|
+
// <OneClick
|
|
37
|
+
// isSelected={isSelected}
|
|
38
|
+
// activeCountryId={activeCountryId}
|
|
39
|
+
// activeCurrencyId={activeCurrencyId}
|
|
40
|
+
// activeLang={activeLang}
|
|
41
|
+
// handleSubmit={handleRegistration}
|
|
42
|
+
// docs={docs}
|
|
43
|
+
// sendCommand={sendCommand}
|
|
44
|
+
// isAvailableTransport={isAvailableTransport}
|
|
45
|
+
// currencyProps={{
|
|
46
|
+
// activeCurrencyId,
|
|
47
|
+
// availableCurrencies,
|
|
48
|
+
// setActiveCurrencyId,
|
|
49
|
+
// countryInfo,
|
|
50
|
+
// }}
|
|
51
|
+
// countryProps={{
|
|
52
|
+
// activeCountryId,
|
|
53
|
+
// setActiveCountryId,
|
|
54
|
+
// countryInfo,
|
|
55
|
+
// }}
|
|
56
|
+
// isLoading={isRequested}
|
|
57
|
+
// />
|
|
58
|
+
(0, jsx_runtime_1.jsx)("div", { children: "OneClick" }));
|
|
59
|
+
};
|
|
60
|
+
exports.default = OneClickKit;
|
package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/constants.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PHONE_PROPS_WITHOUT_CONFIRMATION = exports.PHONE_PROPS_WITH_CONFIRMATION = void 0;
|
|
4
|
+
exports.PHONE_PROPS_WITH_CONFIRMATION = {
|
|
5
|
+
requestId: -1,
|
|
6
|
+
sendDataType: 0,
|
|
7
|
+
sendKey: '09x',
|
|
8
|
+
section: 1,
|
|
9
|
+
withConfirm: true,
|
|
10
|
+
};
|
|
11
|
+
exports.PHONE_PROPS_WITHOUT_CONFIRMATION = {
|
|
12
|
+
sendDataType: 0,
|
|
13
|
+
withConfirm: false,
|
|
14
|
+
};
|
package/dist/lib/components/Modals/Alert/components/Auth/SignUp/components/Forms/Phone/index.js
ADDED
|
@@ -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 __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;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var react_1 = require("react");
|
|
39
|
+
// import { Text, LotterySvg } from 'react-gldn-kit';
|
|
40
|
+
// import ComponentKitBaseInput from 'components/ui/KitComponents/Inputs/ComponentKitBaseInput';
|
|
41
|
+
// import { REFERRAL_CODE } from 'constants/ui';
|
|
42
|
+
var styles = __importStar(require("../../SignUp.module.css"));
|
|
43
|
+
var BaseInput_1 = require("components/ui/Inputs/BaseInput");
|
|
44
|
+
var Text_1 = require("components/Text");
|
|
45
|
+
var LotterySvg_1 = require("components/ui/Icons/Base/LotterySvg");
|
|
46
|
+
var RegistrationPromoCode = function (_a) {
|
|
47
|
+
var setPromoCode = _a.setPromoCode, initialReferralCode = _a.initialReferralCode;
|
|
48
|
+
var _b = (0, react_1.useState)(false), isShownPromoCode = _b[0], setPromoCodeState = _b[1];
|
|
49
|
+
var handleShowPromoCode = function (e) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
setPromoCodeState(!isShownPromoCode);
|
|
53
|
+
};
|
|
54
|
+
(0, react_1.useEffect)(function () {
|
|
55
|
+
if (!initialReferralCode) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setPromoCode("ref_code::".concat(initialReferralCode));
|
|
59
|
+
}, [initialReferralCode]);
|
|
60
|
+
if (initialReferralCode) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: styles.marginB }, { children: !isShownPromoCode ? ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.promoTitle, onClick: handleShowPromoCode }, { children: [(0, jsx_runtime_1.jsx)(LotterySvg_1.LotterySvg, { classes: styles.promocodeSvg }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: "registrations.promoCode.openPromoCodeTitle" }) })] }))) : ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.promoCode.placeholder", size: "full", isHidePlaceholder: true, onChange: setPromoCode, classes: styles.bigMargin })) })));
|
|
64
|
+
};
|
|
65
|
+
exports.default = RegistrationPromoCode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CurrencyInfo } from 'react-memory-optimization/dist/lib/store/user/types';
|
|
2
|
+
type SignUpProps = {
|
|
3
|
+
sendCommand: (key: string, data: {
|
|
4
|
+
[key: string]: string | number | any[];
|
|
5
|
+
}, isWatching?: boolean) => void;
|
|
6
|
+
useCurrencies: () => CurrencyInfo[] | null;
|
|
7
|
+
};
|
|
8
|
+
declare const SignUp: ({ sendCommand, useCurrencies }: SignUpProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default SignUp;
|