@stokr/components-library 2.3.18 → 2.3.20

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.
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.UserChecklist = void 0;
7
+ exports.getVerifyIdentityChecklist = exports.default = exports.UserChecklist = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _ToDoList = _interopRequireWildcard(require("../ToDoList/ToDoList"));
@@ -96,9 +96,7 @@ var UserChecklist = function UserChecklist(props) {
96
96
  }, [mandatoryTasksCount, walletTasksCount, getTasksCount]);
97
97
  var generateTodos = function generateTodos(userData) {
98
98
  var country = user.country,
99
- entity_name = user.entity_name,
100
- countryObj = user.countryObj,
101
- kyc_status = user.kyc_status,
99
+ user_type = user.user_type,
102
100
  _user$wallets = user.wallets,
103
101
  wallets = _user$wallets === void 0 ? [] : _user$wallets;
104
102
  var liquidWallets = wallets.filter(function (wallet) {
@@ -106,12 +104,12 @@ var UserChecklist = function UserChecklist(props) {
106
104
  }) || [];
107
105
  var platformURL = useRelativePath === true ? '' : "https://signup.".concat(_globalVariables.platformDomain);
108
106
  setmandatoryTasks([{
109
- title: 'Country of Residence',
110
- message: !country ? 'Please select your country of residence' : !isFromAllowedCountry ? 'STOKR is not yet available where you live' : 'Your country of residence has been registered',
107
+ title: user_type === _globalVariables.UserTypes.investor_entity ? 'Country of Entity Registration' : 'Country of Residence',
108
+ message: !country ? "Please select your country of ".concat(user_type === _globalVariables.UserTypes.investor_entity ? 'entity registration' : 'residence') : !isFromAllowedCountry ? 'STOKR is not yet available where you live' : "Your country of ".concat(user_type === _globalVariables.UserTypes.investor_entity ? 'entity registration' : 'residence', " has been registered"),
111
109
  state: !country ? _ToDoList.ToDoTaskState.SKIPPED : !isFromAllowedCountry ? _ToDoList.ToDoTaskState.DENIED : _ToDoList.ToDoTaskState.APPROVED,
112
110
  link: "".concat(platformURL, "/country-of-residence")
113
111
  }, {
114
- title: 'Verify Identity',
112
+ title: user_type === _globalVariables.UserTypes.investor_entity ? 'Verify Entity' : 'Verify Identity',
115
113
  message: getVerifyIdentityChecklist(isFromAllowedCountry, user).message,
116
114
  state: getVerifyIdentityChecklist(isFromAllowedCountry, user).state,
117
115
  link: getVerifyIdentityChecklist(isFromAllowedCountry, user).hasLink && "".concat(platformURL, "/verify-identity")
@@ -144,7 +142,8 @@ var UserChecklist = function UserChecklist(props) {
144
142
  };
145
143
  exports.UserChecklist = UserChecklist;
146
144
  var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllowedCountry, user) {
147
- var kyc_status = user.kyc_status;
145
+ var kyc_status = user.kyc_status,
146
+ user_type = user.user_type;
148
147
  var message;
149
148
  var state;
150
149
  var hasLink = false;
@@ -152,17 +151,17 @@ var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllow
152
151
  message = 'Sorry, you are living in a country where this is not available';
153
152
  state = _ToDoList.ToDoTaskState.NOT_AVAILABLE;
154
153
  } else if (!kyc_status || kyc_status.toUpperCase() === 'DRAFT') {
155
- message = 'Scan your ID to get the green light from the anti-fraud squad';
154
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Scan your entity documents to get the green light from the anti-fraud squad' : 'Scan your ID to get the green light from the anti-fraud squad';
156
155
  state = _ToDoList.ToDoTaskState.SKIPPED;
157
156
  hasLink = true;
158
157
  } else if (kyc_status.toUpperCase() === 'REJECTED' || kyc_status.toUpperCase() === 'ESCALATED' || kyc_status.toUpperCase() === 'IN PROGRESS' || kyc_status.toUpperCase() === 'INCONCLUSIVE' || kyc_status.toUpperCase() === 'APPROVED' || kyc_status.toUpperCase() === 'DENIED') {
159
158
  message = 'Our anti-fraud squad is still working';
160
159
  state = _ToDoList.ToDoTaskState.IN_PROGRESS;
161
160
  } else if (kyc_status.toUpperCase() === 'ACCEPTED') {
162
- message = 'Your ID is verified';
161
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Your entity is verified' : 'Your ID is verified';
163
162
  state = _ToDoList.ToDoTaskState.APPROVED;
164
163
  } else if (kyc_status.toUpperCase() === 'REAPPLY' || kyc_status.toUpperCase() === 'CANCELLED') {
165
- message = 'Please verify again your identity';
164
+ message = user_type === _globalVariables.UserTypes.investor_entity ? 'Please verify again your entity' : 'Please verify again your identity';
166
165
  state = _ToDoList.ToDoTaskState.DENIED;
167
166
  hasLink = true;
168
167
  }
@@ -172,6 +171,7 @@ var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllow
172
171
  hasLink: hasLink
173
172
  };
174
173
  };
174
+ exports.getVerifyIdentityChecklist = getVerifyIdentityChecklist;
175
175
  UserChecklist.propTypes = {
176
176
  user: _propTypes.default.object.isRequired,
177
177
  additionalTasks: _propTypes.default.any,
@@ -253,19 +253,24 @@ var Header = function Header(_ref3) {
253
253
  }, /*#__PURE__*/_react.default.createElement(_Header.Logo, {
254
254
  isHighlight: currentActiveMenu === 'main'
255
255
  }, /*#__PURE__*/_react.default.createElement("a", {
256
- href: _globalVariables.platformURL
256
+ href: _globalVariables.platformURL,
257
+ "data-cy": "logo-nav-link"
257
258
  }, /*#__PURE__*/_react.default.createElement(_SvgIcons.LogoSvg, null))), !progress && /*#__PURE__*/_react.default.createElement(_Header.HeaderMainNav, null, /*#__PURE__*/_react.default.createElement(_MenuNav.default, null, /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
258
- href: newPlatformUrl + '/featured-assets'
259
+ href: newPlatformUrl + '/featured-assets',
260
+ "data-cy": "invest-nav-link"
259
261
  }, "Invest")), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
260
262
  onClick: function onClick() {
261
263
  return toggleMenu('products');
262
- }
264
+ },
265
+ "data-cy": "products-nav-link"
263
266
  }, "Products")), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
