@stokr/components-library 2.0.0-beta.6 → 2.0.0-beta.7

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.
@@ -133,7 +133,6 @@ var RegisterModal = function RegisterModal(props) {
133
133
  }();
134
134
  var validationSchema = Yup.object().shape({
135
135
  email: Yup.string().email("Oops, that's not a valid address").required('Oops, this can‘t be blank'),
136
- username: Yup.string(),
137
136
  password: Yup.string().required('Oops, this can‘t be blank'),
138
137
  terms: Yup.bool().oneOf([true], 'Please agree to continue'),
139
138
  newsletter: Yup.bool() // .oneOf([true], 'Newsletter accept is required'),
@@ -168,7 +167,6 @@ var RegisterModal = function RegisterModal(props) {
168
167
  }, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, null, /*#__PURE__*/_react.default.createElement(_formik.Formik, {
169
168
  initialValues: {
170
169
  email: '',
171
- username: '',
172
170
  password: '',
173
171
  newsletter: false,
174
172
  terms: false
@@ -186,7 +184,7 @@ var RegisterModal = function RegisterModal(props) {
186
184
  setFieldValue = _ref2.setFieldValue,
187
185
  setFieldTouched = _ref2.setFieldTouched;
188
186
  if (popupError.popup === 'register' && !popupErrorWithValue.value) {
189
- var value = popupError.field === 'username' ? values.username : popupError.field === 'email' ? values.email : values.password;
187
+ var value = popupError.field === 'email' ? values.email : values.password;
190
188
  setpopupErrorWithValue(_objectSpread(_objectSpread({}, popupErrorWithValue), {}, {
191
189
  value: value
192
190
  }));
@@ -234,25 +232,6 @@ var RegisterModal = function RegisterModal(props) {
234
232
  }, errors.email))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
235
233
  noPaddingBottom: true,
236
234
  noPaddingHorizontal: true
237
- // paddingTop="47"
238
- }, /*#__PURE__*/_react.default.createElement(_formikPersist.Persist, {
239
- name: "signup-username",
240
- isSessionStorage: true
241
- }), /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_InputUsername.default, {
242
- id: "sign-up-username",
243
- name: "username",
244
- type: "text",
245
- label: "Your username",
246
- value: values.username,
247
- onChange: handleChangeCustom,
248
- onBlur: handleBlur,
249
- error: !!errors.username,
250
- touched: !!touched.username
251
- }), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
252
- show: errors.username && touched.username
253
- }, errors.username))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
254
- noPaddingBottom: true,
255
- noPaddingHorizontal: true
256
235
  }, /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_InputPassword.default, {
257
236
  id: "sign-up-password",
258
237
  name: "password",
@@ -96,6 +96,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
96
96
  isLogin = _this$props.isLogin,
97
97
  isSignUp = _this$props.isSignUp,
98
98
  isResetPassword = _this$props.isResetPassword;
99
+ console.log('🚀 ~ file: HeaderHo.jsx:102 ~ this.props:', _this.props);
99
100
  var user = _this.context.user;
100
101
  var isModalOpen = _this.state.isModalOpen;
101
102
  var login = isModalOpen.login,
@@ -155,6 +156,12 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
155
156
  });
