@stokr/components-library 2.0.7 β 2.0.9
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/2FA/enable-2fa-flow.js +1 -1
- package/dist/components/2FA/login-with-otp-flow.js +2 -0
- package/dist/components/2FA/main-flow.js +7 -7
- package/dist/components/AnalyticGraphs/Analytic.js +1 -2
- package/dist/components/Header/Header.styles.js +1 -1
- package/dist/components/RegisterAlgorand/AlgoAdressSelect.js +10 -11
- package/dist/components/RegisterAlgorand/SelectProject.js +0 -1
- package/dist/components/headerHo/HeaderHo.js +2 -3
- package/dist/context/AuthContext.js +17 -24
- package/dist/utils/check-sale-time-left.js +0 -1
- package/package.json +1 -1
|
@@ -188,7 +188,7 @@ var Enable2FAFlow = function Enable2FAFlow(_ref) {
|
|
|
188
188
|
}), /*#__PURE__*/_react.default.createElement(_EnterCode.default, {
|
|
189
189
|
id: "enter-code",
|
|
190
190
|
changeStep: function changeStep() {
|
|
191
|
-
console.log('here')
|
|
191
|
+
// console.log('here')
|
|
192
192
|
},
|
|
193
193
|
popupError: popupError,
|
|
194
194
|
onFormSend: onSubmit
|
|
@@ -217,6 +217,8 @@ var LoginWithOTP = function LoginWithOTP(_ref) {
|
|
|
217
217
|
console.log('π ~ file: login-with-otp-flow.js:129 ~ error:', _context2.t0);
|
|
218
218
|
if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/invalid-verification-code') {
|
|
219
219
|
handleSetPopupError('enter2fa', 'The verification code is not correct. Try again?');
|
|
220
|
+
} else if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/code-expired') {
|
|
221
|
+
handleSetPopupError('enter2fa', 'Time out. Please restart the flow and log in again');
|
|
220
222
|
} else {
|
|
221
223
|
handleSetPopupError('enter2fa', _context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message);
|
|
222
224
|
}
|
|
@@ -61,7 +61,6 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
|
|
|
61
61
|
setsuccessMessage = _useState6[1];
|
|
62
62
|
(0, _react.useEffect)(function () {
|
|
63
63
|
if (userMfaEnrollment) {
|
|
64
|
-
console.log('π ~ file: main-flow.js:25 ~ userMfaEnrollment:', userMfaEnrollment);
|
|
65
64
|
if (userMfaEnrollment.length > 0) setis2FAEnabled(true);
|
|
66
65
|
} else if (user) {
|
|
67
66
|
checkMfaEnrollment(user);
|
|
@@ -145,13 +144,14 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
|
|
|
145
144
|
switchOpenFlow('enable2fa', 'disable2fa');
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
}))
|
|
149
|
-
alignVertically: true,
|
|
150
|
-
noPaddingHorizontal: true,
|
|
151
|
-
noPaddingTop: true
|
|
152
|
-
}, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
147
|
+
})), successMessage && /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
153
148
|
small: true,
|
|
154
|
-
success: true
|
|
149
|
+
success: true,
|
|
150
|
+
style: {
|
|
151
|
+
position: 'absolute',
|
|
152
|
+
bottom: 0,
|
|
153
|
+
left: 0
|
|
154
|
+
}
|
|
155
155
|
}, /*#__PURE__*/_react.default.createElement("p", null, successMessage))), isFlowopen.enable2fa && /*#__PURE__*/_react.default.createElement(_enable2faFlow.default, {
|
|
156
156
|
showFlow: isFlowopen.enable2fa,
|
|
157
157
|
setShowFlow: function setShowFlow(value) {
|
|
@@ -52,7 +52,6 @@ var Analytic = /*#__PURE__*/function () {
|
|
|
52
52
|
return matomoConnect.init(matomoConnect.GetVisitsSummary, 'month', "".concat(this.START_DATE.format('YYYY-MM-DD'), ",").concat(this.CURRENT_DATE.format('YYYY-MM-DD')));
|
|
53
53
|
case 3:
|
|
54
54
|
this.VISITS_SUMMARY = _context.sent;
|
|
55
|
-
console.log('visits summary: ', this.VISITS_SUMMARY);
|
|
56
55
|
Object.keys(this.VISITS_SUMMARY).forEach(function (key) {
|
|
57
56
|
_this.TOTAL_SUMMARY.visits += _this.VISITS_SUMMARY[key].nb_visits || 0;
|
|
58
57
|
_this.TOTAL_SUMMARY.bounce_count += _this.VISITS_SUMMARY[key].bounce_count || 0;
|
|
@@ -60,7 +59,7 @@ var Analytic = /*#__PURE__*/function () {
|
|
|
60
59
|
_this.TOTAL_SUMMARY.unique_visitors += _this.VISITS_SUMMARY[key].nb_uniq_visitors || 0;
|
|
61
60
|
_this.TOTAL_SUMMARY.avg_time_on_site += _this.VISITS_SUMMARY[key].avg_time_on_site || 0;
|
|
62
61
|
});
|
|
63
|
-
case
|
|
62
|
+
case 5:
|
|
64
63
|
case "end":
|
|
65
64
|
return _context.stop();
|
|
66
65
|
}
|
|
@@ -26,7 +26,7 @@ exports.StyledSubMenu = StyledSubMenu;
|
|
|
26
26
|
var StyledHeader = _styledComponents.default.header.withConfig({
|
|
27
27
|
displayName: "Headerstyles__StyledHeader",
|
|
28
28
|
componentId: "sc-hifrdy-1"
|
|
29
|
-
})(["z-index:
|
|
29
|
+
})(["z-index:1000;position:relative;color:", ";border-bottom:1px solid rgb(237,237,237);", ""], _colors.default.black, _rwd.default.MLarge(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: ", "px;\n background-color: ", ";\n box-shadow: inset 0 -1px 0 0 ", ";\n\n ", "\n "])), _spacing.default.headerHeight, _colors.default.white, _colors.default.lightGrey, function (props) {
|
|
30
30
|
return props.noFixedPosition && "\n position:initial;\n ";
|
|
31
31
|
}));
|
|
32
32
|
exports.StyledHeader = StyledHeader;
|
|
@@ -211,7 +211,7 @@ var AlgoAdressSelect = function AlgoAdressSelect(props) {
|
|
|
211
211
|
while (1) switch (_context3.prev = _context3.next) {
|
|
212
212
|
case 0:
|
|
213
213
|
if (!(0, _StokrWeb.isAlgoSignerInstalled)()) {
|
|
214
|
-
_context3.next =
|
|
214
|
+
_context3.next = 18;
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
217
|
_context3.prev = 1;
|
|
@@ -219,31 +219,30 @@ var AlgoAdressSelect = function AlgoAdressSelect(props) {
|
|
|
219
219
|
return (0, _StokrWeb.getAlgoSignerAddress)(props.network);
|
|
220
220
|
case 4:
|
|
221
221
|
_address = _context3.sent;
|
|
222
|
-
console.log('address: ', _address);
|
|
223
222
|
if (!_address) {
|
|
224
|
-
_context3.next =
|
|
223
|
+
_context3.next = 11;
|
|
225
224
|
break;
|
|
226
225
|
}
|
|
227
|
-
_context3.next =
|
|
226
|
+
_context3.next = 8;
|
|
228
227
|
return getBalanceData(_address);
|
|
229
|
-
case
|
|
228
|
+
case 8:
|
|
230
229
|
setfailed(false);
|
|
231
230
|
setcorrect(true);
|
|
232
231
|
setaddress(_address);
|
|
233
|
-
case
|
|
234
|
-
_context3.next =
|
|
232
|
+
case 11:
|
|
233
|
+
_context3.next = 18;
|
|
235
234
|
break;
|
|
236
|
-
case
|
|
237
|
-
_context3.prev =
|
|
235
|
+
case 13:
|
|
236
|
+
_context3.prev = 13;
|
|
238
237
|
_context3.t0 = _context3["catch"](1);
|
|
239
238
|
console.log('eroor: ', _context3.t0);
|
|
240
239
|
setfailed(true);
|
|
241
240
|
setcorrect(false);
|
|
242
|
-
case
|
|
241
|
+
case 18:
|
|
243
242
|
case "end":
|
|
244
243
|
return _context3.stop();
|
|
245
244
|
}
|
|
246
|
-
}, _callee3, null, [[1,
|
|
245
|
+
}, _callee3, null, [[1, 13]]);
|
|
247
246
|
}));
|
|
248
247
|
return function initAlgoSigner() {
|
|
249
248
|
return _ref2.apply(this, arguments);
|
|
@@ -58,7 +58,6 @@ var SelectProject = function SelectProject(_ref) {
|
|
|
58
58
|
setselectedProject(project);
|
|
59
59
|
changeStep();
|
|
60
60
|
} else {
|
|
61
|
-
console.log('π ~ process.env', process.env);
|
|
62
61
|
window.location.href = "https://".concat(process.env.REACT_APP_WEBSITE_DOMAIN, "/").concat(project.name);
|
|
63
62
|
}
|
|
64
63
|
}
|
|
@@ -449,6 +449,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
449
449
|
console.log('π ~ file: HeaderHo.jsx:364 ~ error:', _context2.t0);
|
|
450
450
|
if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/invalid-verification-code') {
|
|
451
451
|
_this2.setPopupError('enter2fa', 'Thatβs not the right 2FA code. Try again');
|
|
452
|
+
} else if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/code-expired') {
|
|
453
|
+
_this2.setPopupError('enter2fa', 'Time out. Please restart the flow and log in again');
|
|
452
454
|
} else {
|
|
453
455
|
_this2.setPopupError('enter2fa', _context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message);
|
|
454
456
|
}
|
|
@@ -706,9 +708,6 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
706
708
|
password = _ref10.password;
|
|
707
709
|
_this2.clearPopupError();
|
|
708
710
|
_this2.setIsActionLoading('resetPassword');
|
|
709
|
-
|
|
710
|
-
//localhost:3001/manage-user?mode=resetPassword&oobCode=PT_AyRFYWXwDe0Ols12TOKSiGQUSdb6mM4DKDLwHGdQAAAGMgUUaEQ&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
|
|
711
|
-
//https://stokr.info/manage-user?mode=resetPassword&oobCode=TGhCFwb9uLeYiL2Hp4LFgRg5Fd9osw1Fvza4qY5Hhy0AAAGMgmuGuw&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
|
|
712
711
|
_context6.prev = 3;
|
|
713
712
|
_context6.next = 6;
|
|
714
713
|
return handleResetPassword(password);
|
|
@@ -297,7 +297,6 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
297
297
|
})));
|
|
298
298
|
_defineProperty(_assertThisInitialized(_this), "checkMfaEnrollment", function (user) {
|
|
299
299
|
var checkMfaEnrollment = (0, _auth.multiFactor)(user).enrolledFactors;
|
|
300
|
-
console.log('π ~ file: AuthContext.js:173 ~ checkMfaEnrollment:', checkMfaEnrollment);
|
|
301
300
|
_this.setState({
|
|
302
301
|
userMfaEnrollment: checkMfaEnrollment
|
|
303
302
|
});
|
|
@@ -338,9 +337,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
338
337
|
while (1) switch (_context7.prev = _context7.next) {
|
|
339
338
|
case 0:
|
|
340
339
|
redirect = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : false;
|
|
341
|
-
(0, _auth.signOut)(_firebaseConfig.auth).then(function () {
|
|
342
|
-
console.log('logged out');
|
|
343
|
-
});
|
|
340
|
+
(0, _auth.signOut)(_firebaseConfig.auth).then(function () {});
|
|
344
341
|
_Auth.default.logout();
|
|
345
342
|
delete _axios.default.defaults.headers.common.Authorization;
|
|
346
343
|
_this.setUser(null);
|
|
@@ -400,34 +397,31 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
400
397
|
isFetchingUser: true
|
|
401
398
|
});
|
|
402
399
|
_axios.default.defaults.headers.common.Authorization = "Bearer ".concat(accessToken);
|
|
403
|
-
|
|
400
|
+
|
|
404
401
|
//pass this function as a prop if you need any custom logic after user/get
|
|
405
402
|
customValidateGetUser = _this.props.customValidateGetUser;
|
|
406
|
-
_context8.prev =
|
|
407
|
-
_context8.next =
|
|
403
|
+
_context8.prev = 7;
|
|
404
|
+
_context8.next = 10;
|
|
408
405
|
return _Auth.default.getUser();
|
|
409
|
-
case
|
|
406
|
+
case 10:
|
|
410
407
|
result = _context8.sent;
|
|
411
408
|
firebaseUser = _this.state.firebaseUser;
|
|
412
409
|
if (firebaseUser) {
|
|
413
|
-
_context8.next =
|
|
410
|
+
_context8.next = 20;
|
|
414
411
|
break;
|
|
415
412
|
}
|
|
416
|
-
_context8.next =
|
|
413
|
+
_context8.next = 15;
|
|
417
414
|
return (0, _fetchData.default)('auth/get-custom-token');
|
|
418
|
-
case
|
|
415
|
+
case 15:
|
|
419
416
|
_yield$fetchData = _context8.sent;
|
|
420
417
|
customToken = _yield$fetchData.customToken;
|
|
421
|
-
_context8.next =
|
|
418
|
+
_context8.next = 19;
|
|
422
419
|
return _Auth.default.signInWithToken(customToken);
|
|
423
|
-
case
|
|
420
|
+
case 19:
|
|
424
421
|
firebaseUser = _context8.sent;
|
|
425
|
-
case
|
|
422
|
+
case 20:
|
|
426
423
|
//merge firebaseUser and our user object
|
|
427
|
-
user = _this.patchUserObject(result.user, firebaseUser);
|
|
428
|
-
console.log('π ~ file: AuthContext.js:259 ~ user:', user);
|
|
429
|
-
|
|
430
|
-
//if user is empty throw an error
|
|
424
|
+
user = _this.patchUserObject(result.user, firebaseUser); //if user is empty throw an error
|
|
431
425
|
//if user hasn't completed the signup process, redirect to welcome page on signup
|
|
432
426
|
_this.checkUserIsValid(user);
|
|
433
427
|
customValidateGetUser && customValidateGetUser(user);
|
|
@@ -443,19 +437,19 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
443
437
|
|
|
444
438
|
//if you need user info immediately after call (before setState is executed), you can use this
|
|
445
439
|
return _context8.abrupt("return", user);
|
|
446
|
-
case
|
|
447
|
-
_context8.prev =
|
|
448
|
-
_context8.t0 = _context8["catch"](
|
|
440
|
+
case 31:
|
|
441
|
+
_context8.prev = 31;
|
|
442
|
+
_context8.t0 = _context8["catch"](7);
|
|
449
443
|
_this.setState({
|
|
450
444
|
isFetchingUser: false
|
|
451
445
|
});
|
|
452
446
|
console.log("Error in getUser: ".concat(_context8.t0));
|
|
453
447
|
throw _context8.t0;
|
|
454
|
-
case
|
|
448
|
+
case 36:
|
|
455
449
|
case "end":
|
|
456
450
|
return _context8.stop();
|
|
457
451
|
}
|
|
458
|
-
}, _callee8, null, [[
|
|
452
|
+
}, _callee8, null, [[7, 31]]);
|
|
459
453
|
})));
|
|
460
454
|
_defineProperty(_assertThisInitialized(_this), "checkUserPhoto", function (avatar) {
|
|
461
455
|
try {
|
|
@@ -474,7 +468,6 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
474
468
|
}
|
|
475
469
|
});
|
|
476
470
|
_defineProperty(_assertThisInitialized(_this), "checkUserIsValid", function (user) {
|
|
477
|
-
console.log('π ~ check user is valid:');
|
|
478
471
|
if (!user) {
|
|
479
472
|
throw new Error('User is not defined');
|
|
480
473
|
} else if (!(user !== null && user !== void 0 && user.emailVerified) && !window.location.href.includes('signup.')) {
|
|
@@ -80,7 +80,6 @@ var checkSaleTimeLeft = function checkSaleTimeLeft(project) {
|
|
|
80
80
|
hasClosed: false
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
console.log('π ~ file: TrendingSlide.jsx:772 ~ timeLeftData:', timeLeftData, project.name, calculateTimeLeft(timeLeftData));
|
|
84
83
|
}
|
|
85
84
|
return calculateTimeLeft(timeLeftData);
|
|
86
85
|
};
|