@stokr/components-library 2.3.12 → 2.3.14-beta.1
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/components/Checklist/UserChecklist.js +30 -57
- package/dist/components/Form/Form.js +4 -2
- package/dist/components/RegisterLiquidSteps/register-liquid.js +1 -2
- package/dist/components/RegisterModal/RegisterModal.js +3 -0
- package/dist/components/RegisterModal/RegisterModal.stories.js +3 -1
- package/dist/components/StepsProgress/StepsProgress.js +1 -23
- package/dist/components/taxId/register-taxid.js +1 -1
- package/dist/utils/km_ify.js +2 -2
- package/package.json +1 -1
|
@@ -106,63 +106,36 @@ var UserChecklist = function UserChecklist(props) {
|
|
|
106
106
|
return wallet.type === _globalVariables.walletTypes.LIQUID;
|
|
107
107
|
}) || [];
|
|
108
108
|
var platformURL = useRelativePath === true ? '' : "https://signup.".concat(_globalVariables.platformDomain);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
link: "".concat(platformURL, "/country-of-residence")
|
|
140
|
-
}, {
|
|
141
|
-
title: 'Verify Identity',
|
|
142
|
-
message: getVerifyIdentityChecklist(isFromAllowedCountry, user).message,
|
|
143
|
-
state: getVerifyIdentityChecklist(isFromAllowedCountry, user).state,
|
|
144
|
-
link: getVerifyIdentityChecklist(isFromAllowedCountry, user).hasLink && "".concat(platformURL, "/verify-identity")
|
|
145
|
-
}, {
|
|
146
|
-
title: 'Risk Questionnaire',
|
|
147
|
-
message: !isFromAllowedCountry ? 'Sorry, you are living in a country where this is not available' : is_risk_questionnaire_finished ? 'You have read and understood the risks' : 'Read the risks, tick the boxes, ta-da!',
|
|
148
|
-
state: !isFromAllowedCountry ? _ToDoList.ToDoTaskState.NOT_AVAILABLE : is_risk_questionnaire_finished ? _ToDoList.ToDoTaskState.APPROVED : _ToDoList.ToDoTaskState.SKIPPED,
|
|
149
|
-
link: isFromAllowedCountry && "".concat(platformURL, "/risk-questionnaire")
|
|
150
|
-
}]);
|
|
151
|
-
setwalletTasks([{
|
|
152
|
-
title: 'Liquid Address',
|
|
153
|
-
message: !isFromAllowedCountry ? 'Sorry, you are living in a country where this is not available' : liquidWallets.length > 0 ? 'Your address is registered' : 'Register a Liquid address where you will receive the securities',
|
|
154
|
-
state: !isFromAllowedCountry ? _ToDoList.ToDoTaskState.NOT_AVAILABLE : liquidWallets.length > 0 ? _ToDoList.ToDoTaskState.APPROVED : _ToDoList.ToDoTaskState.SKIPPED,
|
|
155
|
-
link: isFromAllowedCountry && "".concat(platformURL, "/register-liquid-securities")
|
|
156
|
-
}]);
|
|
157
|
-
var optionalTasks = [{
|
|
158
|
-
title: 'Tax ID',
|
|
159
|
-
message: !userData.taxId ? 'To invest in certain offerings, you need to provide your tax ID' : userData.taxId && 'You tax ID is submitted',
|
|
160
|
-
state: !userData.taxId ? _ToDoList.ToDoTaskState.SKIPPED : userData.taxId && _ToDoList.ToDoTaskState.APPROVED,
|
|
161
|
-
openModal: _ToDoList.ToDoModal.TAX_ID,
|
|
162
|
-
tooltip: "Some offers require you to provide your Tax ID before being able to invest.\n\nYour tax information will be disclosed to the Luxembourg tax authorities annually for tax compliance purposes required by the Common Reporting Standard implementation."
|
|
163
|
-
}];
|
|
164
|
-
setoptionalTasks(optionalTasks);
|
|
165
|
-
}
|
|
109
|
+
setmandatoryTasks([{
|
|
110
|
+
title: 'Country of Residence',
|
|
111
|
+
message: !country ? 'Please select your country of residence' : !isFromAllowedCountry ? 'STOKR is not yet available where you live' : 'Your country of residence has been registered',
|
|
112
|
+
state: !country ? _ToDoList.ToDoTaskState.SKIPPED : !isFromAllowedCountry ? _ToDoList.ToDoTaskState.DENIED : _ToDoList.ToDoTaskState.APPROVED,
|
|
113
|
+
link: "".concat(platformURL, "/country-of-residence")
|
|
114
|
+
}, {
|
|
115
|
+
title: 'Verify Identity',
|
|
116
|
+
message: getVerifyIdentityChecklist(isFromAllowedCountry, user).message,
|
|
117
|
+
state: getVerifyIdentityChecklist(isFromAllowedCountry, user).state,
|
|
118
|
+
link: getVerifyIdentityChecklist(isFromAllowedCountry, user).hasLink && "".concat(platformURL, "/verify-identity")
|
|
119
|
+
}, {
|
|
120
|
+
title: 'Risk Questionnaire',
|
|
121
|
+
message: !isFromAllowedCountry ? 'Sorry, you are living in a country where this is not available' : is_risk_questionnaire_finished ? 'You have read and understood the risks' : 'Read the risks, tick the boxes, ta-da!',
|
|
122
|
+
state: !isFromAllowedCountry ? _ToDoList.ToDoTaskState.NOT_AVAILABLE : is_risk_questionnaire_finished ? _ToDoList.ToDoTaskState.APPROVED : _ToDoList.ToDoTaskState.SKIPPED,
|
|
123
|
+
link: isFromAllowedCountry && "".concat(platformURL, "/risk-questionnaire")
|
|
124
|
+
}]);
|
|
125
|
+
setwalletTasks([{
|
|
126
|
+
title: 'Liquid Address',
|
|
127
|
+
message: !isFromAllowedCountry ? 'Sorry, you are living in a country where this is not available' : liquidWallets.length > 0 ? 'Your address is registered' : 'Register a Liquid address where you will receive the securities',
|
|
128
|
+
state: !isFromAllowedCountry ? _ToDoList.ToDoTaskState.NOT_AVAILABLE : liquidWallets.length > 0 ? _ToDoList.ToDoTaskState.APPROVED : _ToDoList.ToDoTaskState.SKIPPED,
|
|
129
|
+
link: isFromAllowedCountry && "".concat(platformURL, "/register-liquid-securities")
|
|
130
|
+
}]);
|
|
131
|
+
var optionalTasks = [{
|
|
132
|
+
title: 'Tax ID',
|
|
133
|
+
message: !userData.taxId ? 'To invest in certain offerings, you need to provide your tax ID' : userData.taxId && 'You tax ID is submitted',
|
|
134
|
+
state: !userData.taxId ? _ToDoList.ToDoTaskState.SKIPPED : userData.taxId && _ToDoList.ToDoTaskState.APPROVED,
|
|
135
|
+
openModal: _ToDoList.ToDoModal.TAX_ID,
|
|
136
|
+
tooltip: "Some offers require you to provide your Tax ID before being able to invest.\n\nYour tax information will be disclosed to the Luxembourg tax authorities annually for tax compliance purposes required by the Common Reporting Standard implementation."
|
|
137
|
+
}];
|
|
138
|
+
setoptionalTasks(optionalTasks);
|
|
166
139
|
};
|
|
167
140
|
return /*#__PURE__*/_react.default.createElement(_ToDoList.default, _extends({}, props, {
|
|
168
141
|
mandatoryTasks: mandatoryTasks,
|
|
@@ -33,10 +33,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
33
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
35
|
var Form = function Form(_ref) {
|
|
36
|
-
var children = _ref.children
|
|
36
|
+
var children = _ref.children,
|
|
37
|
+
id = _ref.id;
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_Form.FormContainer, {
|
|
38
39
|
autoComplete: "off",
|
|
39
|
-
noValidate: true
|
|
40
|
+
noValidate: true,
|
|
41
|
+
id: id
|
|
40
42
|
}, children);
|
|
41
43
|
};
|
|
42
44
|
|
|
@@ -51,8 +51,7 @@ var RegisterLiquid = function RegisterLiquid(_ref) {
|
|
|
51
51
|
setShowComplete = _ref.setShowComplete;
|
|
52
52
|
var _useContext = (0, _react.useContext)(_AuthContext.AuthContext),
|
|
53
53
|
user = _useContext.user;
|
|
54
|
-
var
|
|
55
|
-
_user$liquid_network = user.liquid_network,
|
|
54
|
+
var _user$liquid_network = user.liquid_network,
|
|
56
55
|
liquid_network = _user$liquid_network === void 0 ? {} : _user$liquid_network;
|
|
57
56
|
var _useState = (0, _react.useState)(false),
|
|
58
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -182,6 +182,7 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
182
182
|
handleBlur = _ref2.handleBlur,
|
|
183
183
|
setFieldValue = _ref2.setFieldValue,
|
|
184
184
|
setFieldTouched = _ref2.setFieldTouched;
|
|
185
|
+
console.log('🚀 ~ Formik register modal ~ errors:', errors);
|
|
185
186
|
if (popupError.popup === 'register' && !popupErrorWithValue.value) {
|
|
186
187
|
var value = popupError.field === 'email' ? values.email : values.password;
|
|
187
188
|
setpopupErrorWithValue(_objectSpread(_objectSpread({}, popupErrorWithValue), {}, {
|
|
@@ -211,6 +212,8 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
211
212
|
}
|
|
212
213
|
};
|
|
213
214
|
var submitDisabled = !!errors.email || !!errors.terms || values.password.length <= 5 || isActionLoading === 'signUp' || popupError.popup === 'register';
|
|
215
|
+
console.log('🚀 ~ //render ~ popupError:', popupError);
|
|
216
|
+
console.log('🚀 ~ Formik register modal ~ submitDisabled:', submitDisabled);
|
|
214
217
|
return /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
215
218
|
noPadding: true
|
|
216
219
|
}, /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
@@ -44,7 +44,9 @@ var Template = function Template(args) {
|
|
|
44
44
|
var RegisterModalDefault = Template.bind({});
|
|
45
45
|
exports.RegisterModalDefault = RegisterModalDefault;
|
|
46
46
|
RegisterModalDefault.args = {
|
|
47
|
-
popupError: {}
|
|
47
|
+
popupError: {},
|
|
48
|
+
clearPopupError: function clearPopupError() {},
|
|
49
|
+
isModalOpen: true
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
//doublecheck:
|
|
@@ -16,7 +16,6 @@ var StepsProgressSignup = function StepsProgressSignup(props) {
|
|
|
16
16
|
var user = props.user;
|
|
17
17
|
var country = user.country,
|
|
18
18
|
kyc_status = user.kyc_status,
|
|
19
|
-
entity_name = user.entity_name,
|
|
20
19
|
is_risk_questionnaire_finished = user.is_risk_questionnaire_finished,
|
|
21
20
|
taxId = user.taxId,
|
|
22
21
|
_user$wallets = user.wallets,
|
|
@@ -28,28 +27,7 @@ var StepsProgressSignup = function StepsProgressSignup(props) {
|
|
|
28
27
|
var isActiveStep = function isActiveStep(path) {
|
|
29
28
|
return window.location.pathname.includes(path);
|
|
30
29
|
};
|
|
31
|
-
var items =
|
|
32
|
-
id: 'taxId',
|
|
33
|
-
handleClick: function handleClick() {
|
|
34
|
-
return navigate('/taxid');
|
|
35
|
-
},
|
|
36
|
-
isDone: !!taxId,
|
|
37
|
-
isActive: isActiveStep('/taxid')
|
|
38
|
-
}, {
|
|
39
|
-
id: 'ampID',
|
|
40
|
-
handleClick: function handleClick() {
|
|
41
|
-
return navigate('/register-liquid-securities');
|
|
42
|
-
},
|
|
43
|
-
isDone: hasLiquidWallet,
|
|
44
|
-
isActive: isActiveStep('/register-liquid-securities')
|
|
45
|
-
}, {
|
|
46
|
-
id: 'risk',
|
|
47
|
-
handleClick: function handleClick() {
|
|
48
|
-
return navigate('/risk-questionnaire');
|
|
49
|
-
},
|
|
50
|
-
isDone: !!is_risk_questionnaire_finished,
|
|
51
|
-
isActive: isActiveStep('/risk-questionnaire')
|
|
52
|
-
}] : [{
|
|
30
|
+
var items = [{
|
|
53
31
|
id: 'country',
|
|
54
32
|
handleClick: function handleClick() {
|
|
55
33
|
return navigate('/country-of-residence');
|
|
@@ -117,7 +117,7 @@ var RegisterTaxId = function RegisterTaxId(_ref) {
|
|
|
117
117
|
style: {
|
|
118
118
|
color: _colors.default.orangishRed
|
|
119
119
|
}
|
|
120
|
-
}, "Providing your tax ID is not required for KPMG donation"))), taxId && /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
120
|
+
}, "Providing your tax ID is not required for your KPMG donation."))), taxId && /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
121
121
|
noPaddingTop: true
|
|
122
122
|
}, /*#__PURE__*/_react.default.createElement(_Text.default, null, /*#__PURE__*/_react.default.createElement("p", null, "You have successfully submitted your Tax ID information."))), !isUpdatingUser && !error && !taxId && /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
123
123
|
noPaddingVertical: true
|
package/dist/utils/km_ify.js
CHANGED
|
@@ -10,14 +10,14 @@ var km_ify = function km_ify(input, decimals) {
|
|
|
10
10
|
if (input % 10 !== 0) {
|
|
11
11
|
input = truncateDecimals(input, 1);
|
|
12
12
|
}
|
|
13
|
-
input += 'M';
|
|
13
|
+
return input += 'M';
|
|
14
14
|
}
|
|
15
15
|
if (input >= 1000) {
|
|
16
16
|
input /= 1000;
|
|
17
17
|
if (input % 10 !== 0) {
|
|
18
18
|
input = truncateDecimals(input, 1);
|
|
19
19
|
}
|
|
20
|
-
input += 'K';
|
|
20
|
+
return input += 'K';
|
|
21
21
|
}
|
|
22
22
|
if (decimals) {
|
|
23
23
|
return input.toFixed(decimals);
|