@stokr/components-library 2.3.58-beta.2 → 2.3.58-beta.3

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.
@@ -40,7 +40,7 @@ var ICON_MAP = {
40
40
  var ChecklistCard = function ChecklistCard(_ref) {
41
41
  var _icon$props;
42
42
  var _ref$iconState = _ref.iconState,
43
- iconState = _ref$iconState === void 0 ? 'in_progress' : _ref$iconState,
43
+ iconState = _ref$iconState === void 0 ? 'missing' : _ref$iconState,
44
44
  title = _ref.title,
45
45
  description = _ref.description,
46
46
  link = _ref.link,
@@ -50,8 +50,8 @@ var ChecklistCard = function ChecklistCard(_ref) {
50
50
  _ref$disabled = _ref.disabled,
51
51
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
52
52
  rest = _objectWithoutProperties(_ref, _excluded);
53
- // Fallback to in_progress if iconState is not recognized
54
- var _ref2 = ICON_MAP[iconState] || ICON_MAP['in_progress'],
53
+ // Fallback to missing if iconState is not recognized
54
+ var _ref2 = ICON_MAP[iconState] || ICON_MAP['missing'],
55
55
  icon = _ref2.icon,
56
56
  color = _ref2.color;
57
57
 
@@ -57,7 +57,7 @@ var footerGroups = [{
57
57
  url: "".concat(_globalVariables.platformURL, "/101")
58
58
  }, {
59
59
  name: 'Support',
60
- url: 'https://support.stokr.io/',
60
+ url: 'https://stokr.zendesk.com/',
61
61
  external: true
62
62
  }, {
63
63
  name: 'STOKE POST',
@@ -47,7 +47,7 @@ FooterMenu1.args = {
47
47
  }, */
48
48
  {
49
49
  name: 'Support',
50
- url: 'https://support.stokr.io/',
50
+ url: 'https://stokr.zendesk.com/',
51
51
  external: true
52
52
  }, {
53
53
  name: 'STOKE POST',
@@ -348,7 +348,7 @@ var Header = function Header(_ref3) {
348
348
  return toggleMenu('main');
349
349
  }
350
350
  }, "Dashboard"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Header.MobileMenuItem, null, /*#__PURE__*/_react.default.createElement("a", {
351
- href: (0, _checkTodoStatus.default)(user) > 0 ? "".concat(newPlatformUrlForUserMenu, "/checklist") : "".concat(newPlatformUrlForUserMenu, "/overview"),
351
+ href: "".concat(newPlatformUrlForUserMenu, "/overview"),
352
352
  onClick: function onClick() {
353
353
  return toggleMenu('main');
354
354
  }
@@ -122,14 +122,16 @@ var MainMenu = /*#__PURE__*/function (_PureComponent) {
122
122
  } : {},
123
123
  hasNestedCollapse: true
124
124
  }, /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOptions, null, !isVentureDashboard && /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
125
+ as: "button",
126
+ button: true,
125
127
  nameOption: true,
126
128
  isVenture: isAdmin
127
- }, /*#__PURE__*/_react.default.createElement(_MainMenu.UserName, {
129
+ }, /*#__PURE__*/_react.default.createElement("span", {
128
130
  style: spanStyleForMenu,
129
131
  onClick: function onClick() {
130
- return isAdmin ? window.location.href = "https://admin.".concat(_globalVariables.platformDomain) : window.location.href = "".concat(platformUrlForUserMenu, "/settings/profile-and-privacy");
132
+ return isAdmin ? window.location.href = "https://admin.".concat(_globalVariables.platformDomain) : window.location.href = "".concat(platformUrlForUserMenu, "/overview");
131
133
  }
132
- }, user !== null && user !== void 0 && user.username ? user === null || user === void 0 ? void 0 : user.username : user === null || user === void 0 ? void 0 : user.email)), isAdmin ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isVentureDashboard && /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
134
+ }, "Dashboard")), isAdmin ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isVentureDashboard && /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
133
135
  as: "button",
134
136
  button: true,
135
137
  onClick: function onClick() {
@@ -138,20 +140,12 @@ var MainMenu = /*#__PURE__*/function (_PureComponent) {
138
140
  }, /*#__PURE__*/_react.default.createElement("span", {
139
141
  style: spanStyleForMenu
140
142
  }, "Settings"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
141
- isDashboard: true,
142
- as: "button",
143
- button: true,
144
- onClick: function onClick() {
145
- window.location.href = "".concat(platformUrlForUserMenu, "/checklist");
146
- }
147
- }, /*#__PURE__*/_react.default.createElement("span", {
148
- style: spanStyleForMenu
149
- }, "Checklist"), notifications > 0 && /*#__PURE__*/_react.default.createElement(_MainMenu.Notifications, null, notifications)), /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
150
143
  as: "button",
151
144
  button: true,
152
145
  isOpened: isSettingsActive,
153
146
  onClick: this.toggleSettings,
154
147
  isSettings: true
148
+ //isDashboard
155
149
  }, /*#__PURE__*/_react.default.createElement("span", {
156
150
  style: spanStyleForMenu
157
151
  }, "Settings"), /*#__PURE__*/_react.default.createElement(_MainMenu.ExpandArrow, {
@@ -40,7 +40,7 @@ var MainMenuOption = _styledComponents.default.div.withConfig({
40
40
  return isDashboard && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-color: #e1e1e1 !important;\n "])));
41
41
  }, function (_ref2) {
42
42
  var isSettings = _ref2.isSettings;
43
- return isSettings && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border: none !important;\n "])));
43
+ return isSettings && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-right: none !important;\n "])));
44
44
  }, _rwd.default.Medium(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 10px;\n border-bottom: 1px solid #e1e1e1;\n margin-bottom: -1px;\n transition: border-bottom-color .2s;\n\n & + & {\n border-top: 0;\n border-left: 1px solid #e1e1e1;\n\n ", "\n }\n\n ", ";\n\n ", "\n\n ", "\n\n "])), function (_ref3) {
45
45
  var isDashboard = _ref3.isDashboard;
46
46
  return isDashboard && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n border-right: 1px solid #e1e1e1;\n "])));
@@ -53,7 +53,7 @@ var MainMenuOption = _styledComponents.default.div.withConfig({
53
53
  return props.nameOption && "\n display: flex;\n ";
54
54
  }), function (props) {
55
55
  return props.nameOption && "\n display: none;\n ";
56
- }, _rwd.default.Large(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n flex-basis: 25%;\n\n ", "\n\n ", ";\n "])), function (_ref5) {
56
+ }, _rwd.default.Large(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\n ", "\n\n ", ";\n "])), function (_ref5) {
57
57
  var isVenture = _ref5.isVenture;
58
58
  return isVenture && (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n flex-basis: 75.5%;\n "])));
59
59
  }, function (props) {
@@ -23,7 +23,6 @@ var _EventDBContext = require("context/EventDBContext/EventDBContext");
23
23
  var _NotificationContext = require("context/NotificationContext/NotificationContext");
24
24
  var _ProfileHeader = require("./ProfileHeader.styles");
25
25
  var _avatarPlaceholder = _interopRequireDefault(require("../../static/images/avatar-placeholder.png"));
26
- var _UserChecklist = _interopRequireDefault(require("../Checklist/UserChecklist"));
27
26
  var _customHooks = require("utils/customHooks");
28
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -259,19 +258,7 @@ var ProfileHeader = /*#__PURE__*/function (_PureComponent) {
259
258
  breakpoint: "Medium"
260
259
  }, /*#__PURE__*/_react.default.createElement(_reactCollapse.Collapse, {
261
260
  isOpened: extendedPanel === PANEL.TODOS
262
- }, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null, /*#__PURE__*/_react.default.createElement(_UserChecklist.default, {
263
- user: _this2.props.user
264
- // redirectCookie
265
- //additionalTasks={<AdditionalTask />}
266
- // getTasksCount={taskCount => {
267
- // this.setState({
268
- // mandatoryTasksCount:
269
- // taskCount.mandatoryTasksCount,
270
- // walletsTasksCount:
271
- // taskCount.walletTasksCount,
272
- // })
273
- // }}
274
- })))))))), /*#__PURE__*/_react.default.createElement(_rwd.DisplayOnBreakpoint, {
261
+ }, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null))))))), /*#__PURE__*/_react.default.createElement(_rwd.DisplayOnBreakpoint, {
275
262
  up: true,
276
263
  breakpoint: "Medium"
277
264
  }, /*#__PURE__*/_react.default.createElement(_ProfileHeader.TabsContainer, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
@@ -288,19 +275,7 @@ var ProfileHeader = /*#__PURE__*/function (_PureComponent) {
288
275
  authUser: authUser
289
276
  })), /*#__PURE__*/_react.default.createElement(_Tabs.Tab, {
290
277
  tabId: PANEL.TODOS
291
- }, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null, /*#__PURE__*/_react.default.createElement(_UserChecklist.default, {
292
- user: _this2.props.user
293
- // redirectCookie
294
- //additionalTasks={<AdditionalTask />}
295
- // getTasksCount={taskCount => {
296
- // this.setState({
297
- // mandatoryTasksCount:
298
- // taskCount.mandatoryTasksCount,
299
- // walletsTasksCount:
300
- // taskCount.walletTasksCount,
301
- // })
302
- // }}
303
- })))))))));
278
+ }, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null))))))));
304
279
  }));
