react-gldn-kit 0.1.40 → 0.1.42

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.
@@ -1,5 +1,5 @@
1
- import { getRegistrationData } from 'zustandStore/forms/signUp/utils';
2
1
  import { CountryInfo, CurrencyInfo } from 'react-memory-optimization/dist/lib/store/user/types';
2
+ import { getRegistrationData } from 'zustandStore/forms/signUp/utils';
3
3
  type Props = {
4
4
  isSelected: boolean;
5
5
  handleRegistration: (k: string, data: ReturnType<typeof getRegistrationData>) => void;
@@ -42,20 +42,24 @@ var jsx_runtime_1 = require("react/jsx-runtime");
42
42
  var react_1 = require("react");
43
43
  var types_1 = require("react-memory-optimization/dist/lib/binary/types");
44
44
  var classnames_1 = __importDefault(require("classnames"));
45
- var DocsCheckBox_1 = __importDefault(require("../DocsCheckBox"));
46
- var styles = __importStar(require("../../../SignUp.module.css"));
47
- var stylesEmailSignUp = __importStar(require("./EmailSignUp.module.css"));
45
+ var PromoCode_1 = require("components/SignUp/PromoCode");
46
+ var CurrencySelector_1 = require("components/SignUp/CurrencySelector");
47
+ var HOCRequestLoader_1 = require("components/HOCs/HOCRequestLoader");
48
+ var CircularLoader_1 = require("components/ui/Loaders/CircularLoader");
49
+ var BaseInput_1 = require("components/ui/Inputs/BaseInput");
50
+ var BaseButton_1 = require("components/ui/Buttons/BaseButton");
48
51
  var constant_1 = require("components/ui/Inputs/BaseInput/constant");
49
52
  var store_1 = require("zustandStore/forms/signUp/store");
50
53
  var selectors_1 = require("zustandStore/forms/signUp/selectors");
51
54
  var selectors_2 = require("zustandStore/languages/selectors");
52
55
  var store_2 = require("zustandStore/languages/store");
56
+ var store_3 = require("zustandStore/connection/store");
57
+ var selectors_3 = require("zustandStore/connection/selectors");
53
58
  var validation_1 = require("service/validation");
54
- var BaseInput_1 = require("components/ui/Inputs/BaseInput");
55
- var BaseButton_1 = require("components/ui/Buttons/BaseButton");
56
59
  var utils_1 = require("zustandStore/forms/signUp/utils");
57
- var PromoCode_1 = require("components/SignUp/PromoCode");
58
- var CurrencySelector_1 = require("components/SignUp/CurrencySelector");
60
+ var styles = __importStar(require("../../../SignUp.module.css"));
61
+ var stylesEmailSignUp = __importStar(require("./EmailSignUp.module.css"));
62
+ var DocsCheckBox_1 = require("components/SignUp/DocsCheckBox");
59
63
  var EmailSignUp = function (props) {
60
64
  var countryInfo = props.countryInfo, _a = props.isSelected, isSelected = _a === void 0 ? false : _a, handleRegistration = props.handleRegistration, availableCurrencies = props.availableCurrencies;
61
65
  var _b = (0, react_1.useState)(constant_1.DEFAULT_INPUT_VALUE), email = _b[0], setEmail = _b[1];
@@ -64,6 +68,7 @@ var EmailSignUp = function (props) {
64
68
  var setRegisteredLogin = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setRegisteredLoginAction);
65
69
  var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
66
70
  var activeLang = (0, store_2.useZustandLanguagesKitStore)(selectors_2.languageSelectors.getActiveLanguageNameKitSelector);
71
+ var isConnectedApp = (0, store_3.useZustandConnectionKitStore)(selectors_3.connectionSelectors.isAvailableTransportSelector);
67
72
  var _d = (0, react_1.useState)(isSelected), terms = _d[0], setTermsState = _d[1];
68
73
  var isDisabledSubmitButton = (0, react_1.useMemo)(function () {
69
74
  return Boolean(!activeCurrencyId ||
@@ -71,7 +76,8 @@ var EmailSignUp = function (props) {
71
76
  email.errorText ||
72
77
  !password.value ||
73
78
  password.errorText ||
74
- !terms);
79
+ !terms ||
80
+ !isConnectedApp);
75
81
  }, [activeCurrencyId, email, password, terms]);
76
82
  var _e = (0, react_1.useState)(''), promoCode = _e[0], setPromoCode = _e[1];
77
83
  var handleChange = function (t) { return function (value) {
@@ -125,6 +131,6 @@ var EmailSignUp = function (props) {
125
131
  // }
126
132
  // openExternalLink(link, true);
127
133
  };
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.CurrencySelector, { availableCurrencies: availableCurrencies, countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB }), (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) })] })));
134
+ 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.CurrencySelector, { availableCurrencies: availableCurrencies, countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.DocsCheckBox, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(HOCRequestLoader_1.HOCRequestLoader, __assign({ command: promoCode ? '06x_with_promo' : '06x', requestId: types_1.ERequestIds.Registration, customLoader: (0, jsx_runtime_1.jsx)(CircularLoader_1.CircularLoader, {}) }, { children: (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
135
  };
130
136
  exports.EmailSignUp = EmailSignUp;
@@ -0,0 +1,9 @@
1
+ export declare const BASE_TRANSLATE_KEYS: {
2
+ loading: string;
3
+ registrationBtn: string;
4
+ terms: string;
5
+ promoCode: string;
6
+ promoCodeTitle: string;
7
+ countryTitle: string;
8
+ currencyTitle: string;
9
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BASE_TRANSLATE_KEYS = void 0;
4
+ exports.BASE_TRANSLATE_KEYS = {
5
+ loading: 'loading',
6
+ registrationBtn: 'registrations.submitBtn',
7
+ terms: 'registrations.termsAndConditions',
8
+ promoCode: 'registrations.promoCode.placeholder',
9
+ promoCodeTitle: 'registrations.promoCode.openPromoCodeTitle',
10
+ countryTitle: 'registrations.selectors.country',
11
+ currencyTitle: 'registrations.selectors.currency',
12
+ };
@@ -1,20 +1,85 @@
1
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
+ };
2
36
  Object.defineProperty(exports, "__esModule", { value: true });
3
37
  var jsx_runtime_1 = require("react/jsx-runtime");
4
- var OneClick_1 = require("components/SignUp/OneClick");
5
38
  var types_1 = require("react-memory-optimization/dist/lib/binary/types");
6
39
  var selectors_1 = require("zustandStore/forms/signUp/selectors");
7
40
  var store_1 = require("zustandStore/forms/signUp/store");
8
- var utils_1 = require("zustandStore/forms/signUp/utils");
9
41
  var selectors_2 = require("zustandStore/languages/selectors");
10
42
  var store_2 = require("zustandStore/languages/store");
43
+ var utils_1 = require("zustandStore/forms/signUp/utils");
44
+ var styles = __importStar(require("./OneClick.module.css"));
45
+ var react_1 = require("react");
46
+ var store_3 = require("zustandStore/connection/store");
47
+ var selectors_3 = require("zustandStore/connection/selectors");
48
+ var constants_1 = require("./constants");
49
+ var CurrencySelector_1 = require("components/SignUp/CurrencySelector");
50
+ var CountrySelector_1 = require("components/SignUp/CountrySelector");
51
+ var PromoCode_1 = require("components/SignUp/PromoCode");
52
+ var HOCRequestLoader_1 = require("components/HOCs/HOCRequestLoader");
53
+ var CircularLoader_1 = require("components/ui/Loaders/CircularLoader");
54
+ var BaseButton_1 = require("components/ui/Buttons/BaseButton");
55
+ var DocsCheckBox_1 = require("components/SignUp/DocsCheckBox");
11
56
  var OneClickKit = function (props) {
12
- var isSelected = props.isSelected, availableCurrencies = props.availableCurrencies, handleRegistration = props.handleRegistration, countryInfo = props.countryInfo;
13
- var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
57
+ var isSelected = props.isSelected, handleRegistration = props.handleRegistration, _a = props.translates, translates = _a === void 0 ? constants_1.BASE_TRANSLATE_KEYS : _a, availableCurrencies = props.availableCurrencies, countryInfo = props.countryInfo;
14
58
  var activeCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCountryIdSelector);
15
59
  var activeLang = (0, store_2.useZustandLanguagesKitStore)(selectors_2.languageSelectors.getActiveLanguageNameKitSelector);
16
60
  var setActiveCountryId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.setActiveCountryIdAction);
17
- var prepareRegistrationData = function (promoCode) {
61
+ var _b = (0, react_1.useState)(isSelected), terms = _b[0], setTermsState = _b[1];
62
+ var _c = (0, react_1.useState)(''), promoCode = _c[0], setPromoCode = _c[1];
63
+ var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
64
+ var isConnectedApp = (0, store_3.useZustandConnectionKitStore)(selectors_3.connectionSelectors.isAvailableTransportSelector);
65
+ var isDisabledSubmitButton = (0, react_1.useMemo)(function () {
66
+ return Boolean(!activeCurrencyId || !activeCountryId || !terms || !isConnectedApp);
67
+ }, [activeCountryId, activeCurrencyId, terms, isConnectedApp]);
68
+ var handleToggleState = function () {
69
+ setTermsState(!terms);
70
+ };
71
+ var handleOpenDoc = function () {
72
+ if (!activeLang) {
73
+ return;
74
+ }
75
+ // TODO terms
76
+ // const link = docs[1]?.link.replace('[lang]', activeLang);
77
+ // if (!link) {
78
+ // return;
79
+ // }
80
+ // openExternalLink(link);
81
+ };
82
+ var prepareRegistrationData = function () {
18
83
  if (!activeCurrencyId || !activeCountryId) {
19
84
  return;
20
85
  }
@@ -27,11 +92,26 @@ var OneClickKit = function (props) {
27
92
  });
28
93
  handleRegistration('05x', data, true);
29
94
  };
30
- return ((0, jsx_runtime_1.jsx)(OneClick_1.OneClick, { isSelected: isSelected, activeCountryId: activeCountryId, activeLang: activeLang, handleSubmit: prepareRegistrationData, docs: {}, currencyProps: {
31
- availableCurrencies: availableCurrencies,
32
- countryInfo: countryInfo,
33
- }, countryProps: {
34
- countryInfo: countryInfo,
35
- }, isLoading: false }));
95
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.fullWidth }, { children: [(0, jsx_runtime_1.jsx)(CurrencySelector_1.CurrencySelector, __assign({}, {
96
+ availableCurrencies: availableCurrencies,
97
+ countryInfo: countryInfo,
98
+ }, { translateKey: translates.currencyTitle, classes: styles.marginB })), (0, jsx_runtime_1.jsx)(CountrySelector_1.CountrySelector, __assign({}, {
99
+ countryInfo: countryInfo,
100
+ }, { translateKey: translates.countryTitle, classes: styles.marginB })), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB, translatesKeys: [translates.promoCodeTitle, translates.promoCode] }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.DocsCheckBox, { terms: terms, handleOpenDoc: handleOpenDoc, translateKey: translates.terms, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(HOCRequestLoader_1.HOCRequestLoader, __assign({ command: "05x", requestId: types_1.ERequestIds.Registration, customLoader: (0, jsx_runtime_1.jsx)(CircularLoader_1.CircularLoader, {}) }, { children: (0, jsx_runtime_1.jsx)(BaseButton_1.BaseButton, { text: translates.registrationBtn, disabled: isDisabledSubmitButton, color: "primary", handleClick: prepareRegistrationData, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: styles.marginB }) }))] }))
101
+ // <OneClick
102
+ // isSelected={isSelected}
103
+ // activeCountryId={activeCountryId}
104
+ // activeLang={activeLang}
105
+ // handleSubmit={prepareRegistrationData}
106
+ // docs={{}}
107
+ // currencyProps={{
108
+ // availableCurrencies,
109
+ // countryInfo,
110
+ // }}
111
+ // countryProps={{
112
+ // countryInfo,
113
+ // }}
114
+ // />
115
+ );
36
116
  };