156
157
  _defineProperty(_assertThisInitialized(_this), "switchOpenModal", function (prevModalId, nextModalId) {
157
158
  var isModalOpen = _this.state.isModalOpen;
159
+
160
+ //if you previously were on /signup or any other route and you want to swtich to login modal
161
+ //we need to change the url accordingly to override passed props which opens previous modal
162
+ if (nextModalId === 'login' || nextModalId === 'signUp') {
163
+ window.history.pushState('', '', nextModalId === 'login' ? '/login' : nextModalId === 'signUp' ? '/signup' : '/');
164
+ }
158
165
  _this.setState(function (prevState) {
159
166
  var _objectSpread3;
160
167
  return _objectSpread(_objectSpread({}, prevState), {}, {
@@ -480,70 +487,43 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
480
487
  },
481
488
  onFormSend: /*#__PURE__*/function () {
482
489
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(userInfo) {
483
- var referralCode, checkedCheckboxes;
484
490
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
485
491
  while (1) switch (_context3.prev = _context3.next) {
486
492
  case 0:
487
493
  _this2.clearPopupError();
488
494
  _this2.setIsActionLoading('signUp');
489
- referralCode = _jsCookie.default.get('STOKR_REFERRAL_CODE'); //check username
490
- // try {
491
- // const result = await fetchDataPublic('user/checkUsernameExists', {
492
- // username: userInfo.username,
493
- // })
494
- // if (result.usernameExists) {
495
- // this.setPopupError(
496
- // 'register',
497
- // 'This username is already taken',
498
- // 'username',
499
- // )
500
- // this.setIsActionLoading(undefined)
501
- // return
502
- // }
503
- // } catch (error) {
504
- // console.log(error)
505
- // this.setPopupError('register', 'Oops, something went wrong')
506
- // this.setIsActionLoading(undefined)
507
- // return
508
- // }
495
+
509
496
  //check password
510
- _context3.prev = 3;
497
+ _context3.prev = 2;
511
498
  if (!(userInfo.password.length > 128)) {
512
- _context3.next = 8;
499
+ _context3.next = 7;
513
500
  break;
514
501
  }
515
502
  _this2.setPopupError('register', 'Your password cannot exceed 128 characters', 'password');
516
503
  _this2.setIsActionLoading(undefined);
517
504
  return _context3.abrupt("return");
518
- case 8:
519
- //we add the checked checkboxes at the end because sometimes the checkboxes are already checked in persist storage
520
- //so we want to make sure that the EP receives checkedCheckboxes
521
- checkedCheckboxes = [];
522
- if (userInfo.newsletter) checkedCheckboxes.push('newsletter');
523
- if (userInfo.terms) checkedCheckboxes.push('privacyTerms');
524
-
525
- // await authAPI('signup', {
526
- // email: userInfo.email,
527
- // password: userInfo.password,
528
- // userType: 'investor',
529
- // // fa2: false,
530
- // newsletter: userInfo.newsletter,
531
- // terms: userInfo.terms,
532
- // username: userInfo.username,
533
- // tapfiliateReferralCode: referralCode,
534
- // checkedCheckboxes,
535
- // })
536
- _context3.next = 13;
505
+ case 7:
506
+ _context3.next = 9;
537
507
  return createUser(userInfo.email, userInfo.password);
538
- case 13:
508
+ case 9:
509
+ if (!userInfo.newsletter) {
510
+ _context3.next = 12;
511
+ break;
512
+ }
513
+ _context3.next = 12;
514
+ return (0, _fetchDataPublic.default)('emails/subscribe', {
515
+ email: userInfo.email,
516
+ listName: 'newsletter'
517
+ });
518
+ case 12:
539
519
  _this2.setUserInfo(userInfo);
540
520
  _this2.switchOpenModal('signUp', 'confirm');
541
521
  _this2.setIsActionLoading(undefined);
542
- _context3.next = 23;
522
+ _context3.next = 22;
543
523
  break;
544
- case 18:
545
- _context3.prev = 18;
546
- _context3.t0 = _context3["catch"](3);
524
+ case 17:
525
+ _context3.prev = 17;
526
+ _context3.t0 = _context3["catch"](2);
547
527
  console.log(_context3.t0);
548
528
  _this2.setIsActionLoading(undefined);
549
529
  if ((_context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.code) === 'auth/email-already-in-use') {
@@ -553,11 +533,11 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
553
533
  } else {
554
534
  _this2.setPopupError('register', 'Oops, something went wrong');
555
535
  }
556
- case 23:
536
+ case 22:
557
537
  case "end":
558
538
  return _context3.stop();
559
539
  }
560
- }, _callee3, null, [[3, 18]]);
540
+ }, _callee3, null, [[2, 17]]);
561
541
  }));