305
280
  });
306
281
  });
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  exports.generateCoreChecklistTasks = generateCoreChecklistTasks;
8
- exports.getVerifyIdentityChecklistState = void 0;
8
+ exports.getVerifyIdentityChecklist = void 0;
9
9
  var _globalVariables = require("../constants/globalVariables");
10
10
  var websiteUrl = process.env.REACT_APP_WEBSITE_DOMAIN;
11
11
 
@@ -58,16 +58,15 @@ var TASK_COPY = {
58
58
  not_available: 'Not available',
59
59
  missing: 'Missing step',
60
60
  in_progress: 'Under review',
61
- done: 'Verified',
62
- reapply: 'Missing step'
61
+ done: 'Verified'
63
62
  }
64
63
  },
65
64
  wallet: {
66
65
  title: 'Liquid Address',
67
66
  description: {
68
- missing: 'Register a Liquid address where you will receive the securities',
67
+ missing: 'Register a Liquid address where you will receive the securities.',
69
68
  not_available: 'Sorry, you are living in a country where this is not available.',
70
- done: 'Your address is registered'
69
+ done: 'Your address is registered.'
71
70
  },
72
71
  iconCopy: {
73
72
  missing: 'Missing step',
@@ -83,51 +82,44 @@ var TASK_COPY = {
83
82
  },
84
83
  iconCopy: {
85
84
  missing: 'Missing step',
86
- done: 'Submitted'
85
+ done: 'Submitted',
86
+ not_available: 'Not available'
87
87
  },
88
88
  tooltip: "Some offers require you to provide your Tax ID before being able to invest.\nYour tax information will be disclosed to the Luxembourg tax authorities annually for tax compliance purposes required by the Common Reporting Standard implementation."
89
89
  }
90
90
  };
