@stokr/components-library 3.0.51 → 3.0.52

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.
@@ -6,7 +6,7 @@ import { walletTypes } from "../../constants/globalVariables.js";
6
6
  const StepsProgressSignup = (props) => {
7
7
  let navigate = useNavigate();
8
8
  const { user = {} } = props;
9
- const { country, kyc_status, taxId, wallets = [] } = user;
9
+ const { country, kyc_status, self_declaration, wallets = [] } = user;
10
10
  const KYCNotDone = !kyc_status || kyc_status === "Reaply" || kyc_status === "Cancelled" || kyc_status === "Draft";
11
11
  const hasLiquidWallet = wallets?.filter((wallet) => wallet.type === walletTypes.LIQUID).length > 0;
12
12
  const isActiveStep = (path) => typeof window !== "undefined" ? window.location.pathname.includes(path) : false;
@@ -26,7 +26,7 @@ const StepsProgressSignup = (props) => {
26
26
  {
27
27
  id: "self-certification",
28
28
  handleClick: () => navigate("/self-certification"),
29
- isDone: !!taxId,
29
+ isDone: !!self_declaration,
30
30
  isActive: isActiveStep("/self-certification")
31
31
  },
32
32
  {
@@ -64,19 +64,16 @@ const TASK_COPY = {
64
64
  done: "Registered"
65
65
  }
66
66
  },
67
- taxId: {
68
- title: "Tax ID",
67
+ selfCertification: {
68
+ title: "Self Certification",
69
69
  description: {
70
70
  missing: "Certain investment products require tax identification before participation.",
71
- done: "Tax identification confirmed. You may now access products requiring tax compliance verification."
71
+ done: "Self-certification confirmed. You may now access products requiring tax compliance verification."
72
72
  },
73
73
  iconCopy: {
74
74
  missing: "Missing step",
75
- done: "Submitted",
76
- not_available: "Not available"
77
- },
78
- tooltip: `Some offers require you to provide your Tax ID before being able to invest.
79
- Your tax information will be disclosed to the Luxembourg tax authorities annually for tax compliance purposes required by the Common Reporting Standard implementation.`
75
+ done: "Submitted"
76
+ }
80
77
  }
81
78
  };
82
79
  const getVerifyIdentityChecklist = (isFromAllowedCountry, user, isEntity) => {
@@ -121,13 +118,14 @@ function generateCoreChecklistTasks(user) {
121
118
  country: null,
122
119
  identity: null,
123
120
  wallet: null,
121
+ selfCertification: null,
124
122
  taxId: null,
125
123
  isFromAllowedCountry: false,
126
124
  allTasks: [],
127
125
  remainingCount: 0
128
126
  };
129
127
  }
130
- const { country, user_type, wallets = [], taxId, countryObj } = user;
128
+ const { country, user_type, wallets = [], self_declaration, countryObj } = user;
131
129
  const isFromAllowedCountry = countryObj?.isAllowed;
132
130
  const liquidWallets = wallets.filter((wallet2) => wallet2.type === walletTypes.LIQUID) || [];
133
131
  const hasWallet = liquidWallets.length > 0;
@@ -164,18 +162,17 @@ function generateCoreChecklistTasks(user) {
164
162
  link: signupBase ? `${signupBase}/register-liquid-securities` : "",
165
163
  isClickable: isFromAllowedCountry && walletStatus !== "done"
166
164
  };
167
- const taxStatus = taxId ? "done" : "missing";
168
- const taxIdTask = {
169
- key: "taxId",
170
- title: TASK_COPY.taxId.title,
171
- description: TASK_COPY.taxId.description[taxStatus],
172
- iconState: taxStatus,
173
- iconCopy: TASK_COPY.taxId.iconCopy[taxStatus],
174
- openModal: "taxId",
175
- tooltip: TASK_COPY.taxId.tooltip,
176
- isClickable: taxStatus !== "done"
165
+ const selfCertStatus = self_declaration ? "done" : "missing";
166
+ const selfCertification = {
167
+ key: "selfCertification",
168
+ title: TASK_COPY.selfCertification.title,
169
+ description: TASK_COPY.selfCertification.description[selfCertStatus],
170
+ iconState: selfCertStatus,
171
+ iconCopy: TASK_COPY.selfCertification.iconCopy[selfCertStatus],
172
+ link: selfCertStatus !== "done" && signupBase ? `${signupBase}/self-certification` : "",
173
+ isClickable: selfCertStatus !== "done"
177
174
  };
178
- const allTasks = [countryTask, identity, wallet, taxIdTask].filter(Boolean);
175
+ const allTasks = [countryTask, identity, wallet, selfCertification].filter(Boolean);
179
176
  const remainingCount = allTasks.filter(
180
177
  (task) => task.iconState === "missing" || task.iconState === "not_available"
181
178
  ).length;
@@ -183,7 +180,9 @@ function generateCoreChecklistTasks(user) {
183
180
  country: countryTask,
184
181
  identity,
185
182
  wallet,
186
- taxId: taxIdTask,
183
+ selfCertification,
184
+ /** @deprecated Use selfCertification — kept for consumers still reading taxId */
185
+ taxId: selfCertification,
187
186
  isFromAllowedCountry,
188
187
  allTasks,
189
188
  remainingCount
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.51",
3
+ "version": "3.0.52",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",