@stokr/components-library 3.0.56 → 3.0.58
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.
- package/dist/components/2FA/EnterCode.js +3 -3
- package/dist/components/2FA/ResetCode.js +4 -4
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +2 -2
- package/dist/components/LoginModal/LoginModal.js +24 -4
- package/dist/components/Payment/PaymentDetailsCard.js +17 -5
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +14 -5
- package/dist/components/RegisterModal/RegisterModal.js +3 -3
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +3 -7
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +2 -2
- package/dist/components/StepsProgress/StepsProgress.js +2 -2
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +2 -1
- package/dist/index.js +2 -1
- package/dist/utils/checklistGenerator.js +5 -3
- package/dist/utils/fix-decimals.js +8 -1
- package/dist/utils/formatCurrencyValue.js +18 -26
- package/package.json +1 -1
|
@@ -16,10 +16,10 @@ const EnterCode = (props) => {
|
|
|
16
16
|
return /* @__PURE__ */ jsx(Wrapper, { isModal, ...props, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
17
17
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
18
18
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
19
|
-
/* @__PURE__ */ jsx("h3", { children: "
|
|
20
|
-
/* @__PURE__ */ jsx("p", { children: "Enter the
|
|
19
|
+
/* @__PURE__ */ jsx("h3", { children: "TWO-FACTOR AUTHENTICATION" }),
|
|
20
|
+
/* @__PURE__ */ jsx("p", { children: "Enter the verification code from your authenticator application." })
|
|
21
21
|
] }) }),
|
|
22
|
-
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: onModalSwitch && /* @__PURE__ */ jsx(ModalLinkWrap, { children: /* @__PURE__ */ jsx(ModalLink, { type: "button", as: "button", "data-cy": "2fa-enter-code-lost-device", onClick: onModalSwitch, children: "Lost your device?" }) }) })
|
|
22
|
+
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: onModalSwitch && /* @__PURE__ */ jsx(ModalLinkWrap, { children: /* @__PURE__ */ jsx(ModalLink, { type: "button", as: "button", "data-cy": "2fa-enter-code-lost-device", onClick: onModalSwitch, children: "Lost access to your device?" }) }) })
|
|
23
23
|
] }),
|
|
24
24
|
/* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsx(
|
|
25
25
|
Formik,
|
|
@@ -9,10 +9,10 @@ const ResetCode = (props) => {
|
|
|
9
9
|
return /* @__PURE__ */ jsx(Modal, { isOpen: isModalOpen, onClose: onModalClose, background, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
10
10
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
11
11
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
12
|
-
/* @__PURE__ */ jsx("h3", { children: "
|
|
13
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
12
|
+
/* @__PURE__ */ jsx("h3", { children: "AUTHENTICATION DEVICE UNAVAILABLE" }),
|
|
13
|
+
/* @__PURE__ */ jsx("p", { children: "Please contact our support team to reset your two-factor authentication." })
|
|
14
14
|
] }) }),
|
|
15
|
-
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsx(ModalLinkWrap, { children: /* @__PURE__ */ jsx(ModalLink, { type: "button", as: "button", "data-cy": "2fa-reset-code-back-to-enter-code", onClick: onModalSwitch, children: "
|
|
15
|
+
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsx(ModalLinkWrap, { children: /* @__PURE__ */ jsx(ModalLink, { type: "button", as: "button", "data-cy": "2fa-reset-code-back-to-enter-code", onClick: onModalSwitch, children: "Return to log in" }) }) })
|
|
16
16
|
] }),
|
|
17
17
|
/* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(
|
|
18
18
|
"a",
|
|
@@ -22,7 +22,7 @@ const ResetCode = (props) => {
|
|
|
22
22
|
rel: "noreferrer",
|
|
23
23
|
"data-cy": "2fa-reset-code-contact-support",
|
|
24
24
|
style: { textDecoration: "underline" },
|
|
25
|
-
children: "Contact us to reset your
|
|
25
|
+
children: "Contact us to reset your two-factor authentication."
|
|
26
26
|
}
|
|
27
27
|
) }) }) }) })
|
|
28
28
|
] }) });
|
|
@@ -33,8 +33,8 @@ class ForgotPasswordModal extends PureComponent {
|
|
|
33
33
|
isResettingExpiredToken
|
|
34
34
|
} = this.props;
|
|
35
35
|
const headerTextContent = isResettingExpiredToken ? "This Invite Link Has Expired" : "Reset Your password";
|
|
36
|
-
const mainTextContent = isResettingExpiredToken ? "To continue, request a new one using your email, and access will be sent shortly." : "
|
|
37
|
-
const footerTextContent = isResettingExpiredToken ? "Already
|
|
36
|
+
const mainTextContent = isResettingExpiredToken ? "To continue, request a new one using your email, and access will be sent shortly." : "Enter your email address and we will send you a link to reset your password.";
|
|
37
|
+
const footerTextContent = isResettingExpiredToken ? "Already registered? " : "Remember your password? ";
|
|
38
38
|
return /* @__PURE__ */ jsx(Modal, { isOpen: isModalOpen, onClose: onModalClose, background, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
39
39
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
40
40
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
@@ -45,11 +45,21 @@ const LoginModal = (props) => {
|
|
|
45
45
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
46
46
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
47
47
|
/* @__PURE__ */ jsx("h3", { children: "Log in" }),
|
|
48
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
48
|
+
/* @__PURE__ */ jsx("p", { children: "Access your account and manage your investments." })
|
|
49
49
|
] }) }),
|
|
50
50
|
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsxs(ModalLinkWrap, { children: [
|
|
51
|
-
"Don't have an account
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
51
|
+
"Don't have an account? ",
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
ModalLink,
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
to: "#",
|
|
57
|
+
as: "button",
|
|
58
|
+
"data-cy": "login-modal-switch-to-signup",
|
|
59
|
+
onClick: onModalSwitch,
|
|
60
|
+
children: "Sign up"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
53
63
|
] }) })
|
|
54
64
|
] }),
|
|
55
65
|
/* @__PURE__ */ jsx(Column, { part: 8, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsx(
|
|
@@ -104,7 +114,17 @@ const LoginModal = (props) => {
|
|
|
104
114
|
),
|
|
105
115
|
/* @__PURE__ */ jsx(FormError, { show: errors.password && touched.password, children: errors.password })
|
|
106
116
|
] }) }),
|
|
107
|
-
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
117
|
+
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
118
|
+
Button,
|
|
119
|
+
{
|
|
120
|
+
type: "submit",
|
|
121
|
+
id: "login-submit-btn",
|
|
122
|
+
"data-cy": "login-modal-submit",
|
|
123
|
+
fluid: true,
|
|
124
|
+
disabled: submitDisabled,
|
|
125
|
+
children: isActionLoading === "login" ? "Logging in" : "Login"
|
|
126
|
+
}
|
|
127
|
+
) }),
|
|
108
128
|
/* @__PURE__ */ jsx(ComponentWrapper, { paddingVeticalHalf: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupError.popup === "login", children: popupError.message }) }),
|
|
109
129
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(
|
|
110
130
|
TextLink,
|
|
@@ -4,7 +4,7 @@ import styled from "styled-components";
|
|
|
4
4
|
import { colors } from "../../styles/colors.js";
|
|
5
5
|
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
6
6
|
import { ArrowSimple } from "../icons/ArrowSimple.js";
|
|
7
|
-
import {
|
|
7
|
+
import { getCurrencyConfig, getCurrencyIcon } from "../../utils/formatCurrencyValue.js";
|
|
8
8
|
import externalLinkIcon from "../../static/images/external-link-icon.svg.js";
|
|
9
9
|
const CardContainer = styled.div`
|
|
10
10
|
background: ${colors.white};
|
|
@@ -65,6 +65,7 @@ const CurrencyTicker = styled.div`
|
|
|
65
65
|
line-height: 28px;
|
|
66
66
|
flex-shrink: 0;
|
|
67
67
|
margin-left: auto;
|
|
68
|
+
text-transform: uppercase;
|
|
68
69
|
`;
|
|
69
70
|
const CurrencyLogo = styled.div.withConfig({
|
|
70
71
|
shouldForwardProp: (props) => !["color"].includes(props)
|
|
@@ -245,12 +246,23 @@ const AmountBlock = ({ config }) => {
|
|
|
245
246
|
if (React__default.isValidElement(config)) {
|
|
246
247
|
return config;
|
|
247
248
|
}
|
|
248
|
-
const {
|
|
249
|
-
|
|
249
|
+
const {
|
|
250
|
+
label = "Amount",
|
|
251
|
+
subtitle,
|
|
252
|
+
amount,
|
|
253
|
+
currency,
|
|
254
|
+
decimals,
|
|
255
|
+
currencyColor,
|
|
256
|
+
icon,
|
|
257
|
+
showTicker = true,
|
|
258
|
+
banner
|
|
259
|
+
} = config;
|
|
260
|
+
const { symbol, decimals: resolvedDecimals } = getCurrencyConfig(currency, decimals ?? 2);
|
|
261
|
+
const hasAmount = amount !== void 0 && amount !== null && amount !== "";
|
|
262
|
+
const displayValue = hasAmount ? parseFloat(Math.abs(amount)).toFixed(resolvedDecimals) : null;
|
|
250
263
|
const currencyIcon = getCurrencyIcon(currency, icon);
|
|
251
264
|
const logoColor = currencyColor || colors.black;
|
|
252
|
-
const ticker = showTicker ?
|
|
253
|
-
const displayValue = formattedAmount ? formattedAmount.replace(/\s*\S+$/, "") : null;
|
|
265
|
+
const ticker = showTicker ? symbol : null;
|
|
254
266
|
const renderCurrencyLogo = () => {
|
|
255
267
|
if (currencyIcon) {
|
|
256
268
|
return /* @__PURE__ */ jsx(CurrencyLogo, { color: "transparent", children: /* @__PURE__ */ jsx(CurrencyIcon, { src: currencyIcon, alt: currency || "currency" }) });
|
|
@@ -34,18 +34,27 @@ const RegisterConfirmModal = ({
|
|
|
34
34
|
return /* @__PURE__ */ jsxs(Modal, { isOpen: isModalOpen, onClose: onModalClose, closeIsFullHeight: true, id, children: [
|
|
35
35
|
/* @__PURE__ */ jsx(Row, { isConfirmModal: true, children: /* @__PURE__ */ jsx(Column, { part: 10, isConfirmModal: true, children: /* @__PURE__ */ jsx(ModalInner, { children: /* @__PURE__ */ jsxs(ContainerWithLine, { children: [
|
|
36
36
|
/* @__PURE__ */ jsxs(Text, { children: [
|
|
37
|
-
/* @__PURE__ */ jsx("h3", { children: "
|
|
37
|
+
/* @__PURE__ */ jsx("h3", { children: "VERIFY YOUR EMAIL ADDRESS" }),
|
|
38
38
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
39
|
-
"
|
|
39
|
+
"A verification link has been sent to ",
|
|
40
40
|
userEmail,
|
|
41
|
-
"
|
|
41
|
+
". Please follow the link in the email to confirm your email address and activate your account."
|
|
42
42
|
] })
|
|
43
43
|
] }),
|
|
44
44
|
/* @__PURE__ */ jsxs(Text.Caption, { children: [
|
|
45
|
-
"Email
|
|
45
|
+
"Email not received?",
|
|
46
46
|
/* @__PURE__ */ jsx("br", {})
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
TextLink,
|
|
50
|
+
{
|
|
51
|
+
to: "",
|
|
52
|
+
"data-cy": "register-confirm-modal-resend-email",
|
|
53
|
+
onClick: onResend,
|
|
54
|
+
disabled: cooldown?.isDisabled,
|
|
55
|
+
children: isActionLoading === "resend" ? "Resending email" : "Resend verification email"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
49
58
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupError.popup === "resend", children: popupError.message }) }),
|
|
50
59
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingVertical: true, noPaddingHorizontal: true, children: /* @__PURE__ */ jsx(FormError, { show: popupSuccess.popup === "resend", children: popupSuccess.message }) }),
|
|
51
60
|
/* @__PURE__ */ jsx(ComponentWrapper, { noPaddingBottom: true, noPaddingHorizontal: true, children: cooldown?.isDisabled && /* @__PURE__ */ jsx(FormError, { show: cooldown?.isDisabled, children: `You can resend email in ${cooldown?.secondsRemaining} seconds` }) })
|
|
@@ -40,7 +40,7 @@ const RegisterModal = (props) => {
|
|
|
40
40
|
title: "privacy"
|
|
41
41
|
});
|
|
42
42
|
const [newsletterCheckbox, setNewsletterCheckbox] = useState({
|
|
43
|
-
agreementText: "
|
|
43
|
+
agreementText: "I would like to receive updates and news from STOKR.",
|
|
44
44
|
label: "newsletter",
|
|
45
45
|
text: "",
|
|
46
46
|
title: "newsletter"
|
|
@@ -93,10 +93,10 @@ const RegisterModal = (props) => {
|
|
|
93
93
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
94
94
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
95
95
|
/* @__PURE__ */ jsx("h3", { children: "CREATE YOUR STOKR ACCOUNT" }),
|
|
96
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
96
|
+
/* @__PURE__ */ jsx("p", { children: "Register on STOKR to access digital securities offerings and manage your investments." })
|
|
97
97
|
] }) }),
|
|
98
98
|
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsxs(ModalLinkWrap, { children: [
|
|
99
|
-
"Already
|
|
99
|
+
"Already registered?",
|
|
100
100
|
" ",
|
|
101
101
|
/* @__PURE__ */ jsx(
|
|
102
102
|
ModalLink,
|
|
@@ -20,16 +20,12 @@ const RedBar = styled.div`
|
|
|
20
20
|
const ResetConfirmModal = ({ isModalOpen, onModalClose, onModalSwitch }) => /* @__PURE__ */ jsxs(Modal, { isOpen: isModalOpen, onClose: onModalClose, closeIsFullHeight: true, children: [
|
|
21
21
|
/* @__PURE__ */ jsx(Row, { isConfirmModal: true, children: /* @__PURE__ */ jsx(Column, { relative: true, part: 10, isConfirmModal: true, children: /* @__PURE__ */ jsx(ModalInner, { isConfirmModal: true, children: /* @__PURE__ */ jsxs(ContainerWithLine, { children: [
|
|
22
22
|
/* @__PURE__ */ jsxs(Text, { withBorder: true, isConfirm: true, children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
26
|
-
"You're back in the game!"
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ jsx("p", { children: "Your new password has been set." })
|
|
23
|
+
/* @__PURE__ */ jsx("h3", { children: "PASSWORD UPDATED" }),
|
|
24
|
+
/* @__PURE__ */ jsx("p", { children: "Your password has been updated. You may now sign in with your new credentials." })
|
|
29
25
|
] }),
|
|
30
26
|
/* @__PURE__ */ jsx("br", {}),
|
|
31
27
|
/* @__PURE__ */ jsx("br", {}),
|
|
32
|
-
/* @__PURE__ */ jsx(Button, { "data-cy": "reset-confirm-modal-login", onClick: onModalSwitch, children: "
|
|
28
|
+
/* @__PURE__ */ jsx(Button, { "data-cy": "reset-confirm-modal-login", onClick: onModalSwitch, children: "Log in" })
|
|
33
29
|
] }) }) }) }),
|
|
34
30
|
/* @__PURE__ */ jsx(RedBar, {})
|
|
35
31
|
] });
|
|
@@ -40,8 +40,8 @@ const ResetPasswordModal = ({
|
|
|
40
40
|
return /* @__PURE__ */ jsx(Modal, { isOpen: isModalOpen, onClose: onModalClose, children: /* @__PURE__ */ jsxs(Row, { children: [
|
|
41
41
|
/* @__PURE__ */ jsxs(Column, { part: 8, children: [
|
|
42
42
|
/* @__PURE__ */ jsx(ModalInner, { modalTop: true, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
43
|
-
/* @__PURE__ */ jsx("h3", { children: "
|
|
44
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
43
|
+
/* @__PURE__ */ jsx("h3", { children: "SET A NEW PASSWORD" }),
|
|
44
|
+
/* @__PURE__ */ jsx("p", { children: "Enter and confirm your new password." })
|
|
45
45
|
] }) }),
|
|
46
46
|
/* @__PURE__ */ jsx(ModalInner, { modalBot: true, children: /* @__PURE__ */ jsxs(ModalLinkWrap, { children: [
|
|
47
47
|
"Remember your password? ",
|
|
@@ -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, self_declaration, wallets = [] } = user;
|
|
9
|
+
const { country, kyc_status, self_declaration, taxId, 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:
|
|
29
|
+
isDone: self_declaration?.data?.confirmed === true,
|
|
30
30
|
isActive: isActiveStep("/self-certification")
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -23,7 +23,8 @@ const renderSuccessModal = (continueUrl) => /* @__PURE__ */ jsx(Fragment, { chil
|
|
|
23
23
|
onClick: () => {
|
|
24
24
|
window.open(continueUrl, "_self");
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
titleText: "Email verified",
|
|
27
|
+
textRight: "Your email address has been verified."
|
|
27
28
|
}
|
|
28
29
|
) });
|
|
29
30
|
const RenderErrorModal = (props) => {
|
package/dist/index.js
CHANGED
|
@@ -122,7 +122,7 @@ import { checkTodoStatus } from "./utils/check-todo-status.js";
|
|
|
122
122
|
import { generateCoreChecklistTasks, getVerifyIdentityChecklist } from "./utils/checklistGenerator.js";
|
|
123
123
|
import { CopyToClipBoardTooltip, copyTextToClipboard, useCopyToClipboard, withCopyToClipboard } from "./utils/copyToClipboard.js";
|
|
124
124
|
import { cooldownHOC, useComponentVisible, useContainerSize, useCooldown, useMobileView, usePrevious } from "./utils/customHooks.js";
|
|
125
|
-
import { fixDecimals } from "./utils/fix-decimals.js";
|
|
125
|
+
import { fixDecimals, formatDisplayNumber } from "./utils/fix-decimals.js";
|
|
126
126
|
import { CURRENCY_CONFIG, formatCurrencyValue, getCurrencyConfig, getCurrencyIcon, getCurrencySymbol, getLiquidAssetIcon, getProjectCurrencySign } from "./utils/formatCurrencyValue.js";
|
|
127
127
|
import { isUSInvestor, usCountries } from "./utils/isUSInvestor.js";
|
|
128
128
|
import { ENTROPY_MEDIUM, ENTROPY_WEAK, PASSWORD_MIN_LENGTH, PASSWORD_REQUIREMENTS_MESSAGE, getPasswordCriteria, getPasswordEntropy, isPasswordValid } from "./utils/password-validation.js";
|
|
@@ -599,6 +599,7 @@ export {
|
|
|
599
599
|
default2 as fontFaces,
|
|
600
600
|
format,
|
|
601
601
|
formatCurrencyValue,
|
|
602
|
+
formatDisplayNumber,
|
|
602
603
|
generateCoreChecklistTasks,
|
|
603
604
|
getAmountBucket,
|
|
604
605
|
getAnalyticsIngestUrl,
|
|
@@ -125,7 +125,7 @@ function generateCoreChecklistTasks(user) {
|
|
|
125
125
|
remainingCount: 0
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
const { country, user_type, wallets = [], self_declaration, countryObj } = user;
|
|
128
|
+
const { country, user_type, wallets = [], self_declaration, countryObj, taxId } = user;
|
|
129
129
|
const isFromAllowedCountry = countryObj?.isAllowed;
|
|
130
130
|
const liquidWallets = wallets.filter((wallet2) => wallet2.type === walletTypes.LIQUID) || [];
|
|
131
131
|
const hasWallet = liquidWallets.length > 0;
|
|
@@ -162,7 +162,8 @@ function generateCoreChecklistTasks(user) {
|
|
|
162
162
|
link: signupBase ? `${signupBase}/register-liquid-securities` : "",
|
|
163
163
|
isClickable: isFromAllowedCountry && walletStatus !== "done"
|
|
164
164
|
};
|
|
165
|
-
const
|
|
165
|
+
const isSelfCertConfirmed = self_declaration?.data?.confirmed === true;
|
|
166
|
+
const selfCertStatus = isSelfCertConfirmed ? "done" : "missing";
|
|
166
167
|
const selfCertification = {
|
|
167
168
|
key: "selfCertification",
|
|
168
169
|
title: TASK_COPY.selfCertification.title,
|
|
@@ -170,7 +171,8 @@ function generateCoreChecklistTasks(user) {
|
|
|
170
171
|
iconState: selfCertStatus,
|
|
171
172
|
iconCopy: TASK_COPY.selfCertification.iconCopy[selfCertStatus],
|
|
172
173
|
link: selfCertStatus !== "done" && signupBase ? `${signupBase}/self-certification` : "",
|
|
173
|
-
isClickable: selfCertStatus !== "done"
|
|
174
|
+
isClickable: selfCertStatus !== "done",
|
|
175
|
+
meetsEligibility: isSelfCertConfirmed || !!taxId
|
|
174
176
|
};
|
|
175
177
|
const allTasks = [countryTask, identity, wallet, selfCertification].filter(Boolean);
|
|
176
178
|
const remainingCount = allTasks.filter(
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
const fixDecimals = (value, decimals, roundingFn = Math.round) => (roundingFn(Number(value) * 10 ** decimals) / 10 ** decimals).toFixed(decimals);
|
|
2
|
+
const formatDisplayNumber = (value, { minimumFractionDigits = 0, maximumFractionDigits } = {}) => {
|
|
3
|
+
const num = typeof value === "number" ? value : parseFloat(value);
|
|
4
|
+
if (num == null || Number.isNaN(num)) return "";
|
|
5
|
+
const max = maximumFractionDigits != null ? Math.max(maximumFractionDigits, minimumFractionDigits) : Math.max(minimumFractionDigits, 3);
|
|
6
|
+
return num.toLocaleString("en", { minimumFractionDigits, maximumFractionDigits: max });
|
|
7
|
+
};
|
|
2
8
|
export {
|
|
3
|
-
fixDecimals
|
|
9
|
+
fixDecimals,
|
|
10
|
+
formatDisplayNumber
|
|
4
11
|
};
|
|
@@ -14,8 +14,8 @@ const CURRENCY_CONFIG = {
|
|
|
14
14
|
"lusdt-bfx": ["USDT", 2],
|
|
15
15
|
"lbtc-bfx": ["LBTC", 8],
|
|
16
16
|
"btc-bfx": ["BTC", 8],
|
|
17
|
-
euro: ["EUR", 2],
|
|
18
|
-
usd: ["USD", 2],
|
|
17
|
+
euro: ["EUR", 2, "€"],
|
|
18
|
+
usd: ["USD", 2, "$"],
|
|
19
19
|
chf: ["CHF", 2],
|
|
20
20
|
lusdt: ["USDT", 2],
|
|
21
21
|
"bitcoin-private": ["EUR", 2],
|
|
@@ -25,12 +25,17 @@ const CURRENCY_CONFIG = {
|
|
|
25
25
|
"btc-fb": ["BTC", 8],
|
|
26
26
|
"usdc-fb": ["USDC", 2],
|
|
27
27
|
"usdq-fb": ["USDQ", 2],
|
|
28
|
+
"eth-fb": ["ETH", 4],
|
|
28
29
|
xaut: ["XAUt", 6],
|
|
29
|
-
"usd-in-kind": ["USD", 2]
|
|
30
|
+
"usd-in-kind": ["USD", 2, "$"]
|
|
30
31
|
};
|
|
31
32
|
const getCurrencyConfig = (currency, tokenDecimals = 2) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
33
|
+
const config = CURRENCY_CONFIG[String(currency ?? "").toLowerCase()];
|
|
34
|
+
if (config) {
|
|
35
|
+
const [symbol, decimals, sign] = config;
|
|
36
|
+
return { symbol, decimals, sign: sign ?? symbol, matched: true };
|
|
37
|
+
}
|
|
38
|
+
return { symbol: currency, decimals: tokenDecimals, sign: currency, matched: false };
|
|
34
39
|
};
|
|
35
40
|
const formatCurrencyValue = (currency, value, tokenDecimals = 2, options = {}) => {
|
|
36
41
|
const { valueFirst = false, formatter } = options;
|
|
@@ -41,27 +46,14 @@ const formatCurrencyValue = (currency, value, tokenDecimals = 2, options = {}) =
|
|
|
41
46
|
const formattedValue = parseFloat(Math.abs(value)).toFixed(decimals);
|
|
42
47
|
return valueFirst ? `${formattedValue} ${symbol}` : `${symbol} ${formattedValue}`;
|
|
43
48
|
};
|
|
44
|
-
const getCurrencySymbol = (currencySelected) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
lusdt: "USDT",
|
|
53
|
-
"lusdt-bfx": "USDT",
|
|
54
|
-
"lbtc-bfx": "LBTC",
|
|
55
|
-
"btc-bfx": "BTC",
|
|
56
|
-
bmn1: "BMN1",
|
|
57
|
-
bmn2: "BMN2",
|
|
58
|
-
"btc-fb": "BTC",
|
|
59
|
-
"usdc-fb": "USDC",
|
|
60
|
-
"usdq-fb": "USDQ",
|
|
61
|
-
xaut: "XAUt",
|
|
62
|
-
"eth-fb": "ETH",
|
|
63
|
-
"usd-in-kind": "$"
|
|
64
|
-
})[currencySelected] || currencySelected;
|
|
49
|
+
const getCurrencySymbol = (currencySelected) => {
|
|
50
|
+
const config = CURRENCY_CONFIG[currencySelected];
|
|
51
|
+
if (config) {
|
|
52
|
+
const [symbol, , sign] = config;
|
|
53
|
+
return sign ?? symbol;
|
|
54
|
+
}
|
|
55
|
+
return currencySelected;
|
|
56
|
+
};
|
|
65
57
|
const getProjectCurrencySign = (tokenCurrency) => {
|
|
66
58
|
return tokenCurrency === "EUR" ? "€" : tokenCurrency === "USD" ? "$" : tokenCurrency === "BTC" ? "₿" : "";
|
|
67
59
|
};
|