264
267
  onClick: function onClick() {
265
268
  return toggleMenu('media');
266
- }
269
+ },
270
+ "data-cy": "media-nav-link"
267
271
  }, "Media")), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
268
- href: newPlatformUrl + '/team'
272
+ href: newPlatformUrl + '/team',
273
+ "data-cy": "team-nav-link"
269
274
  }, "Team")))))), progress && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, signupFlow ? /*#__PURE__*/_react.default.createElement(_StepsProgress.StepsProgressSignup, {
270
275
  user: user
271
276
  }) : /*#__PURE__*/_react.default.createElement(_Header.ProgressWrap, null, /*#__PURE__*/_react.default.createElement(_StepsProgress.StepsProgressHeader, {
@@ -292,7 +297,8 @@ var Header = function Header(_ref3) {
292
297
  }, /*#__PURE__*/_react.default.createElement(_breakdown.default, null, /*#__PURE__*/_react.default.createElement(_Header.LoginButton, {
293
298
  onClick: function onClick() {
294
299
  isAdmin ? window.location.href = 'https://admin.' + _globalVariables.platformDomain : window.location.href = "".concat(newPlatformUrlForUserMenu, "/overview");
295
- }
300
+ },
301
+ "data-cy": "dashboard-nav-link"
296
302
  }, "Dashboard")), /*#__PURE__*/_react.default.createElement(_Header.UserAccount, null, /*#__PURE__*/_react.default.createElement(_Header.UserButton, {
297
303
  onClick: function onClick() {
298
304
  return toggleMenu('main');
@@ -302,9 +308,11 @@ var Header = function Header(_ref3) {
302
308
  })), (0, _checkTodoStatus.default)(user) > 0 && /*#__PURE__*/_react.default.createElement(_NotificationCounter.default, {
303
309
  avatar: true
304
310
  }, (0, _checkTodoStatus.default)(user))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, withoutLoginSignupButton ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_breakdown.default, null, /*#__PURE__*/_react.default.createElement(_Header.LoginButton, {
305
- onClick: onLoginClick
311
+ onClick: onLoginClick,
312
+ "data-cy": "login-nav-button"
306
313
  }, "Log in")), /*#__PURE__*/_react.default.createElement(_Header.SignupButton, {
307
- onClick: onSignUpClick
314
+ onClick: onSignUpClick,
315
+ "data-cy": "signup-nav-button"
308
316
  }, "Sign Up")))))), /*#__PURE__*/_react.default.createElement(_Header.MobileMenu, {
309
317
  isActive: currentActiveMenu === 'main',
310
318
  withSidebar: withSidebar
@@ -313,7 +321,8 @@ var Header = function Header(_ref3) {
313
321
  }, /*#__PURE__*/_react.default.createElement(_MenuNav.default, {
314
322
  mobile: true
315
323
  }, /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement(_Header.MobileMenuItem, null, /*#__PURE__*/_react.default.createElement("a", {
316
- href: newPlatformUrl + '/featured-assets'
324
+ href: newPlatformUrl + '/featured-assets',
325
+ "data-cy": "invest-nav-link"
317
326
  }, "Invest")), /*#__PURE__*/_react.default.createElement(RenderSubMenu, {
318
327
  title: "products",
319
328
  isActive: currentActiveSubMenu === 'products',
@@ -61,7 +61,7 @@ exports.SubscribeInputBox = SubscribeInputBox;
61
61
  var SubscribeInput = _styledComponents.default.input.withConfig({
62
62
  displayName: "Newsletterstyles__SubscribeInput",
63
63
  componentId: "sc-53m39a-5"
64
- })(["text-transform:initial;letter-spacing:2.1px;font-size:11px;white-space:nowrap;line-height:2.18;color:white;font-weight:400;flex:1 0 auto;margin-right:56px;padding:8px 0;background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,0.2);outline:none;", " &::-webkit-input-placeholder{color:white;text-transform:uppercase;}&::-moz-placeholder{color:white;text-transform:uppercase;}&::placeholder{color:white;text-transform:uppercase;}"], _rwd.rwdMax.MLarge(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-right: 0;\n display: block;\n width: 100%;\n margin-bottom: 36px;\n "]))));
64
+ })(["text-transform:initial;letter-spacing:2.1px;font-size:11px;white-space:nowrap;line-height:2.18;color:white;font-weight:400;flex:1 0 auto;margin-right:56px;padding:8px 0;background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,0.2);outline:none;&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus,&:-webkit-autofill:active{-webkit-text-fill-color:white !important;-webkit-box-shadow:0 0 0 30px ", " inset !important;transition:background-color 5000s ease-in-out 0s;caret-color:white !important;}", " &::-webkit-input-placeholder{color:white;text-transform:uppercase;}&::-moz-placeholder{color:white;text-transform:uppercase;}&::placeholder{color:white;text-transform:uppercase;}"], sc.RED_BASE_HEX, _rwd.rwdMax.MLarge(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-right: 0;\n display: block;\n width: 100%;\n margin-bottom: 36px;\n "]))));
65
65
  exports.SubscribeInput = SubscribeInput;
66
66
  var SubscribeInputError = _styledComponents.default.p.withConfig({
67
67
  displayName: "Newsletterstyles__SubscribeInputError",
@@ -79,5 +79,5 @@ exports.SubscribeSubmit = SubscribeSubmit;
79
79
  var SubscribeForm = _styledComponents.default.form.withConfig({
80
80
  displayName: "Newsletterstyles__SubscribeForm",
81
81
  componentId: "sc-53m39a-8"
82
- })(["display:flex;", ""], _rwd.rwdMax.MLarge(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: block;\n "]))));
82
+ })(["display:flex;", ""], _rwd.rwdMax.MLarge(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral([" display: block;\n "]))));
83
83
  exports.SubscribeForm = SubscribeForm;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.walletTypes = exports.platformURL = exports.platformDomain = exports.ProjectTypes = exports.ProjectStatus = exports.ProjectStates = void 0;
6
+ exports.walletTypes = exports.platformURL = exports.platformDomain = exports.UserTypes = exports.ProjectTypes = exports.ProjectStatus = exports.ProjectStates = void 0;
7
7
  var platformDomain = process.env.REACT_APP_WEBSITE_DOMAIN;
8
8
  exports.platformDomain = platformDomain;
9
9
  var platformURL = 'https://' + platformDomain;
@@ -32,4 +32,9 @@ var ProjectStates = {
32
32
  CLOSED_SUCCESSFULLY: 'CLOSED SUCCESSFULLY',
33
33
  UPCOMING: 'UPCOMING'
34
34
  };
35
- exports.ProjectStates = ProjectStates;
35
+ exports.ProjectStates = ProjectStates;
36
+ var UserTypes = {
37
+ investor: 'investor',
38
+ investor_entity: 'investor_entity'
39
+ };
40
+ exports.UserTypes = UserTypes;
@@ -657,76 +657,123 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
657
657
  return _ref12.apply(this, arguments);
658
658
  };
659
659
  }());
660
+ _defineProperty(_assertThisInitialized(_this), "checkPrivateInvestorAll", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
661
+ var user,
662
+ returnData,
663
+ _yield$Auth$checkPriv,
664
+ list,
665
+ userCopy,
666
+ _args13 = arguments;
667
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
668
+ while (1) switch (_context13.prev = _context13.next) {
669
+ case 0:
670
+ user = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : _this.state.user;
671
+ returnData = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : false;
672
+ _context13.prev = 2;
673
+ _context13.next = 5;
674
+ return _Auth.default.checkPrivateInvestor();
675
+ case 5:
676
+ _yield$Auth$checkPriv = _context13.sent;
677
+ list = _yield$Auth$checkPriv.list;
678
+ if (!list) {
679
+ _context13.next = 15;
680
+ break;
681
+ }
682
+ userCopy = _objectSpread({}, user);
683
+ userCopy.privateInvestorProjects = list;
684
+ if (!returnData) {
685
+ _context13.next = 14;
686
+ break;
687
+ }
688
+ return _context13.abrupt("return", userCopy);
689
+ case 14:
690
+ _this.setState({
691
+ user: userCopy
692
+ });
693
+ case 15:
694
+ _context13.next = 21;
695
+ break;
696
+ case 17:
697
+ _context13.prev = 17;
698
+ _context13.t0 = _context13["catch"](2);
699
+ console.log('🚀 ~ error in checkPrivateInvestorAll', _context13.t0);
700
+ throw _context13.t0;
701
+ case 21:
702
+ case "end":
703
+ return _context13.stop();
704
+ }
705
+ }, _callee13, null, [[2, 17]]);
706
+ })));
660
707
  _defineProperty(_assertThisInitialized(_this), "checkIfUserSubscribed", /*#__PURE__*/function () {
661
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(project) {
708
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(project) {
662
709
  var user,
663
710
  returnData,
664
711
  dataToSend,
665
712
  isSubscribed,
666
713
  userCopy,
667
- _args13 = arguments;
668
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
669
- while (1) switch (_context13.prev = _context13.next) {
714
+ _args14 = arguments;
715
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
716
+ while (1) switch (_context14.prev = _context14.next) {
670
717
  case 0:
671
- user = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : _this.state.user;
672
- returnData = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : false;
718
+ user = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : _this.state.user;
719
+ returnData = _args14.length > 2 && _args14[2] !== undefined ? _args14[2] : false;
673
720
  if (!(!user || !project)) {
674
- _context13.next = 4;
721
+ _context14.next = 4;
675
722
  break;
676
723
  }
677
- return _context13.abrupt("return");
724
+ return _context14.abrupt("return");
678
725
  case 4:
679
- _context13.prev = 4;
726
+ _context14.prev = 4;
680
727
  dataToSend = {
681
728
  listName: project.name,
682
729
  email: user.email
683
730
  };
684
- _context13.next = 8;
731
+ _context14.next = 8;
685
732
  return _Auth.default.checkIfUserSubscribed(dataToSend);
686
733
  case 8:
687
- isSubscribed = _context13.sent;
734
+ isSubscribed = _context14.sent;
688
735
  userCopy = _objectSpread({}, user);
689
736
  userCopy.isSubscribed = isSubscribed;
690
737
  if (!returnData) {
691
- _context13.next = 15;
738
+ _context14.next = 15;
692
739
  break;
693
740
  }
694
- return _context13.abrupt("return", userCopy);
741
+ return _context14.abrupt("return", userCopy);
695
742
  case 15:
696
743
  _this.setState({
697
744
  user: userCopy
698
745
  });
699
746
  case 16:
700
- _context13.next = 22;
747
+ _context14.next = 22;
701
748
  break;
702
749
  case 18:
703
- _context13.prev = 18;
704
- _context13.t0 = _context13["catch"](4);
705
- console.log('🚀 ~ error in checkIfUserSubscribed', _context13.t0);
706
- throw _context13.t0;
750
+ _context14.prev = 18;
751
+ _context14.t0 = _context14["catch"](4);
752
+ console.log('🚀 ~ error in checkIfUserSubscribed', _context14.t0);
753
+ throw _context14.t0;
707
754
  case 22:
708
755
  case "end":
709
- return _context13.stop();
756
+ return _context14.stop();
710
757
  }
711
- }, _callee13, null, [[4, 18]]);
758
+ }, _callee14, null, [[4, 18]]);
712
759
  }));