562
542
  return function (_x3) {
563
543
  return _ref6.apply(this, arguments);
@@ -678,6 +658,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
678
658
  _this2.setIsActionLoading(undefined);
679
659
  },
680
660
  onModalSwitch: function onModalSwitch() {
661
+ window.history.pushState({}, null, '/login');
681
662
  _this2.switchOpenModal('resetPassword', 'login');
682
663
  _this2.clearPopupError();
683
664
  _this2.setIsActionLoading(undefined);
@@ -692,8 +673,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
692
673
  _this2.clearPopupError();
693
674
  _this2.setIsActionLoading('resetPassword');
694
675
 
695
- //https://stokr.info/manage-user?mode=resetPassword&oobCode=PT_AyRFYWXwDe0Ols12TOKSiGQUSdb6mM4DKDLwHGdQAAAGMgUUaEQ&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
696
676
  //localhost:3001/manage-user?mode=resetPassword&oobCode=PT_AyRFYWXwDe0Ols12TOKSiGQUSdb6mM4DKDLwHGdQAAAGMgUUaEQ&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
677
+ //https://stokr.info/manage-user?mode=resetPassword&oobCode=TGhCFwb9uLeYiL2Hp4LFgRg5Fd9osw1Fvza4qY5Hhy0AAAGMgmuGuw&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
697
678
  _context6.prev = 3;
698
679
  _context6.next = 6;
699
680
  return handleResetPassword(password);
@@ -100,6 +100,19 @@ var Auth = /*#__PURE__*/function () {
100
100
  });
101
101
  });
102
102
  }
103
+ }, {
104
+ key: "handleVerifyEmail",
105
+ value: function handleVerifyEmail(actionCode, continueUrl) {
106
+ return new Promise(function (resolve, reject) {
107
+ // Try to apply the email verification code.
108
+ (0, _auth.applyActionCode)(_firebaseConfig.auth, actionCode).then(function (resp) {
109
+ // Email address has been verified.
110
+ resolve(resp);
111
+ }).catch(function (error) {
112
+ reject(error);
113
+ });
114
+ });
115
+ }
103
116
  }, {
104
117
  key: "handleResetPassword",
105
118
  value: function handleResetPassword(actionCode, newPassword, continueUrl) {
@@ -110,7 +123,8 @@ var Auth = /*#__PURE__*/function () {
110
123
  (0, _auth.confirmPasswordReset)(_firebaseConfig.auth, actionCode, newPassword).then(function (resp) {
111
124
  // Password reset has been confirmed and new password updated.
112
125
 
113
- _firebaseConfig.auth.signInWithEmailAndPassword(accountEmail, newPassword);
126
+ //signInWithEmailAndPassword(accountEmail, newPassword)
127
+
114
128
  resolve(accountEmail);
115
129
  }).catch(function (error) {
116
130
  // Error occurred during confirmation. The code might have expired or the
@@ -692,150 +692,189 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
692
692
  return _ref13.apply(this, arguments);
693
693
  };
694
694
  }());
695
+ _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
696
+ var location, query, oobCode;
697
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
698
+ while (1) switch (_context14.prev = _context14.next) {
699
+ case 0:
700
+ location = _this.props.location;
701
+ _context14.prev = 1;
702
+ query = new URLSearchParams(location.search);
703
+ oobCode = query.get('oobCode');
704
+ _context14.next = 6;
705
+ return _Auth.default.handleVerifyEmail(oobCode);
706
+ case 6:
707
+ _context14.next = 21;
708
+ break;
709
+ case 8:
710
+ _context14.prev = 8;
711
+ _context14.t0 = _context14["catch"](1);
712
+ _context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
713
+ _context14.next = _context14.t1 === 'auth/expired-action-code' ? 13 : _context14.t1 === 'auth/invalid-action-code' ? 15 : _context14.t1 === 'auth/user-disabled' ? 17 : 19;
714
+ break;
715
+ case 13:
716
+ _context14.t0.message = 'This link has expired. Please try reseting password again.';
717
+ return _context14.abrupt("break", 20);
718
+ case 15:
719
+ _context14.t0.message = 'This link is invalid. Please try reseting password again.';
720
+ return _context14.abrupt("break", 20);
721
+ case 17:
722
+ _context14.t0.message = 'Your account has been disabled. Please contact our support.';
723
+ return _context14.abrupt("break", 20);
724
+ case 19:
725
+ return _context14.abrupt("break", 20);
726
+ case 20:
727
+ throw _context14.t0;
728
+ case 21:
729
+ case "end":
730
+ return _context14.stop();
731
+ }
732
+ }, _callee14, null, [[1, 8]]);
733
+ })));
695
734
  _defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