37
117
  exports.default = OneClickKit;
@@ -4,4 +4,13 @@ export type SignUpOneClickProps = {
4
4
  availableCurrencies: CurrencyInfo[];
5
5
  handleRegistration: (k: string, data: any, d?: boolean) => void;
6
6
  countryInfo: CountryInfo | null;
7
+ translates?: {
8
+ loading: string;
9
+ registrationBtn: string;
10
+ terms: string;
11
+ promoCode: string;
12
+ promoCodeTitle: string;
13
+ countryTitle: string;
14
+ currencyTitle: string;
15
+ };
7
16
  };
@@ -33,36 +33,36 @@ 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
- };
39
36
  Object.defineProperty(exports, "__esModule", { value: true });
40
37
  exports.PhoneSignUp = void 0;
41
38
  var jsx_runtime_1 = require("react/jsx-runtime");
42
39
  var react_1 = require("react");
43
- var constant_1 = require("components/ui/Inputs/BaseInput/constant");
44
- var store_1 = require("zustandStore/languages/store");
45
- var selectors_1 = require("zustandStore/languages/selectors");
40
+ var types_1 = require("react-memory-optimization/dist/lib/binary/types");
46
41
  var BaseInput_1 = require("components/ui/Inputs/BaseInput");
47
42
  var BaseButton_1 = require("components/ui/Buttons/BaseButton");