713
760
  return function (_x17) {
714
- return _ref13.apply(this, arguments);
761
+ return _ref14.apply(this, arguments);
715
762
  };
716
763
  }());
717
- _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
764
+ _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
718
765
  var location, query, oobCode, customToken, email;
719
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
720
- while (1) switch (_context14.prev = _context14.next) {
766
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
767
+ while (1) switch (_context15.prev = _context15.next) {
721
768
  case 0:
722
769
  _this.setState({
723
770
  isVerifyingEmail: true
724
771
  });
725
772
  location = _this.props.location;
726
773
  query = new URLSearchParams(location.search);
727
- _context14.prev = 3;
774
+ _context15.prev = 3;
728
775
  oobCode = query.get('oobCode');
729
- _context14.next = 7;
776
+ _context15.next = 7;
730
777
  return _Auth.default.handleVerifyEmail(oobCode);
731
778
  case 7:
732
779
  _this.setState({
@@ -736,188 +783,188 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
736
783
  if (customToken) {
737
784
  _this.loginUser(null, null, customToken);
738
785
  }
739
- _context14.next = 28;
786
+ _context15.next = 28;
740
787
  break;
741
788
  case 12:
742
- _context14.prev = 12;
743
- _context14.t0 = _context14["catch"](3);
744
- _context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
745
- _context14.next = _context14.t1 === 'auth/expired-action-code' ? 17 : _context14.t1 === 'auth/invalid-action-code' ? 21 : _context14.t1 === 'auth/user-disabled' ? 23 : 25;
789
+ _context15.prev = 12;
790
+ _context15.t0 = _context15["catch"](3);
791
+ _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
792
+ _context15.next = _context15.t1 === 'auth/expired-action-code' ? 17 : _context15.t1 === 'auth/invalid-action-code' ? 21 : _context15.t1 === 'auth/user-disabled' ? 23 : 25;
746
793
  break;
747
794
  case 17:
748
- _context14.t0.message = 'The activation link has expired. We are sending you a new one right now.';
795
+ _context15.t0.message = 'The activation link has expired. We are sending you a new one right now.';
749
796
  email = query.get('email');
750
797
  if (email) {
751
- _context14.t0.email = email;
798
+ _context15.t0.email = email;
752
799
  //Auth.resendActivationEmail(email)
753
800
  }
754
- return _context14.abrupt("break", 26);
801
+ return _context15.abrupt("break", 26);
755
802
  case 21:
756
- _context14.t0.message = 'This link is invalid. Please try verifying email again.';
757
- return _context14.abrupt("break", 26);
803
+ _context15.t0.message = 'This link is invalid. Please try verifying email again.';
804
+ return _context15.abrupt("break", 26);
758
805
  case 23:
759
- _context14.t0.message = 'Your account has been disabled. Please contact our support.';
760
- return _context14.abrupt("break", 26);
806
+ _context15.t0.message = 'Your account has been disabled. Please contact our support.';
807
+ return _context15.abrupt("break", 26);
761
808
  case 25:
762
- return _context14.abrupt("break", 26);
809
+ return _context15.abrupt("break", 26);
763
810
  case 26:
764
- console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context14.t0);
811
+ console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context15.t0);
765
812
  _this.setState({
766
- verifyEmailError: _context14.t0,
813
+ verifyEmailError: _context15.t0,
767
814
  isVerifyingEmail: false,
768
815
  isFetchingUser: false
769
816
  });
770
817
  //throw error
771
818
  case 28:
772
819
  case "end":
773
- return _context14.stop();
820
+ return _context15.stop();
774
821
  }
775
- }, _callee14, null, [[3, 12]]);
822
+ }, _callee15, null, [[3, 12]]);
776
823
  })));