696
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(password) {
735
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(password) {
697
736
  var location, query, oobCode;
698
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
699
- while (1) switch (_context14.prev = _context14.next) {
737
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
738
+ while (1) switch (_context15.prev = _context15.next) {
700
739
  case 0:
701
740
  location = _this.props.location;
702
- _context14.prev = 1;
741
+ _context15.prev = 1;
703
742
  query = new URLSearchParams(location.search);
704
743
  oobCode = query.get('oobCode');
705
- _context14.next = 6;
744
+ _context15.next = 6;
706
745
  return _Auth.default.handleResetPassword(oobCode, password);
707
746
  case 6:
708
- _context14.next = 21;
747
+ _context15.next = 21;
709
748
  break;
710
749
  case 8:
711
- _context14.prev = 8;
712
- _context14.t0 = _context14["catch"](1);
713
- _context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
714
- _context14.next = _context14.t1 === 'auth/expired-action-code' ? 13 : _context14.t1 === 'auth/invalid-action-code' ? 15 : _context14.t1 === 'auth/user-disabled' ? 17 : 19;
750
+ _context15.prev = 8;
751
+ _context15.t0 = _context15["catch"](1);
752
+ _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
753
+ _context15.next = _context15.t1 === 'auth/expired-action-code' ? 13 : _context15.t1 === 'auth/invalid-action-code' ? 15 : _context15.t1 === 'auth/user-disabled' ? 17 : 19;
715
754
  break;
716
755
  case 13:
717
- _context14.t0.message = 'This link has expired. Please try reseting password again.';
718
- return _context14.abrupt("break", 20);
756
+ _context15.t0.message = 'This link has expired. Please try reseting password again.';
757
+ return _context15.abrupt("break", 20);
719
758
  case 15:
720
- _context14.t0.message = 'This link is invalid. Please try reseting password again.';
721
- return _context14.abrupt("break", 20);
759
+ _context15.t0.message = 'This link is invalid. Please try reseting password again.';
760
+ return _context15.abrupt("break", 20);
722
761
  case 17:
723
- _context14.t0.message = 'Your account has been disabled. Please contact our support.';
724
- return _context14.abrupt("break", 20);
762
+ _context15.t0.message = 'Your account has been disabled. Please contact our support.';
763
+ return _context15.abrupt("break", 20);
725
764
  case 19:
726
- return _context14.abrupt("break", 20);
765
+ return _context15.abrupt("break", 20);
727
766
  case 20:
728
- throw _context14.t0;
767
+ throw _context15.t0;
729
768
  case 21:
730
769
  case "end":
731
- return _context14.stop();
770
+ return _context15.stop();
732
771
  }
733
- }, _callee14, null, [[1, 8]]);
772
+ }, _callee15, null, [[1, 8]]);
734
773
  }));
735
774
  return function (_x16) {
736
- return _ref14.apply(this, arguments);
775
+ return _ref15.apply(this, arguments);
737
776
  };
738
777
  }());
