@stokr/components-library 0.9.5 → 0.9.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.
@@ -195,16 +195,6 @@ var UserChecklist = function UserChecklist(props) {
195
195
  openModal: _ToDoList.ToDoModal.TAX_ID,
196
196
  tooltip: "Some offers require you to provide your Tax ID before being able to invest.\n\nYour tax information will be disclosed to the Luxembourg tax authorities annually for tax compliance purposes required by the Common Reporting Standard implementation."
197
197
  }];
198
- if (countryObj !== null && countryObj !== void 0 && countryObj.SEPA) {
199
- //add an item at first place
200
- //only if the user is from a SEPA country
201
- optionalTasks.splice(0, 0, {
202
- title: 'Invest in Euro',
203
- message: getInvestInEuroChecklist(isFromAllowedCountry, user).message,
204
- state: getInvestInEuroChecklist(isFromAllowedCountry, user).state,
205
- link: isFromAllowedCountry && kyc_status && kyc_status !== 'Draft' && "".concat(platformURL, "/verify-identity")
206
- });
207
- }
208
198
  setoptionalTasks(optionalTasks);
209
199
  }
210
200
  };
@@ -252,40 +242,6 @@ var getVerifyIdentityChecklist = function getVerifyIdentityChecklist(isFromAllow
252
242
  hasLink: hasLink
253
243
  };
254
244
  };
255
- var getInvestInEuroChecklist = function getInvestInEuroChecklist(isFromAllowedCountry, user) {
256
- var _KYCDocuments$status, _KYCDocuments$status2, _KYCDocuments$status3;
257
- var kyc_status = user.kyc_status,
258
- KYCDocuments = user.KYCDocuments,
259
- lemonwayWallet = user.lemonwayWallet;
260
- var message;
261
- var state;
262
- if (!isFromAllowedCountry) {
263
- message = 'Sorry, you are living in a country where this is not available';
264
- state = _ToDoList.ToDoTaskState.NOT_AVAILABLE;
265
- } else if ((lemonwayWallet === null || lemonwayWallet === void 0 ? void 0 : lemonwayWallet.STATUS) === '6') {
266
- message = 'Your document is verified';
267
- state = _ToDoList.ToDoTaskState.APPROVED;
268
- } else if ((lemonwayWallet === null || lemonwayWallet === void 0 ? void 0 : lemonwayWallet.STATUS) === '3') {
269
- message = 'There seems to be a problem. The compliance team will contact you';
270
- state = _ToDoList.ToDoTaskState.DENIED;
271
- } else if (!kyc_status || kyc_status.toUpperCase() === 'DRAFT') {
272
- message = 'In order to pay in EURO you need to verify your identity and provide a second identity document';
273
- state = _ToDoList.ToDoTaskState.NOT_AVAILABLE;
274
- } else if (!KYCDocuments || (kyc_status === null || kyc_status === void 0 ? void 0 : kyc_status.toUpperCase()) === 'ACCEPTED') {
275
- message = 'In order to pay in EURO you need to provide a second identity document';
276
- state = _ToDoList.ToDoTaskState.SKIPPED;
277
- } else if (((_KYCDocuments$status = KYCDocuments.status) === null || _KYCDocuments$status === void 0 ? void 0 : _KYCDocuments$status.toUpperCase()) === 'PENDING' || ((_KYCDocuments$status2 = KYCDocuments.status) === null || _KYCDocuments$status2 === void 0 ? void 0 : _KYCDocuments$status2.toUpperCase()) === 'APPROVED' && !lemonwayWallet || (lemonwayWallet === null || lemonwayWallet === void 0 ? void 0 : lemonwayWallet.STATUS) === '5') {
278
- message = 'The Lemonway team is having a look. This usually takes up to 24 hours';
279
- state = _ToDoList.ToDoTaskState.IN_PROGRESS;
280
- } else if (((_KYCDocuments$status3 = KYCDocuments.status) === null || _KYCDocuments$status3 === void 0 ? void 0 : _KYCDocuments$status3.toUpperCase()) === 'REJECTED') {
281
- message = 'It seems there was a problem with your second identity document. Please try again or contact the compliance team at compliance@stokr.io';
282
- state = _ToDoList.ToDoTaskState.DENIED;
283
- }
284
- return {
285
- message: message,
286
- state: state
287
- };
288
- };
289
245
  UserChecklist.propTypes = {
290
246
  user: _propTypes.default.object.isRequired,
291
247
  additionalTasks: _propTypes.default.any,
@@ -206,13 +206,6 @@ var userStaging = {
206
206
  address: '0x8f02dde046cdfecccf068a39a7c3844e49f5e33d'
207
207
  }],