777
824
  _defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
778
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(password) {
825
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(password) {
779
826
  var location, query, oobCode;
780
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
781
- while (1) switch (_context15.prev = _context15.next) {
827
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
828
+ while (1) switch (_context16.prev = _context16.next) {
782
829
  case 0:
783
830
  location = _this.props.location;
784
- _context15.prev = 1;
831
+ _context16.prev = 1;
785
832
  query = new URLSearchParams(location.search);
786
833
  oobCode = query.get('oobCode');
787
- _context15.next = 6;
834
+ _context16.next = 6;
788
835
  return _Auth.default.handleResetPassword(oobCode, password);
789
836
  case 6:
790
- _context15.next = 21;
837
+ _context16.next = 21;
791
838
  break;
792
839
  case 8:
793
- _context15.prev = 8;
794
- _context15.t0 = _context15["catch"](1);
795
- _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
796
- _context15.next = _context15.t1 === 'auth/expired-action-code' ? 13 : _context15.t1 === 'auth/invalid-action-code' ? 15 : _context15.t1 === 'auth/user-disabled' ? 17 : 19;
840
+ _context16.prev = 8;
841
+ _context16.t0 = _context16["catch"](1);
842
+ _context16.t1 = _context16.t0 === null || _context16.t0 === void 0 ? void 0 : _context16.t0.code;
843
+ _context16.next = _context16.t1 === 'auth/expired-action-code' ? 13 : _context16.t1 === 'auth/invalid-action-code' ? 15 : _context16.t1 === 'auth/user-disabled' ? 17 : 19;
797
844
  break;
798
845
  case 13:
799
- _context15.t0.message = 'This link has expired. Please try reseting password again.';
800
- return _context15.abrupt("break", 20);
846
+ _context16.t0.message = 'This link has expired. Please try reseting password again.';
847
+ return _context16.abrupt("break", 20);
801
848
  case 15:
802
- _context15.t0.message = 'This link is invalid. Please try reseting password again.';
803
- return _context15.abrupt("break", 20);
849
+ _context16.t0.message = 'This link is invalid. Please try reseting password again.';
850
+ return _context16.abrupt("break", 20);
804
851
  case 17:
805
- _context15.t0.message = 'Your account has been disabled. Please contact our support.';
806
- return _context15.abrupt("break", 20);
852
+ _context16.t0.message = 'Your account has been disabled. Please contact our support.';
853
+ return _context16.abrupt("break", 20);
807
854
  case 19:
808
- return _context15.abrupt("break", 20);
855
+ return _context16.abrupt("break", 20);
809
856
  case 20:
810
- throw _context15.t0;
857
+ throw _context16.t0;
811
858
  case 21:
812
859
  case "end":
813
- return _context15.stop();
860
+ return _context16.stop();
814
861
  }
815
- }, _callee15, null, [[1, 8]]);
862
+ }, _callee16, null, [[1, 8]]);
816
863
  }));