48
43
  var PhoneInput_1 = require("components/ui/Inputs/PhoneInput");
49
- var DocsCheckBox_1 = __importDefault(require("../DocsCheckBox"));
44
+ var HOCRequestLoader_1 = require("components/HOCs/HOCRequestLoader");
45
+ var CircularLoader_1 = require("components/ui/Loaders/CircularLoader");
46
+ var PromoCode_1 = require("components/SignUp/PromoCode");
47
+ var CountrySelector_1 = require("components/SignUp/CountrySelector");
48
+ var CurrencySelector_1 = require("components/SignUp/CurrencySelector");
49
+ var constant_1 = require("components/ui/Inputs/BaseInput/constant");
50
50
  var constants_1 = require("./constants");
51
+ var store_1 = require("zustandStore/languages/store");
52
+ var selectors_1 = require("zustandStore/languages/selectors");
51
53
  var store_2 = require("zustandStore/forms/signUp/store");
52
54
  var selectors_2 = require("zustandStore/forms/signUp/selectors");
53
- var useTranslate_1 = require("hooks/useTranslate");
55
+ var store_3 = require("zustandStore/connection/store");
56
+ var selectors_3 = require("zustandStore/connection/selectors");
54
57
  var shared_1 = require("utils/shared");
55
- var styles = __importStar(require("../../../SignUp.module.css"));
56
- var types_1 = require("react-memory-optimization/dist/lib/binary/types");
57
58
  var utils_1 = require("zustandStore/forms/signUp/utils");