208
208
  is_risk_questionnaire_finished: true,
209
- lemonwayWallet: {
210
- ID: '5e3571e222143e0016516946',
211
- STATUS: '6',
212
- poa_fileid: '42',
213
- passport_fileid: '24',
214
- dt: '2020-02-05T13:33:04.705Z'
215
- },
216
209
  liquid_network: {
217
210
  GAID: 'GAvqQSMd9PpUqkPzKN2CvRzMihBYJ',
218
211
  dt: '2021-10-12T07:59:24.256Z',
@@ -33,24 +33,7 @@ var Footer = function Footer(_ref) {
33
33
  textDecoration: 'underline',
34
34
  color: 'white'
35
35
  }
36
- }, "registered"), ' ', "with the Luxembourg regulator CSSF.")), /*#__PURE__*/_react.default.createElement(_Footer.PoweredWrap, null, /*#__PURE__*/_react.default.createElement(_Footer.Powered, null, /*#__PURE__*/_react.default.createElement("div", null, "Partner of", ' ', /*#__PURE__*/_react.default.createElement("a", {
37
- href: "http://www.lemonway.com/",
38
- title: "Lemon Way - Payment Institution for the new economy",
39
- target: "_blank",
40
- rel: "noopener noreferrer",
41
- style: {
42
- color: 'white',
43
- textDecoration: 'none'
44
- }
45
- }, /*#__PURE__*/_react.default.createElement("img", {
46
- style: {
47
- verticalAlign: 'middle'
48
- },
49
- src: lemonwayLogo,
50
- height: 20,
51
- width: 20,
52
- alt: "Lemonway logo"
53
- }), ' ', "LEMONWAY"), ". A European payment institution ", /*#__PURE__*/_react.default.createElement("br", null), " accredited in France by the ACPR (CIB 16568).")), /*#__PURE__*/_react.default.createElement(_Footer.Copyright, null, "Copyright ", new Date().getFullYear(), " STOKR. All rights reserved.")))));
36
+ }, "registered"), ' ', "with the Luxembourg regulator CSSF.")), /*#__PURE__*/_react.default.createElement(_Footer.PoweredWrap, null, /*#__PURE__*/_react.default.createElement(_Footer.Copyright, null, "Copyright ", new Date().getFullYear(), " STOKR. All rights reserved.")))));
54
37
  };
55
38
  exports.Footer = Footer;