817
864
  return function (_x18) {
818
- return _ref15.apply(this, arguments);
865
+ return _ref16.apply(this, arguments);
819
866
  };
820
867
  }());
821
- _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
822
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
823
- while (1) switch (_context16.prev = _context16.next) {
868
+ _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
869
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
870
+ while (1) switch (_context17.prev = _context17.next) {
824
871
  case 0:
825
- _context16.prev = 0;
826
- _context16.next = 3;
872
+ _context17.prev = 0;
873
+ _context17.next = 3;
827
874
  return _Auth.default.sendWelcomeEmail();
828
875
  case 3:
829
- _context16.next = 8;
876
+ _context17.next = 8;
830
877
  break;
831
878
  case 5:
832
- _context16.prev = 5;
833
- _context16.t0 = _context16["catch"](0);
834
- console.log("Error sending welcome email: ".concat(_context16.t0));
879
+ _context17.prev = 5;
880
+ _context17.t0 = _context17["catch"](0);
881
+ console.log("Error sending welcome email: ".concat(_context17.t0));
835
882
  // No need to throw error, let the app continue even if it fails
836
883
  case 8:
837
884
  case "end":
838
- return _context16.stop();
885
+ return _context17.stop();
839
886
  }
840
- }, _callee16, null, [[0, 5]]);
887
+ }, _callee17, null, [[0, 5]]);
841
888
  })));