58
- var PromoCode_1 = require("components/SignUp/PromoCode");
59
- var CountrySelector_1 = require("components/SignUp/CountrySelector");
60
- var CurrencySelector_1 = require("components/SignUp/CurrencySelector");
59
+ var styles = __importStar(require("../../../SignUp.module.css"));
60
+ var DocsCheckBox_1 = require("components/SignUp/DocsCheckBox");
61
61
  var PhoneSignUp = function (props) {
62
62
  var availableCurrencies = props.availableCurrencies, isSelected = props.isSelected, _a = props.withoutCode, withoutCode = _a === void 0 ? false : _a, countryInfo = props.countryInfo, handleRegistration = props.handleRegistration, _b = props.requestCode, requestCode = _b === void 0 ? console.info : _b;
63
63
  var setRegisteredLogin = (0, store_2.useZustandRegistrationKitStore)(selectors_2.zustandRegistrationKitSelector.setRegisteredLoginAction);
64
64
  // const { sendCommand } = useTransportControllers();
65
- var getText = (0, useTranslate_1.useTranslate)('', '').getText;
65
+ var isConnectedApp = (0, store_3.useZustandConnectionKitStore)(selectors_3.connectionSelectors.isAvailableTransportSelector);
66
66
  var _c = (0, react_1.useState)(''), phone = _c[0], setPhone = _c[1];
67
67
  var _d = (0, react_1.useState)(withoutCode
68
68
  ? {
@@ -89,7 +89,8 @@ var PhoneSignUp = function (props) {
89
89
  !isRequestedCode ||
90
90
  !activeCountryId ||
91
91
  !activeCurrencyId ||
92
- !terms);
92
+ !terms ||
93
+ !isConnectedApp);
93
94
  }, [
94
95
  isPhoneError,
95
96
  password,
@@ -98,6 +99,7 @@ var PhoneSignUp = function (props) {
98
99
  activeCountryId,
99
100
  activeCurrencyId,
100
101
  terms,
102
+ isConnectedApp,
101
103
  ]);
102
104
  var handleIsRequested = function () {
103
105
  setRequestedCodeState(true);
@@ -144,6 +146,6 @@ var PhoneSignUp = function (props) {
144
146
  var PHONE_PROPS = withoutCode
145
147
  ? constants_1.PHONE_PROPS_WITHOUT_CONFIRMATION
146
148
  : constants_1.PHONE_PROPS_WITH_CONFIRMATION;
147
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PhoneInput_1.PhoneInput, __assign({}, PHONE_PROPS, { placeholder: "registrations.inputs.phone", size: "full", defaultValue: "+", onChange: setPhone, countryInfo: countryInfo, requestCallback: handleIsRequested, classesWrapper: styles.marginB, disabled: isRequestedCode, classes: styles.marginB, requestCode: !withoutCode ? requestCode : undefined })), !withoutCode && isRequestedCode && ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.code", size: "full", isHidePlaceholder: true, disabled: !isRequestedCode, onChange: handleChange('code'), classes: styles.marginB })), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CountrySelector_1.CountrySelector, { countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CurrencySelector_1.CurrencySelector, { availableCurrencies: availableCurrencies, countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.default, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB }), (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: styles.marginB })] }));
149
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PhoneInput_1.PhoneInput, __assign({}, PHONE_PROPS, { placeholder: "registrations.inputs.phone", size: "full", defaultValue: "+", onChange: setPhone, countryInfo: countryInfo, requestCallback: handleIsRequested, classesWrapper: styles.marginB, disabled: isRequestedCode, classes: styles.marginB, requestCode: !withoutCode ? requestCode : undefined })), !withoutCode && isRequestedCode && ((0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.code", size: "full", isHidePlaceholder: true, disabled: !isRequestedCode, onChange: handleChange('code'), classes: styles.marginB })), (0, jsx_runtime_1.jsx)(BaseInput_1.BaseInput, { placeholder: "registrations.inputs.password", size: "full", isHidePlaceholder: true, onChange: handleChange('password'), classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CountrySelector_1.CountrySelector, { countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(CurrencySelector_1.CurrencySelector, { availableCurrencies: availableCurrencies, countryInfo: countryInfo, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.DocsCheckBox, { terms: terms, handleOpenDoc: handleOpenDoc, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB }), (0, jsx_runtime_1.jsx)(HOCRequestLoader_1.HOCRequestLoader, __assign({ command: "08x", requestId: types_1.ERequestIds.Registration, customLoader: (0, jsx_runtime_1.jsx)(CircularLoader_1.CircularLoader, {}) }, { children: (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: styles.marginB }) }))] }));
148
150
  };
149
151
  exports.PhoneSignUp = PhoneSignUp;
@@ -29,6 +29,6 @@ var CheckBox_1 = require("components/ui/Inputs/CheckBox");
29
29
  var styles = __importStar(require("./Docs.module.css"));
30
30
  var DocsCheckBox = function (props) {
31
31
  var terms = props.terms, handleToggleState = props.handleToggleState, handleOpenDoc = props.handleOpenDoc, _a = props.translateKey, translateKey = _a === void 0 ? 'registrations.termsAndConditions' : _a;
32
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { value: terms, onChange: handleToggleState, text: translateKey, classes: styles.checkbox, classesText: styles.link, handleText: handleOpenDoc }) }));
32
+ return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { value: terms, onChange: handleToggleState, text: translateKey, classes: styles.checkbox, classesText: styles.link, handleText: handleOpenDoc }));
33
33
  };