56
39
  Footer.propTypes = {
@@ -206,7 +206,7 @@ var HeaderWithProgressSignup = Template.bind({});
206
206
  exports.HeaderWithProgressSignup = HeaderWithProgressSignup;
207
207
  HeaderWithProgressSignup.args = {
208
208
  user: _objectSpread(_objectSpread({}, userDev), {}, {
209
- kyc_status: 'Draft'
209
+ kyc_status: 'Rejected'
210
210
  }),
211
211
  progress: {},
212
212
  signupFlow: true
@@ -25,12 +25,11 @@ var StepsProgressSignup = function StepsProgressSignup(props) {
25
25
  taxId = user.taxId,
26
26
  _user$wallets = user.wallets,
27
27
  wallets = _user$wallets === void 0 ? [] : _user$wallets;
28
- var isKYCPendingOrApproved = kyc_status === 'Pending' || kyc_status === 'Approved' || kyc_status === 'Accepted';
29
- var isPoAPendingOrApproved = KYCDocuments.status === 'Pending' || KYCDocuments.status === 'Approved';
28
+ var isKYCRejected = !kyc_status || kyc_status === 'Reaply' || kyc_status === 'Draft';
30
29
  var hasLiquidWallet = (wallets === null || wallets === void 0 ? void 0 : wallets.filter(function (wallet) {
31
30
  return wallet.type === _globalVariables.walletTypes.LIQUID;
32
31
  }).length) > 0;
33
- var areAllDoneInvestor = !!country && isKYCPendingOrApproved && isPoAPendingOrApproved && hasLiquidWallet && !!taxId && !!is_risk_questionnaire_finished;
32
+ var areAllDoneInvestor = !!country && !isKYCRejected && hasLiquidWallet && !!taxId && !!is_risk_questionnaire_finished;
34
33
  var areAllDoneEntity = hasLiquidWallet && !!is_risk_questionnaire_finished;
35
34
  var isActiveStep = function isActiveStep(path) {
36
35
  return window.location.pathname.includes(path);
@@ -75,7 +74,7 @@ var StepsProgressSignup = function StepsProgressSignup(props) {
75
74
  handleClick: function handleClick() {
76
75
  return navigate('/verify-identity');
77
76
  },
78
- isDone: isKYCPendingOrApproved && isPoAPendingOrApproved,
77
+ isDone: !isKYCRejected,
79
78
  isActive: isActiveStep('/verify-identity')
80
79
  }, {
81
80
  id: 'taxId',
package/dist/index.js CHANGED
@@ -1036,4 +1036,15 @@ Object.keys(_Layout).forEach(function (key) {
1036
1036
  return _Layout[key];
1037
1037
  }
1038
1038
  });
1039
+ });
1040
+ var _km_ify = require("./utils/km_ify");
1041
+ Object.keys(_km_ify).forEach(function (key) {
1042
+ if (key === "default" || key === "__esModule") return;
1043
+ if (key in exports && exports[key] === _km_ify[key]) return;
1044
+ Object.defineProperty(exports, key, {
1045
+ enumerable: true,
1046
+ get: function get() {
1047
+ return _km_ify[key];
1048
+ }
1049
+ });
1039
1050
  });
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.km_ify = void 0;
7
+ var km_ify = function km_ify(input) {
8
+ if (input >= 1000000) {
9
+ input /= 1000000;
10
+ if (input % 10 !== 0) {
11
+ input = truncateDecimals(input, 1);
12
+ }
13
+ input += 'M';
14
+ }
15
+ if (input >= 1000) {
16
+ input /= 1000;
17
+ if (input % 10 !== 0) {
18
+ input = truncateDecimals(input, 1);
19
+ }
20
+ input += 'K';
21
+ }
22
+ return input;
23
+ };
24
+ exports.km_ify = km_ify;
25
+ var truncateDecimals = function truncateDecimals(number, digits) {
26
+ var re = new RegExp('(\\d+\\.\\d{' + digits + '})(\\d)'),
27
+ m = number.toString().match(re);
28
+ return m ? parseFloat(m[1]) : number.valueOf();
29
+ };
30
+
31
+ //how the number should appear - SKR-870
32
+ // 1-999 just the number
33
+ // 1000 1K
34
+ // 1001 - <1100 1K
35
+ // 1100 - <1200 1.1K
36
+ // 999900 -999999 999.9K
37
+ // 1000000 - <1100000 1M
38
+ // 1100000 -<1200000 1.1M
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -25,7 +25,8 @@
25
25
  "start": "npm run storybook",
26
26
  "chromatic": "CHROMATIC_APP_CODE=7kzdke5umep chromatic",
27
27
  "release": "auto shipit",
28
- "pub": "rm -rf ./dist && npm publish --access public"
28
+ "pub": "rm -rf ./dist && npm publish --access public",
29
+ "start:script": "react-scripts start"
29
30
  },
30
31
  "dependencies": {
31
32
  "@fortawesome/fontawesome-svg-core": "^6.3.0",