842
889
  _defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
843
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(data, ip) {
890
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data, ip) {
844
891
  var user;
845
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
846
- while (1) switch (_context17.prev = _context17.next) {
892
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
893
+ while (1) switch (_context18.prev = _context18.next) {
847
894
  case 0:
848
- _context17.prev = 0;
849
- _context17.next = 3;
895
+ _context18.prev = 0;
896
+ _context18.next = 3;
850
897
  return _Auth.default.uploaProofOfAddress(data, ip);
851
898
  case 3:
852
- user = _context17.sent;
899
+ user = _context18.sent;
853
900
  _this.setUser(user);
854
- _context17.next = 11;
901
+ _context18.next = 11;
855
902
  break;
856
903
  case 7:
857
- _context17.prev = 7;
858
- _context17.t0 = _context17["catch"](0);
859
- console.log("Error uploading proof of address: ".concat(_context17.t0));
860
- throw _context17.t0;
904
+ _context18.prev = 7;
905
+ _context18.t0 = _context18["catch"](0);
906
+ console.log("Error uploading proof of address: ".concat(_context18.t0));
907
+ throw _context18.t0;
861
908
  case 11:
862
909
  case "end":
863
- return _context17.stop();
910
+ return _context18.stop();
864
911
  }
865
- }, _callee17, null, [[0, 7]]);
912
+ }, _callee18, null, [[0, 7]]);
866
913
  }));