739
- _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
740
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
741
- while (1) switch (_context15.prev = _context15.next) {
778
+ _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
779
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
780
+ while (1) switch (_context16.prev = _context16.next) {
742
781
  case 0:
743
- _context15.prev = 0;
744
- _context15.next = 3;
782
+ _context16.prev = 0;
783
+ _context16.next = 3;
745
784
  return _Auth.default.sendWelcomeEmail();
746
785
  case 3:
747
- _context15.next = 8;
786
+ _context16.next = 8;
748
787
  break;
749
788
  case 5:
750
- _context15.prev = 5;
751
- _context15.t0 = _context15["catch"](0);
752
- console.log("Error sending welcome email: ".concat(_context15.t0));
789
+ _context16.prev = 5;
790
+ _context16.t0 = _context16["catch"](0);
791
+ console.log("Error sending welcome email: ".concat(_context16.t0));
753
792
  // No need to throw error, let the app continue even if it fails
754
793
  case 8:
755
794
  case "end":
756
- return _context15.stop();
795
+ return _context16.stop();
757
796
  }
758
- }, _callee15, null, [[0, 5]]);
797
+ }, _callee16, null, [[0, 5]]);
759
798
  })));
760
799
  _defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
761
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(data, ip) {
800
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(data, ip) {
762
801
  var user;
763
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
764
- while (1) switch (_context16.prev = _context16.next) {
802
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
803
+ while (1) switch (_context17.prev = _context17.next) {
765
804
  case 0:
766
- _context16.prev = 0;
767
- _context16.next = 3;
805
+ _context17.prev = 0;
806
+ _context17.next = 3;
768
807
  return _Auth.default.uploaProofOfAddress(data, ip);
769
808
  case 3:
770
- user = _context16.sent;
809
+ user = _context17.sent;
771
810
  _this.setUser(user);
772
- _context16.next = 11;
811
+ _context17.next = 11;
773
812
  break;
774
813
  case 7:
775
- _context16.prev = 7;
776
- _context16.t0 = _context16["catch"](0);
777
- console.log("Error uploading proof of address: ".concat(_context16.t0));
778
- throw _context16.t0;
814
+ _context17.prev = 7;
815
+ _context17.t0 = _context17["catch"](0);
816
+ console.log("Error uploading proof of address: ".concat(_context17.t0));
817
+ throw _context17.t0;
779
818
  case 11:
780
819
  case "end":
781
- return _context16.stop();
820
+ return _context17.stop();
782
821
  }
783
- }, _callee16, null, [[0, 7]]);
822
+ }, _callee17, null, [[0, 7]]);
784
823
  }));
785
824
  return function (_x17, _x18) {
786
- return _ref16.apply(this, arguments);
825
+ return _ref17.apply(this, arguments);
787
826
  };
788
827
  }());
789
828
  _defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
790
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(id) {
791
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
792
- while (1) switch (_context17.prev = _context17.next) {
829
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(id) {
830
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
831
+ while (1) switch (_context18.prev = _context18.next) {
793
832
  case 0:
794
- _context17.prev = 0;
795
- _context17.next = 3;
833
+ _context18.prev = 0;
834
+ _context18.next = 3;
796
835
  return _Auth.default.validateGreenWalletId(id);
797
836
  case 3:
798
- return _context17.abrupt("return", _context17.sent);
837
+ return _context18.abrupt("return", _context18.sent);
799
838
  case 6:
800
- _context17.prev = 6;
801
- _context17.t0 = _context17["catch"](0);
802
- console.log("Error validating Green Wallet ID: ".concat(_context17.t0));
803
- throw _context17.t0;
839
+ _context18.prev = 6;
840
+ _context18.t0 = _context18["catch"](0);
841
+ console.log("Error validating Green Wallet ID: ".concat(_context18.t0));
842
+ throw _context18.t0;
804
843
  case 10:
805
844
  case "end":
806
- return _context17.stop();
845
+ return _context18.stop();
807
846
  }
808
- }, _callee17, null, [[0, 6]]);
847
+ }, _callee18, null, [[0, 6]]);
809
848
  }));
810
849
  return function (_x19) {
811
- return _ref17.apply(this, arguments);
850
+ return _ref18.apply(this, arguments);
812
851
  };
813
852
  }());
814
853
  _defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