34
34
  exports.DocsCheckBox = DocsCheckBox;
@@ -1,5 +1,5 @@
1
- import { CurrencySelectorProps } from '../CurrencySelector/types';
2
1
  import { CountrySelectorProps } from '../CountrySelector/types';
2
+ import { CurrencySelectorProps } from '../CurrencySelector/types';
3
3
  type OneClickProps = {
4
4
  isSelected: boolean;
5
5
  activeCountryId: number | null;
@@ -11,7 +11,6 @@ type OneClickProps = {
11
11
  };
12
12
  };
13
13
  handleSubmit: (promoCode: string) => void;
14
- isLoading?: boolean;
15
14
  currencyProps: CurrencySelectorProps;
16
15
  countryProps: CountrySelectorProps;
17
16
  translates?: {
@@ -41,22 +41,30 @@ exports.OneClick = void 0;
41
41
  var jsx_runtime_1 = require("react/jsx-runtime");
42
42
  var react_1 = require("react");
43
43
  var classnames_1 = __importDefault(require("classnames"));
44
+ var types_1 = require("react-memory-optimization/dist/lib/binary/types");
44
45
  var CurrencySelector_1 = require("../CurrencySelector");
46
+ var HOCRequestLoader_1 = require("components/HOCs/HOCRequestLoader");
47
+ var CircularLoader_1 = require("components/ui/Loaders/CircularLoader");
45
48
  var CountrySelector_1 = require("../CountrySelector");
46
49
  var DocsCheckBox_1 = require("../DocsCheckBox");
47
50
  var PromoCode_1 = require("../PromoCode");
48
51
  var Buttons_1 = require("components/ui/Buttons");
49
- var Text_1 = require("components/Text");
50
- var styles = __importStar(require("./OneClick.module.css"));
51
52
  var constants_1 = require("./constants");
52
- var shared_1 = require("utils/shared");
53
53
  var store_1 = require("zustandStore/forms/signUp/store");
54
54
  var selectors_1 = require("zustandStore/forms/signUp/selectors");
55
+ var store_2 = require("zustandStore/connection/store");
56
+ var selectors_2 = require("zustandStore/connection/selectors");
57
+ var shared_1 = require("utils/shared");
58
+ var styles = __importStar(require("./OneClick.module.css"));
55
59
  var OneClick = function (props) {
56
- var isSelected = props.isSelected, activeCountryId = props.activeCountryId, handleSubmit = props.handleSubmit, activeLang = props.activeLang, docs = props.docs, currencyProps = props.currencyProps, countryProps = props.countryProps, _a = props.isLoading, isLoading = _a === void 0 ? false : _a, _b = props.translates, translates = _b === void 0 ? constants_1.BASE_TRANSLATE_KEYS : _b;
57
- var _c = (0, react_1.useState)(isSelected), terms = _c[0], setTermsState = _c[1];
58
- var _d = (0, react_1.useState)(''), promoCode = _d[0], setPromoCode = _d[1];
60
+ var isSelected = props.isSelected, activeCountryId = props.activeCountryId, handleSubmit = props.handleSubmit, activeLang = props.activeLang, docs = props.docs, currencyProps = props.currencyProps, countryProps = props.countryProps, _a = props.translates, translates = _a === void 0 ? constants_1.BASE_TRANSLATE_KEYS : _a;
61
+ var _b = (0, react_1.useState)(isSelected), terms = _b[0], setTermsState = _b[1];
62
+ var _c = (0, react_1.useState)(''), promoCode = _c[0], setPromoCode = _c[1];
59
63
  var activeCurrencyId = (0, store_1.useZustandRegistrationKitStore)(selectors_1.zustandRegistrationKitSelector.getActiveCurrencyIdSelector);
64
+ var isConnectedApp = (0, store_2.useZustandConnectionKitStore)(selectors_2.connectionSelectors.isAvailableTransportSelector);
65
+ var isDisabledSubmitButton = (0, react_1.useMemo)(function () {
66
+ return Boolean(!activeCurrencyId || !activeCountryId || !terms || !isConnectedApp);
67
+ }, [activeCountryId, activeCurrencyId, terms, isConnectedApp]);
60
68
  var handleRegistration = function () {
61
69
  if (!activeCountryId || !terms) {
62
70
  return;
@@ -78,6 +86,6 @@ var OneClick = function (props) {
78
86
  }
79
87
  (0, shared_1.openExternalLink)(link);
80
88
  };
81
- return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.fullWidth }, { children: [(0, jsx_runtime_1.jsx)(CurrencySelector_1.CurrencySelector, __assign({}, currencyProps, { translateKey: translates.currencyTitle, classes: (0, classnames_1.default)(currencyProps.classes, styles.marginB) })), (0, jsx_runtime_1.jsx)(CountrySelector_1.CountrySelector, __assign({}, countryProps, { translateKey: translates.countryTitle, classes: (0, classnames_1.default)(countryProps.classes, styles.marginB) })), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB, translatesKeys: [translates.promoCodeTitle, translates.promoCode] }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.DocsCheckBox, { terms: terms, handleOpenDoc: handleOpenDoc, translateKey: translates.terms, handleToggleState: handleToggleState }), isLoading ? ((0, jsx_runtime_1.jsx)("div", __assign({ style: { height: 'var(--height-48)' } }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: translates.loading }) }))) : ((0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: translates.registrationBtn, disabled: !activeCurrencyId || !activeCountryId || !terms, color: "primary", handleClick: handleRegistration, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: styles.marginB }))] })));
89
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.fullWidth }, { children: [(0, jsx_runtime_1.jsx)(CurrencySelector_1.CurrencySelector, __assign({}, currencyProps, { translateKey: translates.currencyTitle, classes: (0, classnames_1.default)(currencyProps.classes, styles.marginB) })), (0, jsx_runtime_1.jsx)(CountrySelector_1.CountrySelector, __assign({}, countryProps, { translateKey: translates.countryTitle, classes: (0, classnames_1.default)(countryProps.classes, styles.marginB) })), (0, jsx_runtime_1.jsx)(PromoCode_1.RegistrationPromoCode, { setPromoCode: setPromoCode, classes: styles.marginB, translatesKeys: [translates.promoCodeTitle, translates.promoCode] }), (0, jsx_runtime_1.jsx)(DocsCheckBox_1.DocsCheckBox, { terms: terms, handleOpenDoc: handleOpenDoc, translateKey: translates.terms, handleToggleState: handleToggleState }), (0, jsx_runtime_1.jsx)(HOCRequestLoader_1.HOCRequestLoader, __assign({ command: "05x", requestId: types_1.ERequestIds.Registration, customLoader: (0, jsx_runtime_1.jsx)(CircularLoader_1.CircularLoader, {}) }, { children: (0, jsx_runtime_1.jsx)(Buttons_1.BaseButton, { text: translates.registrationBtn, disabled: isDisabledSubmitButton, color: "primary", handleClick: handleRegistration, size: "--button-full", centreText: true, buttonHeight: "--button-height-full", classes: styles.marginB }) }))] })));
82
90
  };