867
914
  return function (_x19, _x20) {
868
- return _ref17.apply(this, arguments);
915
+ return _ref18.apply(this, arguments);
869
916
  };
870
917
  }());
871
918
  _defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
872
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(id) {
873
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
874
- while (1) switch (_context18.prev = _context18.next) {
919
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(id) {
920
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
921
+ while (1) switch (_context19.prev = _context19.next) {
875
922
  case 0:
876
- _context18.prev = 0;
877
- _context18.next = 3;
923
+ _context19.prev = 0;
924
+ _context19.next = 3;
878
925
  return _Auth.default.validateGreenWalletId(id);
879
926
  case 3:
880
- return _context18.abrupt("return", _context18.sent);
927
+ return _context19.abrupt("return", _context19.sent);
881
928
  case 6:
882
- _context18.prev = 6;
883
- _context18.t0 = _context18["catch"](0);
884
- console.log("Error validating Green Wallet ID: ".concat(_context18.t0));
885
- throw _context18.t0;
929
+ _context19.prev = 6;
930
+ _context19.t0 = _context19["catch"](0);
931
+ console.log("Error validating Green Wallet ID: ".concat(_context19.t0));
932
+ throw _context19.t0;
886
933
  case 10:
887
934
  case "end":
888
- return _context18.stop();
935
+ return _context19.stop();
889
936
  }
890
- }, _callee18, null, [[0, 6]]);
937
+ }, _callee19, null, [[0, 6]]);
891
938
  }));
892
939
  return function (_x21) {
893
- return _ref18.apply(this, arguments);
940
+ return _ref19.apply(this, arguments);
894
941
  };
895
942
  }());
896
943
  _defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