91
91
 
92
- // Identity verification checklist function - simplified to just return state and hasLink
93
- var getVerifyIdentityChecklistState = function getVerifyIdentityChecklistState(isFromAllowedCountry, user) {
92
+ // Identity verification checklist function -
93
+ var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllowedCountry, user, isEntity) {
94
94
  var kyc_status = user.kyc_status;
95
95
  var state;
96
96
  var hasLink = false;
97
+ var message;
97
98
  if (!isFromAllowedCountry) {
98
99
  state = 'not_available';
100
+ message = TASK_COPY.identity.description.not_available;
99
101
  } else if (!kyc_status || kyc_status.toUpperCase() === 'DRAFT') {
100
102
  state = 'missing';
101
103
  hasLink = true;
104
+ message = isEntity ? TASK_COPY.identity.description.missing.entity : TASK_COPY.identity.description.missing.individual;
102
105
  } 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') {
103
106
  state = 'in_progress';
107
+ message = TASK_COPY.identity.description.in_progress;
104
108
  } else if (kyc_status.toUpperCase() === 'ACCEPTED') {
105
109
  state = 'done';
110
+ message = isEntity ? TASK_COPY.identity.description.done.entity : TASK_COPY.identity.description.done.individual;
106
111
  } else if (kyc_status.toUpperCase() === 'REAPPLY' || kyc_status.toUpperCase() === 'CANCELLED') {
107
- state = 'reapply';
112
+ state = 'missing';
108
113
  hasLink = true;
114
+ message = isEntity ? TASK_COPY.identity.description.reapply.entity : TASK_COPY.identity.description.reapply.individual;
109
115
  }
110
116
  return {
111
117
  state: state,
112
- hasLink: hasLink
118
+ hasLink: hasLink,
119
+ message: message
113
120
  };
114
121
  };
