@stokr/components-library 2.3.19 → 2.3.21

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 ? 'Upload your entity documents to get verified' : '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,
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.19",
3
+ "version": "2.3.21",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",