@stokr/components-library 2.3.58-beta.4 → 2.3.58-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,7 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
78
78
  if ((userMfaEnrollment === null || userMfaEnrollment === void 0 ? void 0 : userMfaEnrollment.length) > 0) {
79
79
  setis2FAEnabled(true);
80
80
  } else if (user) {
81
- checkMfaEnrollment(user);
81
+ checkMfaEnrollment();
82
82
  generateTotp();
83
83
  }
84
84
  }, [user, userMfaEnrollment]);
@@ -131,7 +131,7 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
131
131
  while (1) switch (_context2.prev = _context2.next) {
132
132
  case 0:
133
133
  setis2FAEnabled(true);
134
- checkMfaEnrollment(user);
134
+ checkMfaEnrollment();
135
135
  setsuccessMessage('Your log in 2FA authentication is now set');
136
136
  case 3:
137
137
  case "end":
@@ -149,7 +149,7 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
149
149
  while (1) switch (_context3.prev = _context3.next) {
150
150
  case 0:
151
151
  setis2FAEnabled(false);
152
- checkMfaEnrollment(user);
152
+ checkMfaEnrollment();
153
153
  setsuccessMessage('Your log in 2FA authentication is removed');
154
154
  case 3:
155
155
  case "end":
@@ -186,6 +186,14 @@ var Header = function Header(_ref3) {
186
186
  activeMenu: activeMenu
187
187
  });
188
188
  var isMobile = (0, _customHooks.useMobileView)(_rwd.sizes.MLarge);
189
+ (0, _react.useEffect)(function () {
190
+ return function () {
191
+ // Cleanup on unmount
192
+ document.body.style.overflow = 'unset';
193
+ document.body.style.position = 'relative';
194
+ document.body.style.width = 'auto';
195
+ };
196
+ }, []);
189
197
  (0, _react.useEffect)(function () {
190
198
  //this is used when clicked outside the header
191
199
  if ((prevAmount === null || prevAmount === void 0 ? void 0 : prevAmount.activeMenu) !== activeMenu) {
@@ -125,12 +125,12 @@ var MainMenu = /*#__PURE__*/function (_PureComponent) {
125
125
  as: "button",
126
126
  button: true,
127
127
  nameOption: true,
128
- isVenture: isAdmin
129
- }, /*#__PURE__*/_react.default.createElement("span", {
130
- style: spanStyleForMenu,
128
+ isVenture: isAdmin,
131
129
  onClick: function onClick() {
132
- return isAdmin ? window.location.href = "https://admin.".concat(_globalVariables.platformDomain) : window.location.href = "".concat(platformUrlForUserMenu, "/overview");
130
+ isAdmin ? window.location.href = "https://admin.".concat(_globalVariables.platformDomain) : window.location.href = "".concat(platformUrlForUserMenu, "/overview");
133
131
  }
132
+ }, /*#__PURE__*/_react.default.createElement("span", {
133
+ style: spanStyleForMenu
134
134
  }, "Dashboard")), isAdmin ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isVentureDashboard && /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
135
135
  as: "button",
136
136
  button: true,
@@ -35,7 +35,7 @@ exports.MainMenuOptions = MainMenuOptions;
35
35
  var MainMenuOption = _styledComponents.default.div.withConfig({
36
36
  displayName: "MainMenustyles__MainMenuOption",
37
37
  componentId: "sc-1cw1nhj-3"
38
- })(["background-color:white !important;position:relative;display:flex;flex-basis:33.3333%;justify-content:center;align-items:center;width:100%;padding:4px 16px;outline:none;&:hover{color:#0050ca;color:initial;}&:first-child:hover{color:initial;}", " ", " & + &{border-top:1px solid #e1e1e1;}", " ", " ", " ", " ", " span{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}button{color:#ee220d;border-color:#ee220d;background-color:white;&:hover{color:#be1b09;border-color:#be1b09;}}"], function (_ref) {
38
+ })(["background-color:white !important;position:relative;display:flex;flex-basis:33.3333%;justify-content:center;align-items:center;width:100%;padding:4px 16px;outline:none;&:hover{font-weight:bold;}", " ", " & + &{border-top:1px solid #e1e1e1;}", " ", " ", " ", " ", " span{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}button{color:#ee220d;border-color:#ee220d;background-color:white;&:hover{color:#be1b09;border-color:#be1b09;}}"], function (_ref) {
39
39
  var isDashboard = _ref.isDashboard;
40
40
  return isDashboard && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-color: #e1e1e1 !important;\n "])));
41
41
  }, function (_ref2) {
@@ -251,6 +251,12 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
251
251
  return _this;
252
252
  }
253
253
  _createClass(HeaderHoClass, [{
254
+ key: "componentWillUnmount",
255
+ value: function componentWillUnmount() {
256
+ // Force unlock body scrolling when component unmounts
257
+ document.body.style.overflow = 'unset';
258
+ }
259
+ }, {
254
260
  key: "componentDidUpdate",
255
261
  value: function componentDidUpdate(prevProps, prevState) {
256
262
  // If any popup is open, prevent body from scrolling
@@ -266,6 +272,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
266
272
  verifyEmailError = _this$context.verifyEmailError;
267
273
  if (!mobileMenuOpen) {
268
274
  if (isOpenCurrent) {
275
+ console.log('🚀 ~ componentDidUpdate ~ isOpenCurrent:', isOpenCurrent);
269
276
  document.body.style.overflow = 'hidden';
270
277
  } else if (isOpenPrev) {
271
278
  document.body.style.overflow = 'unset';
@@ -211,46 +211,43 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
211
211
  return _ref3.apply(this, arguments);
212
212
  };
213
213
  }());
214
- _defineProperty(_assertThisInitialized(_this), "generateTotpSecret", /*#__PURE__*/function () {
215
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(user) {
216
- var appName,
217
- multiFactorSession,
218
- totpSecret,
219
- totpUri,
220
- _args4 = arguments;
221
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
222
- while (1) switch (_context4.prev = _context4.next) {
223
- case 0:
224
- appName = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 'STOKR';
225
- _context4.prev = 1;
226
- _context4.next = 4;
227
- return (0, _auth.multiFactor)(user).getSession();
228
- case 4:
229
- multiFactorSession = _context4.sent;
230
- _context4.next = 7;
231
- return _auth.TotpMultiFactorGenerator.generateSecret(multiFactorSession);
232
- case 7:
233
- totpSecret = _context4.sent;
234
- totpUri = totpSecret.generateQrCodeUrl(user.email, appName);
235
- return _context4.abrupt("return", {
236
- totpUri: totpUri,
237
- totpSecret: totpSecret
238
- });
239
- case 12:
240
- _context4.prev = 12;
241
- _context4.t0 = _context4["catch"](1);
242
- console.log('🚀 ~ file: AuthContext.js:51 ~ error:', _context4.t0);
243
- throw _context4.t0;
244
- case 16:
245
- case "end":
246
- return _context4.stop();
247
- }
248
- }, _callee4, null, [[1, 12]]);
249
- }));
250
- return function (_x8) {
251
- return _ref4.apply(this, arguments);
252
- };
253
- }());
214
+ _defineProperty(_assertThisInitialized(_this), "generateTotpSecret", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
215
+ var user,
216
+ appName,
217
+ multiFactorSession,
218
+ totpSecret,
219
+ totpUri,
220
+ _args4 = arguments;
221
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
222
+ while (1) switch (_context4.prev = _context4.next) {
223
+ case 0:
224
+ user = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : _firebaseConfig.auth.currentUser;
225
+ appName = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 'STOKR';
226
+ _context4.prev = 2;
227
+ _context4.next = 5;
228
+ return (0, _auth.multiFactor)(user).getSession();
229
+ case 5:
230
+ multiFactorSession = _context4.sent;
231
+ _context4.next = 8;
232
+ return _auth.TotpMultiFactorGenerator.generateSecret(multiFactorSession);
233
+ case 8:
234
+ totpSecret = _context4.sent;
235
+ totpUri = totpSecret.generateQrCodeUrl(user.email, appName);
236
+ return _context4.abrupt("return", {
237
+ totpUri: totpUri,
238
+ totpSecret: totpSecret
239
+ });
240
+ case 13:
241
+ _context4.prev = 13;
242
+ _context4.t0 = _context4["catch"](2);
243
+ console.log('🚀 ~ file: AuthContext.js:51 ~ error:', _context4.t0);
244
+ throw _context4.t0;
245
+ case 17:
246
+ case "end":
247
+ return _context4.stop();
248
+ }
249
+ }, _callee4, null, [[2, 13]]);
250
+ })));
254
251
  _defineProperty(_assertThisInitialized(_this), "unenrollUser2FA", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
255
252
  var _this$state, userMfaEnrollment, user, i;
256
253
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
@@ -293,7 +290,8 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
293
290
  }