83
91
  exports.OneClick = OneClick;
package/dist/main.css CHANGED
@@ -1099,6 +1099,13 @@
1099
1099
  max-height: 0;
1100
1100
  }
1101
1101
  }
1102
+ .KIT__HOCRequestLoader-module__loader___xFYfs {
1103
+ width: inherit;
1104
+ height: inherit;
1105
+ background-color: var(--hoc-request-loader-background-color);
1106
+ color: var(--hoc-request-loader-color);
1107
+ }
1108
+
1102
1109
 
1103
1110
  .KIT__CheckBox-module__checkboxWrapperBig___lQiT2 .KIT__CheckBox-module__switch___l_7bC {
1104
1111
  display: inline-block;
@@ -1344,6 +1351,12 @@
1344
1351
  opacity: 1;
1345
1352
  }
1346
1353
  }
1354
+ .KIT__OneClick-module__fullWidth___wdizL {
1355
+ width: 100%;
1356
+ }
1357
+ .KIT__OneClick-module__fullWidth___wdizL .KIT__OneClick-module__marginB___6BxYS {
1358
+ margin-bottom: var(--indent-l);
1359
+ }
1347
1360
  .KIT__Timer-module__wrapperTimer___yxeGk {
1348
1361
  display: flex;
1349
1362
  margin-bottom: var(--indent-l);
@@ -1517,13 +1530,6 @@
1517
1530
  width: 500px;
1518
1531
  }