897
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
944
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(data) {
898
945
  var wallet;
899
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
900
- while (1) switch (_context19.prev = _context19.next) {
946
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
947
+ while (1) switch (_context20.prev = _context20.next) {
901
948
  case 0:
902
- _context19.prev = 0;
903
- _context19.next = 3;
949
+ _context20.prev = 0;
950
+ _context20.next = 3;
904
951
  return _Auth.default.createWallet(data);
905
952
  case 3:
906
- wallet = _context19.sent;
907
- return _context19.abrupt("return", wallet);
953
+ wallet = _context20.sent;
954
+ return _context20.abrupt("return", wallet);
908
955
  case 7:
909
- _context19.prev = 7;
910
- _context19.t0 = _context19["catch"](0);
911
- console.log("Error creating wallet: ".concat(_context19.t0));
912
- throw _context19.t0;
956
+ _context20.prev = 7;
957
+ _context20.t0 = _context20["catch"](0);
958
+ console.log("Error creating wallet: ".concat(_context20.t0));
959
+ throw _context20.t0;
913
960
  case 11:
914
961
  case "end":
915
- return _context19.stop();
962
+ return _context20.stop();
916
963
  }
917
- }, _callee19, null, [[0, 7]]);
964
+ }, _callee20, null, [[0, 7]]);
918
965
  }));
919
966
  return function (_x22) {
920
- return _ref19.apply(this, arguments);
967
+ return _ref20.apply(this, arguments);
921
968
  };
922
969
  }());
923
970
  _defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
@@ -929,12 +976,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
929
976
  });
930
977
  });
931
978
  _defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
932
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(projectName, page, userId) {
979
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(projectName, page, userId) {
933
980
  var filterBody, response;
934
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
935
- while (1) switch (_context20.prev = _context20.next) {
981
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
982
+ while (1) switch (_context21.prev = _context21.next) {
936
983
  case 0:
937
- _context20.prev = 0;
984
+ _context21.prev = 0;
938
985
  filterBody = {
939
986
  projectName: projectName,
940
987
  page: page
@@ -942,25 +989,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
942
989
  if (userId) {
943
990
  filterBody.userId = userId;
944
991
  }
945
- _context20.next = 5;
992
+ _context21.next = 5;
946
993
  return _Auth.default.fetchTrackingUserLastTime({
947
994
  filter: filterBody
948
995
  });
949
996
  case 5:
950
- response = _context20.sent;
951
- return _context20.abrupt("return", response);
997
+ response = _context21.sent;
998
+ return _context21.abrupt("return", response);
952
999
  case 9:
953
- _context20.prev = 9;
954
- _context20.t0 = _context20["catch"](0);
955
- console.log(' error', _context20.t0);
1000
+ _context21.prev = 9;
1001
+ _context21.t0 = _context21["catch"](0);
1002
+ console.log(' error', _context21.t0);
956
1003
  case 12:
957
1004
  case "end":
958
- return _context20.stop();
1005
+ return _context21.stop();
959
1006
  }
960
- }, _callee20, null, [[0, 9]]);
1007
+ }, _callee21, null, [[0, 9]]);
961
1008
  }));
962
1009
  return function (_x23, _x24, _x25) {
963
- return _ref20.apply(this, arguments);
1010
+ return _ref21.apply(this, arguments);
964
1011
  };
965
1012
  }());
966
1013
  return _this;
@@ -998,6 +1045,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
998
1045
  getUser: this.getUser,
999
1046
  updateUser: this.updateUser,
1000
1047
  checkIfPrivateInvestor: this.checkIfPrivateInvestor,
1048
+ checkPrivateInvestorAll: this.checkPrivateInvestorAll,
1001
1049
  checkIfUserSubscribed: this.checkIfUserSubscribed,
1002
1050
  sendWelcomeEmail: this.sendWelcomeEmail,
1003
1051
  resendActivationEmail: _Auth.default.resendActivationEmail,
@@ -24,6 +24,7 @@ var formatCurrencyValue = function formatCurrencyValue(currency, value) {
24
24
  'btc-bfx': ['BTC', 8],
25
25
  euro: ['EUR', 2],
26
26
  usd: ['USD', 2],
27
+ chf: ['CHF', 2],
27
28
  lusdt: ['USDT', 2],
28
29
  'bitcoin-private': ['EUR', 2],
29
30
  'lbtc-private': ['BTC', 8],
@@ -40,6 +41,7 @@ var getCurrencySymbol = function getCurrencySymbol(currencySelected) {
40
41
  euro: '€',
41
42
  usd: '$',
42
43
  ether: 'ETH',
44
+ chf: 'CHF',
43
45
  tether: 'USDT',
44
46
  bitcoin: 'BTC',
45
47
  lbtc: 'LBTC',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.18",
3
+ "version": "2.3.20",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",