294
291
  }, _callee5, null, [[4, 14]]);
295
292
  })));
296
- _defineProperty(_assertThisInitialized(_this), "checkMfaEnrollment", function (user) {
293
+ _defineProperty(_assertThisInitialized(_this), "checkMfaEnrollment", function () {
294
+ var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _firebaseConfig.auth.currentUser;
297
295
  var checkMfaEnrollment = (0, _auth.multiFactor)(user).enrolledFactors;
298
296
  _this.setState({
299
297
  userMfaEnrollment: checkMfaEnrollment
@@ -324,7 +322,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
324
322
  }
325
323
  }, _callee6, null, [[0, 6]]);
326
324
  }));
327
- return function (_x9, _x10, _x11, _x12) {
325
+ return function (_x8, _x9, _x10, _x11) {
328
326
  return _ref6.apply(this, arguments);
329
327
  };
330
328
  }());
@@ -516,7 +514,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
516
514
  }
517
515
  }, _callee9, null, [[0, 14]]);
518
516
  }));
519
- return function (_x13, _x14) {
517
+ return function (_x12, _x13) {
520
518
  return _ref9.apply(this, arguments);
521
519
  };
522
520
  }());
@@ -595,7 +593,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
595
593
  }
596
594
  }, _callee11, null, [[0, 19]]);