115
- exports.getVerifyIdentityChecklistState = getVerifyIdentityChecklistState;
116
- var getIdentityDescription = function getIdentityDescription(state, isEntity) {
117
- if (state === 'not_available') {
118
- return TASK_COPY.identity.description.not_available;
119
- }
120
- if (state === 'in_progress') {
121
- return TASK_COPY.identity.description.in_progress;
122
- }
123
- if (state === 'missing' || state === 'reapply') {
124
- return isEntity ? TASK_COPY.identity.description.missing.entity : TASK_COPY.identity.description.missing.individual;
125
- }
126
- if (state === 'done') {
127
- return isEntity ? TASK_COPY.identity.description.done.entity : TASK_COPY.identity.description.done.individual;
128
- }
129
- return TASK_COPY.identity.description.missing.individual;
130
- };
122
+ exports.getVerifyIdentityChecklist = getVerifyIdentityChecklist;
131
123
  function getCountryDescription(user, isFromAllowedCountry) {
132
124
  var country = user.country,
133
125
  user_type = user.user_type;
@@ -180,18 +172,20 @@ function generateCoreChecklistTasks(user) {
180
172
  description: getCountryDescription(user, isFromAllowedCountry),
181
173
  iconState: countryStatus,
182
174
  iconCopy: TASK_COPY.country.iconCopy[countryStatus],
183
- link: "".concat(platformURL, "/country-of-residence")
175
+ link: "".concat(platformURL, "/country-of-residence"),
176
+ isClickable: countryStatus !== 'done'
184
177
  };
185
178
 
186
179
  // Identity task
187
- var verifyIdentityChecklist = getVerifyIdentityChecklistState(isFromAllowedCountry, user);
180
+ var verifyIdentityChecklist = getVerifyIdentityChecklist(isFromAllowedCountry, user, isEntity);
188
181
  var identity = {
189
182
  key: 'kyc',
190
183
  title: isEntity ? TASK_COPY.identity.title.entity : TASK_COPY.identity.title.individual,
191
- description: getIdentityDescription(verifyIdentityChecklist.state, isEntity),
184
+ description: verifyIdentityChecklist.message,
192
185
  iconState: verifyIdentityChecklist.state,
193
186
  iconCopy: TASK_COPY.identity.iconCopy[verifyIdentityChecklist.state],
194
- link: verifyIdentityChecklist.hasLink ? "".concat(platformURL, "/verify-identity") : undefined
187
+ link: "".concat(platformURL, "/verify-identity"),
188
+ isClickable: verifyIdentityChecklist.hasLink
195
189
  };
196
190
 
197
191
  // Wallet
@@ -203,7 +197,8 @@ function generateCoreChecklistTasks(user) {
203
197
  description: walletDescription,
204
198
  iconState: walletStatus,
205
199
  iconCopy: TASK_COPY.wallet.iconCopy[walletStatus],
206
- link: isFromAllowedCountry ? "".concat(platformURL, "/register-liquid-securities") : undefined
200
+ link: "".concat(platformURL, "/register-liquid-securities"),
201
+ isClickable: isFromAllowedCountry && walletStatus !== 'done'
207
202
  };
208
203
 
209
204
  // Tax ID
@@ -215,7 +210,8 @@ function generateCoreChecklistTasks(user) {
215
210
  iconState: taxStatus,
216
211
  iconCopy: TASK_COPY.taxId.iconCopy[taxStatus],
217
212
  openModal: 'taxId',
218
- tooltip: TASK_COPY.taxId.tooltip
213
+ tooltip: TASK_COPY.taxId.tooltip,
214
+ isClickable: taxStatus !== 'done'
219
215
  };
220
216
 
221
217
  // Create all tasks array
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.58-beta.2",
3
+ "version": "2.3.58-beta.3",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -15,11 +15,11 @@
15
15
  "author": "Bilal Hodzic <bilal@stokr.io>",
16
16
  "license": "MIT",
17
17
  "scripts": {
18
- "build": "react-app-rewired build",
18
+ "build": "react-scripts build",
19
19
  "build-storybook": "storybook build",
20
20
  "build-storybook-docs": "storybook build -s public --docs",
21
21
  "build:dist": "cross-env BABEL_ENV=production babel src -d dist",
22
- "test": "react-app-rewired test",
22
+ "test": "react-scripts test",
23
23
  "prepare": "npm run build",
24
24
  "storybook": "storybook dev -p 6006",
25
25
  "start": "npm run storybook",
@@ -50,7 +50,6 @@
50
50
  "prop-types": "^15.8.1",
51
51
  "qrcode.react": "^3.1.0",
52
52
  "react": "^18.2.0",
53
- "react-app-rewired": "^2.2.1",
54
53
  "react-collapse": "^5.1.1",
55
54
  "react-copy-to-clipboard": "^5.1.0",
56
55
  "react-countup": "^6.4.1",