815
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data) {
854
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
816
855
  var wallet;
817
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
818
- while (1) switch (_context18.prev = _context18.next) {
856
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
857
+ while (1) switch (_context19.prev = _context19.next) {
819
858
  case 0:
820
- _context18.prev = 0;
821
- _context18.next = 3;
859
+ _context19.prev = 0;
860
+ _context19.next = 3;
822
861
  return _Auth.default.createWallet(data);
823
862
  case 3:
824
- wallet = _context18.sent;
825
- return _context18.abrupt("return", wallet);
863
+ wallet = _context19.sent;
864
+ return _context19.abrupt("return", wallet);
826
865
  case 7:
827
- _context18.prev = 7;
828
- _context18.t0 = _context18["catch"](0);
829
- console.log("Error creating wallet: ".concat(_context18.t0));
830
- throw _context18.t0;
866
+ _context19.prev = 7;
867
+ _context19.t0 = _context19["catch"](0);
868
+ console.log("Error creating wallet: ".concat(_context19.t0));
869
+ throw _context19.t0;
831
870
  case 11:
832
871
  case "end":
833
- return _context18.stop();
872
+ return _context19.stop();
834
873
  }
835
- }, _callee18, null, [[0, 7]]);
874
+ }, _callee19, null, [[0, 7]]);
836
875
  }));
837
876
  return function (_x20) {
838
- return _ref18.apply(this, arguments);
877
+ return _ref19.apply(this, arguments);
839
878
  };
840
879
  }());
841
880
  _defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
@@ -847,12 +886,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
847
886
  });
848
887
  });
849
888
  _defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
850
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(projectName, page, userId) {
889
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(projectName, page, userId) {
851
890
  var filterBody, response;
852
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
853
- while (1) switch (_context19.prev = _context19.next) {
891
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
892
+ while (1) switch (_context20.prev = _context20.next) {
854
893
  case 0:
855
- _context19.prev = 0;
894
+ _context20.prev = 0;
856
895
  filterBody = {
857
896
  projectName: projectName,
858
897
  page: page
@@ -860,25 +899,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
860
899
  if (userId) {
861
900
  filterBody.userId = userId;
862
901
  }
863
- _context19.next = 5;
902
+ _context20.next = 5;
864
903
  return _Auth.default.fetchTrackingUserLastTime({
865
904
  filter: filterBody
866
905
  });
867
906
  case 5:
868
- response = _context19.sent;
869
- return _context19.abrupt("return", response);
907
+ response = _context20.sent;
908
+ return _context20.abrupt("return", response);
870
909
  case 9:
871
- _context19.prev = 9;
872
- _context19.t0 = _context19["catch"](0);
873
- console.log(' error', _context19.t0);
910
+ _context20.prev = 9;
911
+ _context20.t0 = _context20["catch"](0);
912
+ console.log(' error', _context20.t0);
874
913
  case 12:
875
914
  case "end":
876
- return _context19.stop();
915
+ return _context20.stop();
877
916
  }
878
- }, _callee19, null, [[0, 9]]);
917
+ }, _callee20, null, [[0, 9]]);
879
918
  }));
880
919
  return function (_x21, _x22, _x23) {
881
- return _ref19.apply(this, arguments);
920
+ return _ref20.apply(this, arguments);
882
921
  };
883
922
  }());
884
923
  return _this;
@@ -886,9 +925,9 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
886
925
  _createClass(AuthProviderClass, [{
887
926
  key: "componentDidMount",
888
927
  value: function componentDidMount() {
889
- var isActivatingUser = window.location.href.includes('/activateUser');
928
+ var isActivatingUser = window.location.href.includes('verifyEmail');
890
929
  if (isActivatingUser) {
891
- this.activateUser();
930
+ this.handleVerifyEmail();
892
931
  } else {
893
932
  this.getUser();
894
933
  }
@@ -927,6 +966,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
927
966
  createUser: _Auth.default.createUser,
928
967
  updateFirebaseUser: _Auth.default.updateFirebaseUser,
929
968
  handleResetPassword: this.handleResetPassword,
969
+ handleVerifyEmail: this.handleVerifyEmail,
930
970
  setUser: this.setUser
931
971
  })
932
972
  }, children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",