@stokr/components-library 3.0.21 → 3.0.23
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/README.md +217 -11
- package/dist/analytics/index.js +5 -1
- package/dist/api/authenticationApi.js +13 -0
- package/dist/auth/index.js +4 -2
- package/dist/components/2FA/login-with-otp-flow.js +9 -4
- package/dist/components/Footer/FooterLayout.js +98 -95
- package/dist/components/Footer/FooterMenu.js +1 -1
- package/dist/components/Header/Header.js +102 -54
- package/dist/components/MainMenu/MainMenu.js +14 -4
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +6 -2
- package/dist/components/Modal/SuccessModal/SuccessModal.js +7 -1
- package/dist/components/Payment/PaymentDetailsCard.js +1 -1
- package/dist/components/StatusDot/StatusDot.js +68 -0
- package/dist/components/StatusDot/StatusDot.styles.js +45 -0
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +2 -1
- package/dist/components/headerHo/HeaderHo.js +8 -5
- package/dist/config.js +5 -21
- package/dist/constants/globalVariables.js +6 -4
- package/dist/context/Auth.js +5 -2
- package/dist/context/AuthContext.js +22 -8
- package/dist/firebase-config.js +4 -18
- package/dist/index.js +38 -5
- package/dist/model/axios.js +3 -1
- package/dist/model/axiosPublic.js +2 -2
- package/dist/routing/RouterWrapper.js +17 -0
- package/dist/routing/app-routes.js +22 -0
- package/dist/routing/navigate-app.js +36 -0
- package/dist/routing/resolve-app-href.js +149 -0
- package/dist/runtime-config.js +94 -0
- package/dist/static/animations/upload.lottie +0 -0
- package/dist/static/animations/upload.lottie.js +4 -0
- package/dist/static/images/upload.svg +5 -1
- package/dist/utils/app-urls-analytics-backoffice.js +30 -0
- package/dist/utils/app-urls.js +28 -0
- package/dist/utils/checklistGenerator.js +6 -5
- package/dist/utils/customHooks.js +1 -1
- package/dist/utils/formatCurrencyValue.js +2 -1
- package/dist/utils/get-cookie-domain.js +4 -1
- package/dist/utils/set-redirect-cookie.js +4 -1
- package/dist/utils/withRouter.js +5 -3
- package/package.json +1 -1
- package/dist/api/auth.js +0 -15
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppSurface } from "../routing/app-routes.js";
|
|
2
|
+
import { AppRoute } from "../routing/app-routes.js";
|
|
3
|
+
import { resolveAppHref } from "../routing/resolve-app-href.js";
|
|
4
|
+
import { SURFACE_ROUTING_PATH_KEYS, getAppPublicOrigin, isAlreadyOnOnboardingFlow, isPathBasedRouting, isPathForSurface } from "../routing/resolve-app-href.js";
|
|
5
|
+
const getOnboardingAppBaseUrl = () => resolveAppHref(AppSurface.ONBOARDING, "");
|
|
6
|
+
const buildOnboardingUrl = (path = "") => resolveAppHref(AppSurface.ONBOARDING, path);
|
|
7
|
+
const getDashboardBaseUrl = () => resolveAppHref(AppSurface.DASHBOARD, "");
|
|
8
|
+
const buildDashboardUrl = (path = "") => resolveAppHref(AppSurface.DASHBOARD, path);
|
|
9
|
+
const getAdminAppUrl = () => resolveAppHref(AppSurface.ADMIN, "");
|
|
10
|
+
const getInvestorAppOrigin = () => resolveAppHref(AppSurface.INVESTOR_ROOT, "");
|
|
11
|
+
const getRegisterEntryUrl = () => resolveAppHref(AppSurface.REGISTER, "");
|
|
12
|
+
export {
|
|
13
|
+
AppRoute,
|
|
14
|
+
AppSurface,
|
|
15
|
+
SURFACE_ROUTING_PATH_KEYS,
|
|
16
|
+
buildDashboardUrl,
|
|
17
|
+
buildOnboardingUrl,
|
|
18
|
+
getAdminAppUrl,
|
|
19
|
+
getAppPublicOrigin,
|
|
20
|
+
getDashboardBaseUrl,
|
|
21
|
+
getInvestorAppOrigin,
|
|
22
|
+
getOnboardingAppBaseUrl,
|
|
23
|
+
getRegisterEntryUrl,
|
|
24
|
+
isAlreadyOnOnboardingFlow,
|
|
25
|
+
isPathBasedRouting,
|
|
26
|
+
isPathForSurface,
|
|
27
|
+
resolveAppHref
|
|
28
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { walletTypes, UserTypes } from "../constants/globalVariables.js";
|
|
2
|
-
|
|
2
|
+
import { AppSurface } from "../routing/app-routes.js";
|
|
3
|
+
import { resolveAppHref } from "../routing/resolve-app-href.js";
|
|
3
4
|
const TASK_COPY = {
|
|
4
5
|
country: {
|
|
5
6
|
title: {
|
|
@@ -132,7 +133,7 @@ function generateCoreChecklistTasks(user) {
|
|
|
132
133
|
const liquidWallets = wallets.filter((wallet2) => wallet2.type === walletTypes.LIQUID) || [];
|
|
133
134
|
const hasWallet = liquidWallets.length > 0;
|
|
134
135
|
const isEntity = user_type === UserTypes.investor_entity;
|
|
135
|
-
const
|
|
136
|
+
const signupBase = resolveAppHref(AppSurface.ONBOARDING, "");
|
|
136
137
|
const countryStatus = !country ? "missing" : !isFromAllowedCountry ? "not_available" : "done";
|
|
137
138
|
const countryTask = {
|
|
138
139
|
key: "country",
|
|
@@ -140,7 +141,7 @@ function generateCoreChecklistTasks(user) {
|
|
|
140
141
|
description: getCountryDescription(user, isFromAllowedCountry),
|
|
141
142
|
iconState: countryStatus,
|
|
142
143
|
iconCopy: TASK_COPY.country.iconCopy[countryStatus],
|
|
143
|
-
link: `${
|
|
144
|
+
link: signupBase ? `${signupBase}/country-of-residence` : "",
|
|
144
145
|
isClickable: countryStatus !== "done"
|
|
145
146
|
};
|
|
146
147
|
const verifyIdentityChecklist = getVerifyIdentityChecklist(isFromAllowedCountry, user, isEntity);
|
|
@@ -150,7 +151,7 @@ function generateCoreChecklistTasks(user) {
|
|
|
150
151
|
description: verifyIdentityChecklist.message,
|
|
151
152
|
iconState: verifyIdentityChecklist.state,
|
|
152
153
|
iconCopy: TASK_COPY.identity.iconCopy[verifyIdentityChecklist.state],
|
|
153
|
-
link: `${
|
|
154
|
+
link: signupBase ? `${signupBase}/verify-identity` : "",
|
|
154
155
|
isClickable: verifyIdentityChecklist.hasLink
|
|
155
156
|
};
|
|
156
157
|
const walletStatus = hasWallet ? "done" : "missing";
|
|
@@ -161,7 +162,7 @@ function generateCoreChecklistTasks(user) {
|
|
|
161
162
|
description: walletDescription,
|
|
162
163
|
iconState: walletStatus,
|
|
163
164
|
iconCopy: TASK_COPY.wallet.iconCopy[walletStatus],
|
|
164
|
-
link: `${
|
|
165
|
+
link: signupBase ? `${signupBase}/register-liquid-securities` : "",
|
|
165
166
|
isClickable: isFromAllowedCountry && walletStatus !== "done"
|
|
166
167
|
};
|
|
167
168
|
const taxStatus = taxId ? "done" : "missing";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useRef,
|
|
2
|
+
import React__default, { useState, useRef, useCallback, useEffect } from "react";
|
|
3
3
|
import { sizes } from "../styles/rwd.js";
|
|
4
4
|
const useMobileView = (breakpoint = sizes.Medium) => {
|
|
5
5
|
var breakpointNumber = breakpoint.match(/\d/g);
|
|
@@ -57,7 +57,8 @@ const getProjectCurrencySign = (tokenCurrency) => {
|
|
|
57
57
|
const getCurrencyIcon = (currency, customIcon) => {
|
|
58
58
|
if (customIcon) return customIcon;
|
|
59
59
|
if (!currency) return null;
|
|
60
|
-
|
|
60
|
+
const value = String(currency).toLowerCase();
|
|
61
|
+
switch (value) {
|
|
61
62
|
case "btc":
|
|
62
63
|
case "bitcoin":
|
|
63
64
|
case "btc-fb":
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../firebase-config.js";
|
|
2
|
+
import "../model/axios.js";
|
|
3
|
+
import "../model/axiosPublic.js";
|
|
4
|
+
import { getConfig } from "../runtime-config.js";
|
|
2
5
|
const getCookieDomain = () => {
|
|
3
6
|
const domain = getConfig("cookieDomain");
|
|
4
7
|
const useDomain = domain && domain !== "localhost";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import Cookies from "js-cookie";
|
|
2
|
-
import
|
|
2
|
+
import "../firebase-config.js";
|
|
3
|
+
import "../model/axios.js";
|
|
4
|
+
import "../model/axiosPublic.js";
|
|
5
|
+
import { getConfig } from "../runtime-config.js";
|
|
3
6
|
const setRedirectCookie = (path = "") => {
|
|
4
7
|
const inOneHour = 1 / 24;
|
|
5
8
|
const cookieOptions = {
|
package/dist/utils/withRouter.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { useInRouterContext, useNavigate, useLocation } from "react-router-dom";
|
|
4
|
-
const noopNavigate = () => {
|
|
5
|
-
};
|
|
6
4
|
const fallbackLocation = { pathname: "/", search: "", hash: "", state: null, key: "default" };
|
|
5
|
+
const NAVIGATE_OUTSIDE_ROUTER_MSG = "[@stokr/components-library] Navigation requires a React Router context. Wrap the app root with BrowserRouter, or with RouterWrapper from this package (it adds BrowserRouter only when useInRouterContext() is false so you avoid duplicate routers in a host app).";
|
|
6
|
+
function navigateOutsideRouter() {
|
|
7
|
+
throw new Error(NAVIGATE_OUTSIDE_ROUTER_MSG);
|
|
8
|
+
}
|
|
7
9
|
const withRouter = (Component) => {
|
|
8
10
|
const InnerWithRouter = (props) => {
|
|
9
11
|
const navigate = useNavigate();
|
|
@@ -15,7 +17,7 @@ const withRouter = (Component) => {
|
|
|
15
17
|
if (inRouter) {
|
|
16
18
|
return /* @__PURE__ */ jsx(InnerWithRouter, { ...props });
|
|
17
19
|
}
|
|
18
|
-
return /* @__PURE__ */ jsx(Component, { navigate:
|
|
20
|
+
return /* @__PURE__ */ jsx(Component, { navigate: navigateOutsideRouter, location: fallbackLocation, ...props });
|
|
19
21
|
};
|
|
20
22
|
return Wrapper;
|
|
21
23
|
};
|
package/package.json
CHANGED
package/dist/api/auth.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import axiosInstance from "../model/axios.js";
|
|
2
|
-
const authAPI = async (url, data) => {
|
|
3
|
-
try {
|
|
4
|
-
const result = await axiosInstance.post(`auth/${url}`, data);
|
|
5
|
-
console.log("Success!");
|
|
6
|
-
return result;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
console.log(`Error: ${error}`);
|
|
9
|
-
throw error;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
authAPI,
|
|
14
|
-
authAPI as default
|
|
15
|
-
};
|