597
595
  }));
598
- return function (_x15) {
596
+ return function (_x14) {
599
597
  return _ref11.apply(this, arguments);
600
598
  };
601
599
  }());
@@ -653,7 +651,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
653
651
  }
654
652
  }, _callee12, null, [[4, 19]]);
655
653
  }));
656
- return function (_x16) {
654
+ return function (_x15) {
657
655
  return _ref12.apply(this, arguments);
658
656
  };
659
657
  }());
@@ -757,7 +755,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
757
755
  }
758
756
  }, _callee14, null, [[4, 18]]);
759
757
  }));
760
- return function (_x17) {
758
+ return function (_x16) {
761
759
  return _ref14.apply(this, arguments);
762
760
  };
763
761
  }());
@@ -912,7 +910,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
912
910
  }
913
911
  }, _callee17, null, [[1, 8]]);
914
912
  }));
915
- return function (_x18) {
913
+ return function (_x17) {
916
914
  return _ref17.apply(this, arguments);
917
915
  };
918
916
  }());
@@ -962,7 +960,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
962
960
  }
963
961
  }, _callee19, null, [[0, 7]]);
964
962
  }));
965
- return function (_x19, _x20) {
963
+ return function (_x18, _x19) {
966
964
  return _ref19.apply(this, arguments);
967
965
  };
968
966
  }());
@@ -987,7 +985,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
987
985
  }
988
986
  }, _callee20, null, [[0, 6]]);
989
987
  }));
990
- return function (_x21) {
988
+ return function (_x20) {
991
989
  return _ref20.apply(this, arguments);
992
990
  };
993
991
  }());
@@ -1014,7 +1012,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1014
1012
  }
1015
1013
  }, _callee21, null, [[0, 7]]);
1016
1014
  }));
1017
- return function (_x22) {
1015
+ return function (_x21) {
1018
1016
  return _ref21.apply(this, arguments);
1019
1017
  };
1020
1018
  }());
@@ -1057,7 +1055,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1057
1055
  }
1058
1056
  }, _callee22, null, [[0, 9]]);
1059
1057
  }));
1060
- return function (_x23, _x24, _x25) {
1058
+ return function (_x22, _x23, _x24) {
1061
1059
  return _ref22.apply(this, arguments);
1062
1060
  };
1063
1061
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.58-beta.4",
3
+ "version": "2.3.58-beta.5",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",