1519
1532
  }
1520
- .KIT__HOCRequestLoader-module__loader___xFYfs {
1521
- width: inherit;
1522
- height: inherit;
1523
- background-color: var(--hoc-request-loader-background-color);
1524
- color: var(--hoc-request-loader-color);
1525
- }
1526
-
1527
1533
  .KIT__PopUpHeader-module__wrapperPopUpHeader___GmjiQ {
1528
1534
  display: flex;
1529
1535
  justify-content: center;
@@ -1622,7 +1628,7 @@
1622
1628
  flex-direction: column;
1623
1629
  align-items: center;
1624
1630
 
1625
- max-height: calc(100vh - var(--height-48));
1631
+ max-height: calc(100% - var(--height-48));
1626
1632
  transition: 0.5s;
1627
1633
  max-width: 500px;
1628
1634
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-gldn-kit",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "keywords": [],
@@ -1,7 +0,0 @@
1
- type Props = {
2
- terms: boolean;
3
- handleOpenDoc?: () => void;
4
- handleToggleState: () => void;
5
- };
6
- declare const DocsCheckBox: (props: Props) => import("react/jsx-runtime").JSX.Element;
7
- export default DocsCheckBox;
@@ -1,33 +0,0 @@
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 DocsCheckBox = function (props) {
30
- var terms = props.terms, handleToggleState = props.handleToggleState, handleOpenDoc = props.handleOpenDoc;
31
- return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { value: terms, onChange: handleToggleState, text: 'registrations.termsAndConditions', classes: styles.checkbox, classesText: styles.link, handleText: handleOpenDoc }));
32
- };
33
- exports.default = DocsCheckBox;