@stokr/components-library 3.0.26 → 3.0.27

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.
Files changed (41) hide show
  1. package/README.md +33 -119
  2. package/dist/analytics/index.js +0 -1
  3. package/dist/components/2FA/login-with-otp-flow.js +4 -5
  4. package/dist/components/Footer/FooterLayout.js +1 -1
  5. package/dist/components/Header/Header.js +18 -19
  6. package/dist/components/MainMenu/MainMenu.js +5 -6
  7. package/dist/components/Modal/NewVentureModal/NewVentureModal.js +3 -3
  8. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +1 -1
  9. package/dist/components/headerHo/HeaderHo.js +5 -5
  10. package/dist/components/icons/LinkIcon.js +2 -2
  11. package/dist/constants/globalVariables.js +0 -6
  12. package/dist/context/AuthContext.js +55 -36
  13. package/dist/index.js +3 -21
  14. package/dist/routing/navigate-app.js +0 -12
  15. package/dist/runtime-config.js +10 -6
  16. package/dist/static/country-list.json +251 -251
  17. package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
  18. package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
  19. package/dist/static/fonts/icomoon/selection.json +910 -910
  20. package/dist/static/fonts/icomoon/style.css +139 -139
  21. package/dist/static/images/copy_icon.svg +4 -4
  22. package/dist/static/images/download_icon.svg +3 -3
  23. package/dist/static/images/numbers/number_eight.svg +3 -3
  24. package/dist/static/images/numbers/number_five.svg +4 -4
  25. package/dist/static/images/numbers/number_four.svg +3 -3
  26. package/dist/static/images/numbers/number_nine.svg +4 -4
  27. package/dist/static/images/numbers/number_one.svg +4 -4
  28. package/dist/static/images/numbers/number_seven.svg +4 -4
  29. package/dist/static/images/numbers/number_six.svg +4 -4
  30. package/dist/static/images/numbers/number_three.svg +3 -3
  31. package/dist/static/images/numbers/number_two.svg +4 -4
  32. package/dist/static/images/numbers/number_zero.svg +3 -3
  33. package/dist/static/images/plus-icon.svg +4 -4
  34. package/dist/static/images/search-icon.svg +3 -3
  35. package/dist/static/images/transfer-icon.svg +10 -10
  36. package/dist/static/images/warning-filled.svg +3 -3
  37. package/dist/utils/app-urls.js +8 -26
  38. package/dist/utils/checklistGenerator.js +2 -3
  39. package/package.json +1 -1
  40. package/dist/routing/app-routes.js +0 -22
  41. package/dist/routing/resolve-app-href.js +0 -149
package/README.md CHANGED
@@ -8,7 +8,7 @@ React component library for STOKR applications. Includes modals, forms, buttons,
8
8
  - [How to start](#how-to-start)
9
9
  - [Configuration](#configuration)
10
10
  - [Runtime config (npm consumers)](#runtime-config)
11
- - [Path-based URLs vs subdomains](#path-based-urls-vs-subdomains)
11
+ - [URL variables and behavior](#url-variables-and-behavior)
12
12
  - [Reading config with `getConfig()`](#reading-config-with-getconfig)
13
13
  - [Ionicons](#ionicons)
14
14
  - [React Router](#react-router)
@@ -153,6 +153,10 @@ function App() {
153
153
  cookieDomain: import.meta.env.VITE_COOKIE_DOMAIN,
154
154
  websiteDomain: import.meta.env.VITE_WEBSITE_DOMAIN,
155
155
  photoApiUrl: import.meta.env.VITE_PHOTO_API_URL,
156
+ onboardingUrl: import.meta.env.VITE_ONBOARDING_URL,
157
+ dashboardUrl: import.meta.env.VITE_DASHBOARD_URL,
158
+ adminUrl: import.meta.env.VITE_ADMIN_URL,
159
+ registerUrl: import.meta.env.VITE_REGISTER_URL,
156
160
  firebase: {
157
161
  apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
158
162
  authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
@@ -176,10 +180,11 @@ function App() {
176
180
  | `cookieDomain` | `VITE_COOKIE_DOMAIN` | Domain attribute for auth cookies |
177
181
  | `websiteDomain` | `VITE_WEBSITE_DOMAIN` | Platform domain (redirects, links) |
178
182
  | `photoApiUrl` | `VITE_PHOTO_API_URL` | Photo upload / avatar API URL |
183
+ | `onboardingUrl` | `VITE_ONBOARDING_URL` | Full onboarding app URL (signup/signin flow) |
184
+ | `dashboardUrl` | `VITE_DASHBOARD_URL` | Full investor dashboard URL |
185
+ | `adminUrl` | `VITE_ADMIN_URL` | Full admin/venture dashboard URL |
186
+ | `registerUrl` | `VITE_REGISTER_URL` | Public registration entry URL |
179
187
  | `firebase` | `VITE_FIREBASE_*` | Full Firebase config object |
180
- | `routingMode` | `VITE_ROUTING_MODE` | Set to `path` for single-origin app URLs (see below). |
181
- | `appUrlPaths` | — | Optional object overriding first path segments in path mode (e.g. `{ onboarding: '/signup', dashboard: '/app' }`). |
182
- | `surfaceRoutingMode` | — | Optional per-surface `'path'` / `'subdomain'` overrides for incremental URL migration (see [below](#incremental-url-migration-surfaceRoutingMode)). |
183
188
 
184
189
  > **Why is this needed?** With the old CRA / `react-scripts` build, Webpack re-processed library code through the consuming app's build pipeline, so the app's `.env` values were injected automatically. Vite treats npm packages as pre-built — `import.meta.env` values in the compiled library are frozen at library build time. The `config` prop passes them at runtime instead.
185
190
 
@@ -197,128 +202,33 @@ configure({
197
202
 
198
203
  After `configure()` / `<AuthProvider config>`, the library may log a **one-time `console.warn`** listing any **`VITE_*`** variables that are still missing (no override and no env fallback). Fix your `.env` or extend the `config` object until the list is empty.
199
204
 
200
- ### Path-based URLs vs subdomains {#path-based-urls-vs-subdomains}
205
+ ### URL variables and behavior {#url-variables-and-behavior}
201
206
 
202
- By default the library builds **subdomain** links (`https://dashboard.{websiteDomain}`, `https://signup.{websiteDomain}/welcome`, `https://admin.{websiteDomain}`, etc.), matching historical STOKR hosting.
207
+ The URL model is now explicit: pass full app URLs instead of routing mode/path segment rules.
203
208
 
204
- To switch to **one origin + path prefixes** (for example `https://example.com/dashboard`, `https://example.com/signin/welcome`, `https://example.com/admin`), pass **`routingMode: 'path'`** (or `VITE_ROUTING_MODE=path`) and optionally **`appUrlPaths`** overrides. The public origin for path mode is always **`https://{websiteDomain}`** (same as **`getPlatformURL()`**).
209
+ Expected URL env variables (matching current `.env.local`):
205
210
 
206
- ```jsx
207
- <AuthProvider
208
- config={{
209
- apiUrl: import.meta.env.VITE_API_URL,
210
- websiteDomain: import.meta.env.VITE_WEBSITE_DOMAIN,
211
- routingMode: 'path',
212
- appUrlPaths: {
213
- onboarding: '/signin', // flows that used https://signup.{domain}
214
- registerEntry: '/signup', // CTA from login; default in code is /signup
215
- dashboard: '/dashboard',
216
- admin: '/admin',
217
- },
218
- firebase: { /* … */ },
219
- /* …other keys */
220
- }}>
221
- ```
222
-
223
- **Analytics and backoffice** always use legacy subdomains **`https://analytics.{websiteDomain}`** and **`https://backoffice.{websiteDomain}`**, even in path mode. They are implemented in **`src/utils/app-urls-analytics-backoffice.js`** and re-exported from **`app-urls.js`** (`getAnalyticsIngestUrl`, `getBackofficeAppUrl`); they are not driven by **`appUrlPaths`**.
224
-
225
- #### Incremental URL migration (`surfaceRoutingMode`) {#incremental-url-migration-surfaceRoutingMode}
226
-
227
- You do not have to flip every surface at once.
228
-
229
- - **Global default:** `routingMode: 'path'` means “use path URLs for every surface that supports it”, unless overridden. Leaving `routingMode` unset (or not `'path'`) keeps **subdomain** URLs by default.
230
- - **Per-surface override:** pass **`surfaceRoutingMode`** on `configure()` / `<AuthProvider config>`. Each key is one of **`onboarding`**, **`dashboard`**, **`admin`**, **`registerEntry`**, **`investorRoot`** (see **`SURFACE_ROUTING_PATH_KEYS`** on the package entry). Each value is **`'path'`** or **`'subdomain'`**. Any surface **omitted** from the object follows the global **`routingMode`**.
231
-
232
- Examples:
233
-
234
- 1. **Path everywhere except admin** (admin still `https://admin.{domain}` until infra is ready):
235
-
236
- ```js
237
- configure({
238
- websiteDomain: 'example.com',
239
- routingMode: 'path',
240
- appUrlPaths: { dashboard: '/dashboard', onboarding: '/signin', registerEntry: '/signup', admin: '/admin' },
241
- surfaceRoutingMode: { admin: 'subdomain' },
242
- })
243
- ```
244
-
245
- 2. **Subdomains by default, dashboard and admin on path** (e.g. first rollout):
246
-
247
- ```js
248
- configure({
249
- websiteDomain: 'example.com',
250
- appUrlPaths: { dashboard: '/dashboard', admin: '/admin' },
251
- surfaceRoutingMode: { dashboard: 'path', admin: 'path' },
252
- })
253
- ```
254
-
255
- In host UI or guards, use **`isPathForSurface('dashboard')`** / **`isPathForSurface('admin')`** (exported from **`@stokr/components-library`**) so behaviour matches **`resolveAppHref`**.
256
-
257
- ##### Worked example (no script)
258
-
259
- Assume **`websiteDomain: 'acme.com'`** and default **`appUrlPaths`** (among others: **`dashboard`** → **`/dashboard`**, **`admin`** → **`/admin`**).
260
-
261
- **A — Full path mode** (every surface that supports paths uses **`https://acme.com`** + prefix):
262
-
263
- ```js
264
- import { configure, resolveAppHref, isPathForSurface, AppSurface } from '@stokr/components-library'
265
-
266
- configure({ websiteDomain: 'acme.com', routingMode: 'path' })
267
- ```
268
-
269
- | Call | Result |
270
- | ---------------------------------------------------- | -------------------------------------- |
271
- | `resolveAppHref(AppSurface.DASHBOARD, '')` | `https://acme.com/dashboard` |
272
- | `resolveAppHref(AppSurface.DASHBOARD, '/checklist')` | `https://acme.com/dashboard/checklist` |
273
- | `resolveAppHref(AppSurface.ADMIN, '')` | `https://acme.com/admin` |
274
- | `isPathForSurface('dashboard')` | `true` |
275
- | `isPathForSurface('admin')` | `true` |
276
-
277
- **B — Path mode, but admin stays on subdomain** until infra is ready:
278
-
279
- ```js
280
- configure({
281
- websiteDomain: 'acme.com',
282
- routingMode: 'path',
283
- surfaceRoutingMode: { admin: 'subdomain' },
284
- })
285
- ```
286
-
287
- | Call | Result |
288
- | ---------------------------------------------------- | -------------------------------------------------- |
289
- | `resolveAppHref(AppSurface.DASHBOARD, '/checklist')` | `https://acme.com/dashboard/checklist` (unchanged) |
290
- | `resolveAppHref(AppSurface.ADMIN, '')` | `https://admin.acme.com` |
291
- | `isPathForSurface('admin')` | `false` |
292
-
293
- **C — Global default is still subdomain; dashboard and admin use path** (incremental first step):
294
-
295
- ```js
296
- configure({
297
- websiteDomain: 'acme.com',
298
- surfaceRoutingMode: { dashboard: 'path', admin: 'path' },
299
- })
211
+ ```bash
212
+ VITE_WEBSITE_DOMAIN=stokr.info
213
+ VITE_ONBOARDING_URL=https://signup.stokr.info
214
+ VITE_DASHBOARD_URL=https://dashboard.stokr.info
215
+ VITE_ADMIN_URL=https://admin.stokr.info
216
+ VITE_REGISTER_URL=https://stokr.info/signup
300
217
  ```
301
218
 
302
- (`routingMode` is not **`'path'`**, so any surface **not** listed in **`surfaceRoutingMode`** keeps subdomain URLs.)
303
-
304
- | Call | Result |
305
- | ------------------------------------------ | ---------------------------- |
306
- | `resolveAppHref(AppSurface.DASHBOARD, '')` | `https://acme.com/dashboard` |
307
- | `resolveAppHref(AppSurface.ADMIN, '')` | `https://acme.com/admin` |
308
- | `isPathForSurface('dashboard')` | `true` |
309
- | `isPathForSurface('admin')` | `true` |
310
-
311
- **Rule of thumb:** for each routable surface, the code checks **`surfaceRoutingMode[surfaceKey]`** first (`'path'` or `'subdomain'`). If that key is **omitted**, it falls back to the global flag **`routingMode === 'path'`**. **`resolveAppHref`** and **`isPathForSurface`** use the same logic.
219
+ How each value is used:
312
220
 
313
- Readable routing API (recommended):
221
+ - `VITE_ONBOARDING_URL`: signup/signin flow redirects (for example `/welcome`, `/resend-activation-email`).
222
+ - `VITE_DASHBOARD_URL`: investor dashboard entry point.
223
+ - `VITE_ADMIN_URL`: admin/venture dashboard entry point.
224
+ - `VITE_REGISTER_URL`: register CTA/entry URL.
225
+ - `VITE_WEBSITE_DOMAIN`: base host used by `getPlatformURL()` and fixed subdomains (analytics/backoffice).
314
226
 
315
- - **`AppSurface`** / **`AppRoute`** — named surfaces and path suffixes (`src/routing/app-routes.js`).
316
- - **`resolveAppHref(surface, path)`** — one function that returns the absolute URL for any surface + suffix.
317
- - **`isPathForSurface(key)`** / **`SURFACE_ROUTING_PATH_KEYS`** — align host code with per-surface path vs subdomain resolution when using **`surfaceRoutingMode`**.
318
- - **`navigateApp(navigate, surface, path)`** / **`navigateToHref(navigate, url)`** — use the `navigate` function from `react-router-dom` when the target is **same-origin** (SPA transition); otherwise they fall back to `location.assign` (e.g. `admin.` / `signup.` subdomains).
319
- - **`RouterWrapper`** — optional root helper: mounts `BrowserRouter` only when the tree is not already under a Router (same-origin SPA navigation without nesting two browser routers).
227
+ Derived helpers:
320
228
 
321
- Legacy helpers (`buildDashboardUrl`, `getAdminAppUrl`, …) remain on **`./utils/app-urls`** for compatibility.
229
+ - `getPlatformURL()` => `https://{VITE_WEBSITE_DOMAIN}` (for example `https://stokr.info`).
230
+ - `getAnalyticsIngestUrl()` => `https://analytics.{VITE_WEBSITE_DOMAIN}`.
231
+ - `getBackofficeAppUrl('/path')` => `https://backoffice.{VITE_WEBSITE_DOMAIN}/path`.
322
232
 
323
233
  **Authentication-only HTTP** — backend routes under `auth/*` (e.g. forgot password) are exposed as **`authenticationApi.post(segment, body)`** from `src/api/authenticationApi.js` (also re-exported from the package entry). The default axios instance is the **general API client** for all authenticated backend calls, not auth-only.
324
234
 
@@ -332,9 +242,13 @@ import { getConfig } from '@stokr/components-library'
332
242
  const api = getConfig('apiUrl')
333
243
  const domain = getConfig('websiteDomain')
334
244
  const firebaseOptions = getConfig('firebase') // override object or env-built fallback
245
+ const onboarding = getConfig('onboardingUrl')
246
+ const dashboard = getConfig('dashboardUrl')
247
+ const admin = getConfig('adminUrl')
248
+ const register = getConfig('registerUrl')
335
249
  ```
336
250
 
337
- Supported keys: `apiUrl`, `baseUrlPublic`, `cookieDomain`, `websiteDomain`, `photoApiUrl`, `routingMode`, `appUrlPaths`, `surfaceRoutingMode`, `firebase`. Resolution order is always **explicit `configure()` / `AuthProvider` `config`** first, then **`import.meta.env`** in the consuming Vite app (where a `VITE_*` mapping exists).
251
+ Supported keys: `apiUrl`, `baseUrlPublic`, `cookieDomain`, `websiteDomain`, `photoApiUrl`, `onboardingUrl`, `dashboardUrl`, `adminUrl`, `registerUrl`, `firebase`. Resolution order is always **explicit `configure()` / `AuthProvider` `config`** first, then **`import.meta.env`** in the consuming Vite app (where a `VITE_*` mapping exists).
338
252
 
339
253
  **Marketing site origin** — the old `platformDomain` / `platformURL` exports were removed. Use **`getPlatformURL()`** for `https://{websiteDomain}`, or **`getConfig('websiteDomain')`** for the bare host (e.g. `"example.com"`). Both read the same runtime config after **`configure()`** / **`AuthProvider`**.
340
254
 
@@ -1,5 +1,4 @@
1
1
  import mixpanel from "mixpanel-browser";
2
- import "../constants/globalVariables.js";
3
2
  import { getAnalyticsIngestUrl } from "../utils/app-urls-analytics-backoffice.js";
4
3
  const BLOCKED_FIELDS = /* @__PURE__ */ new Set([
5
4
  // PII
@@ -8,9 +8,8 @@ import stdin_default$2 from "./EnterCode.js";
8
8
  import background from "../../static/images/background3.png.js";
9
9
  import stdin_default$3 from "./ResetCode.js";
10
10
  import { authenticationApi } from "../../api/authenticationApi.js";
11
- import { AppSurface } from "../../routing/app-routes.js";
12
- import "../../constants/globalVariables.js";
13
- import { navigateApp } from "../../routing/navigate-app.js";
11
+ import { getConfig, getPlatformURL } from "../../runtime-config.js";
12
+ import { navigateToHref } from "../../routing/navigate-app.js";
14
13
  import { useNavigate } from "react-router-dom";
15
14
  const LoginWithOTP = ({ withBackground }) => {
16
15
  const navigate = useNavigate();
@@ -70,10 +69,10 @@ const LoginWithOTP = ({ withBackground }) => {
70
69
  background: withBackground && backgroundProp,
71
70
  isModalOpen: isModalOpen.login,
72
71
  onModalClose: () => {
73
- navigateApp(navigate, AppSurface.INVESTOR_ROOT, "");
72
+ navigateToHref(navigate, getPlatformURL());
74
73
  },
75
74
  onModalSwitch: () => {
76
- navigateApp(navigate, AppSurface.REGISTER, "");
75
+ navigateToHref(navigate, getConfig("registerUrl"));
77
76
  },
78
77
  onForgotPassword: () => {
79
78
  switchOpenModal("login", "forgot");
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
4
4
  import stdin_default$1 from "./FooterMenu.js";
5
5
  import stdin_default$2 from "../Newsletter/Newsletter.js";
6
6
  import stdin_default$3 from "./Footer.js";
7
- import { getPlatformURL } from "../../constants/globalVariables.js";
7
+ import { getPlatformURL } from "../../runtime-config.js";
8
8
  function getFooterGroups() {
9
9
  const platformURL = getPlatformURL();
10
10
  return [
@@ -19,13 +19,11 @@ import { Breakdown } from "../breakdown/Breakdown.js";
19
19
  import { socialSvg } from "../Footer/FooterMenu.js";
20
20
  import { Wrapper, FlexContainer } from "../Grid/Grid.styles.js";
21
21
  import { getFooterGroups } from "../Footer/FooterLayout.js";
22
- import { getPlatformURL } from "../../constants/globalVariables.js";
23
- import { getDashboardBaseUrl, getAdminAppUrl } from "../../utils/app-urls.js";
22
+ import { getPlatformURL, getConfig } from "../../runtime-config.js";
23
+ import { navigateToHref } from "../../routing/navigate-app.js";
24
24
  import { withRouter } from "../../utils/withRouter.js";
25
25
  import { sizes } from "../../styles/rwd.js";
26
26
  import { track } from "../../analytics/index.js";
27
- import { navigateToHref, navigateApp } from "../../routing/navigate-app.js";
28
- import { AppSurface, AppRoute } from "../../routing/app-routes.js";
29
27
  const UserAvatarComponent = ({ avatar }) => {
30
28
  const [photo, setphoto] = useState(avatarPlaceholder);
31
29
  const prevAvatar = usePrevious(avatar);
@@ -93,13 +91,14 @@ function HeaderView({
93
91
  noFixedPosition = false,
94
92
  withoutLoginSignupButton = false
95
93
  }) {
94
+ const platformURL = getPlatformURL();
96
95
  const productMenuItems = useMemo(
97
96
  () => [
98
97
  {
99
98
  name: "End-to-End Tokenization",
100
99
  onClick: () => {
101
100
  track("header_link_clicked", { link: "end-to-end tokenization" });
102
- navigateToHref(navigate, `${getPlatformURL()}/solutions/asset-tokenization`);
101
+ navigateToHref(navigate, `${platformURL}/solutions/asset-tokenization`);
103
102
  },
104
103
  link: "/solutions/asset-tokenization"
105
104
  },
@@ -107,12 +106,12 @@ function HeaderView({
107
106
  name: "Tokenization-as-a-Service",
108
107
  onClick: () => {
109
108
  track("header_link_clicked", { link: "tokenization-as-a-service" });
110
- navigateToHref(navigate, `${getPlatformURL()}/solutions/tokenization-as-service`);
109
+ navigateToHref(navigate, `${platformURL}/solutions/tokenization-as-service`);
111
110
  },
112
111
  link: "/solutions/tokenization-as-service"
113
112
  }
114
113
  ],
115
- [navigate]
114
+ [navigate, platformURL]
116
115
  );
117
116
  const mediaMenuItems = useMemo(
118
117
  () => [
@@ -120,7 +119,7 @@ function HeaderView({
120
119
  name: "Press Releases",
121
120
  onClick: () => {
122
121
  track("header_link_clicked", { link: "press releases" });
123
- navigateToHref(navigate, `${getPlatformURL()}/press-releases`);
122
+ navigateToHref(navigate, `${platformURL}/press-releases`);
124
123
  },
125
124
  link: "/press-releases"
126
125
  },
@@ -128,12 +127,12 @@ function HeaderView({
128
127
  name: "Stoke Post",
129
128
  onClick: () => {
130
129
  track("header_link_clicked", { link: "stoke post" });
131
- navigateToHref(navigate, `${getPlatformURL()}/stoke-post`);
130
+ navigateToHref(navigate, `${platformURL}/stoke-post`);
132
131
  },
133
132
  link: "/stoke-post"
134
133
  }
135
134
  ],
136
- [navigate]
135
+ [navigate, platformURL]
137
136
  );
138
137
  const [currentActiveMenu, setcurrentActiveMenu] = useState(null);
139
138
  const [currentActiveSubMenu, setcurrentActiveSubMenu] = useState(null);
@@ -183,13 +182,13 @@ function HeaderView({
183
182
  const isAdmin = userType === "company_pa" || userType === "company_sa" || userType === "sa";
184
183
  const isVentureDashboard = withSidebar;
185
184
  const socialLinks = getFooterGroups()?.filter((group) => group.social)[0]?.items || [];
186
- const newPlatformUrl = useRelativePathForMenu ? "" : getPlatformURL();
187
- const newPlatformUrlForUserMenu = useRelativePathForUserMenu ? "" : getDashboardBaseUrl();
185
+ const newPlatformUrl = useRelativePathForMenu ? "" : platformURL;
186
+ const newPlatformUrlForUserMenu = useRelativePathForUserMenu ? "" : getConfig("dashboardUrl");
188
187
  return /* @__PURE__ */ jsx(StyledHeader, { noFixedPosition, children: /* @__PURE__ */ jsxs(Wrapper, { flex: withSidebar, children: [
189
188
  withSidebar && /* @__PURE__ */ jsx(SidebarToggle, { isSidebarExpanded, onClick: sidebarHandler, children: /* @__PURE__ */ jsx(HamburgerIcon, {}) }),
190
189
  /* @__PURE__ */ jsxs(HeaderInner, { withSidebar, children: [
191
190
  /* @__PURE__ */ jsxs(MainNavWrap, { hasProgress: progress, children: [
192
- /* @__PURE__ */ jsx(Logo, { isHighlight: currentActiveMenu === "main", children: /* @__PURE__ */ jsx("a", { href: getPlatformURL(), "data-cy": "logo-nav-link", children: /* @__PURE__ */ jsx(stdin_default$1, {}) }) }),
191
+ /* @__PURE__ */ jsx(Logo, { isHighlight: currentActiveMenu === "main", children: /* @__PURE__ */ jsx("a", { href: platformURL, "data-cy": "logo-nav-link", children: /* @__PURE__ */ jsx(stdin_default$1, {}) }) }),
193
192
  !progress && /* @__PURE__ */ jsx(HeaderMainNav, { children: /* @__PURE__ */ jsx(MenuNav, { children: /* @__PURE__ */ jsxs("ul", { children: [
194
193
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
195
194
  "a",
@@ -261,7 +260,7 @@ function HeaderView({
261
260
  LoginButton,
262
261
  {
263
262
  onClick: () => {
264
- isAdmin ? navigateApp(navigate, AppSurface.ADMIN, "") : !newPlatformUrlForUserMenu ? navigate(AppRoute.OVERVIEW) : navigateApp(navigate, AppSurface.DASHBOARD, AppRoute.OVERVIEW);
263
+ isAdmin ? navigateToHref(navigate, getConfig("adminUrl")) : !newPlatformUrlForUserMenu ? navigate("/overview") : navigateToHref(navigate, getConfig("dashboardUrl") + "/overview");
265
264
  },
266
265
  "data-cy": "dashboard-nav-link",
267
266
  children: "Dashboard"
@@ -329,10 +328,10 @@ function HeaderView({
329
328
  !signupFlow && /* @__PURE__ */ jsx(MobileMenuPart, { withPadding: true, flexColumn: true, borderTop: true, children: /* @__PURE__ */ jsx(MenuNav, { mobile: true, children: /* @__PURE__ */ jsx("ul", { children: isAdmin ? /* @__PURE__ */ jsx(Fragment, { children: isVentureDashboard ? /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx("a", { href: "/settings", children: "Settings" }) }) : /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(
330
329
  "a",
331
330
  {
332
- href: getAdminAppUrl(),
331
+ href: getConfig("adminUrl"),
333
332
  onClick: (e) => {
334
333
  e.preventDefault();
335
- navigateApp(navigate, AppSurface.ADMIN, "");
334
+ navigateToHref(navigate, getConfig("adminUrl"));
336
335
  toggleMenu("main");
337
336
  },
338
337
  children: "Dashboard"
@@ -342,13 +341,13 @@ function HeaderView({
342
341
  /* @__PURE__ */ jsx(
343
342
  "a",
344
343
  {
345
- href: newPlatformUrlForUserMenu ? `${newPlatformUrlForUserMenu}${AppRoute.OVERVIEW}` : AppRoute.OVERVIEW,
344
+ href: newPlatformUrlForUserMenu ? `${newPlatformUrlForUserMenu}/overview` : "/overview",
346
345
  onClick: (e) => {
347
346
  e.preventDefault();
348
347
  if (newPlatformUrlForUserMenu) {
349
- navigateApp(navigate, AppSurface.DASHBOARD, AppRoute.OVERVIEW);
348
+ navigateToHref(navigate, getConfig("dashboardUrl") + "/overview");
350
349
  } else {
351
- navigate(AppRoute.OVERVIEW);
350
+ navigate("/overview");
352
351
  }
353
352
  toggleMenu("main");
354
353
  },
@@ -5,9 +5,8 @@ import { Collapse } from "react-collapse";
5
5
  import { StyledMainMenu, MainMenuContainer, MainMenuOptions, MainMenuOption, ExpandArrow, Settings, SettingsOptions, SettingsOption } from "./MainMenu.styles.js";
6
6
  import { Button } from "../Button/Button.styles.js";
7
7
  import { IoniconsStyles } from "../../styles/ioniconsStyles.js";
8
- import { AppSurface, AppRoute } from "../../routing/app-routes.js";
9
- import "../../constants/globalVariables.js";
10
- import { navigateApp } from "../../routing/navigate-app.js";
8
+ import { getConfig } from "../../runtime-config.js";
9
+ import { navigateToHref } from "../../routing/navigate-app.js";
11
10
  import { withRouter } from "../../utils/withRouter.js";
12
11
  class MainMenuClass extends PureComponent {
13
12
  state = {
@@ -84,11 +83,11 @@ class MainMenuClass extends PureComponent {
84
83
  isDashboard: true,
85
84
  onClick: () => {
86
85
  if (isAdmin) {
87
- navigateApp(navigate, AppSurface.ADMIN, "");
86
+ navigateToHref(navigate, getConfig("adminUrl"));
88
87
  } else if (!platformUrlForUserMenu) {
89
- navigate(AppRoute.OVERVIEW);
88
+ navigate("/overview");
90
89
  } else {
91
- navigateApp(navigate, AppSurface.DASHBOARD, AppRoute.OVERVIEW);
90
+ navigateToHref(navigate, `${getConfig("dashboardUrl")}/overview`);
92
91
  }
93
92
  },
94
93
  children: /* @__PURE__ */ jsx("span", { style: spanStyleForMenu, children: "Dashboard" })
@@ -15,8 +15,8 @@ import { Input } from "../../Input/Input.js";
15
15
  import stdin_default$1 from "../../Checkbox/Checkbox.js";
16
16
  import { Button } from "../../Button/Button.styles.js";
17
17
  import { useNewVentureForm } from "../../../hooks/useNewVentureForm.js";
18
- import { AppRoute, AppSurface } from "../../../routing/app-routes.js";
19
- import { navigateApp } from "../../../routing/navigate-app.js";
18
+ import { getConfig } from "../../../runtime-config.js";
19
+ import { navigateToHref } from "../../../routing/navigate-app.js";
20
20
  import { ModalInner } from "../Modal.styles.js";
21
21
  import { FormField, FormError } from "../../Form/Form.styles.js";
22
22
  const defaultProject = {
@@ -99,7 +99,7 @@ const NewVentureModal = (props) => {
99
99
  onSuccessMessageBtnClick();
100
100
  } else {
101
101
  if (user?._id) {
102
- navigateApp(navigate, AppSurface.DASHBOARD, AppRoute.CHECKLIST);
102
+ navigateToHref(navigate, `${getConfig("dashboardUrl")}/checklist`);
103
103
  } else {
104
104
  navigate(`/signup?email=${encodeURIComponent(email)}`);
105
105
  }
@@ -26,9 +26,9 @@ import "../../model/axios.js";
26
26
  import "../Layout/Layout.js";
27
27
  import "../LoginModal/LoginModal.js";
28
28
  import "../ForgotPasswordModal/ForgotPasswordModal.js";
29
- import { emailRegex } from "../../constants/globalVariables.js";
30
29
  import "react-router-dom";
31
30
  import "../2FA/main-flow.js";
31
+ import { emailRegex } from "../../constants/globalVariables.js";
32
32
  const renderSuccessModal = (continueUrl) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
33
33
  stdin_default$1,
34
34
  {
@@ -31,15 +31,15 @@ import "../../model/axios.js";
31
31
  import "../Layout/Layout.js";
32
32
  import stdin_default$3 from "../2FA/ResetCode.js";
33
33
  import { authenticationApi } from "../../api/authenticationApi.js";
34
- import { buildOnboardingUrl } from "../../utils/app-urls.js";
34
+ import { getConfig } from "../../runtime-config.js";
35
+ import { navigateToHref } from "../../routing/navigate-app.js";
36
+ import { getBackofficeAppUrl } from "../../utils/app-urls-analytics-backoffice.js";
35
37
  import "react-router-dom";
36
38
  import "../2FA/main-flow.js";
37
39
  import fetchDataPublic from "../../api/fetchDataPublic.js";
38
40
  import { withRouter } from "../../utils/withRouter.js";
39
41
  import { checkActionCode } from "firebase/auth";
40
42
  import { auth } from "../../firebase-config.js";
41
- import { navigateApp } from "../../routing/navigate-app.js";
42
- import { AppSurface } from "../../routing/app-routes.js";
43
43
  const Outer = styled.div.withConfig({
44
44
  shouldForwardProp: (props) => !["fixed"].includes(props)
45
45
  })`
@@ -654,7 +654,7 @@ const _HeaderHoClass = class _HeaderHoClass extends Component {
654
654
  const query = new URLSearchParams(location?.search);
655
655
  let userType = query.get("user_type");
656
656
  if (userType && userType === "sa") {
657
- navigateApp(this.props.navigate, AppSurface.BACKOFFICE, "");
657
+ navigateToHref(this.props.navigate, getBackofficeAppUrl());
658
658
  } else {
659
659
  this.switchOpenModal("confirmReset", "login");
660
660
  }
@@ -669,7 +669,7 @@ const _HeaderHoClass = class _HeaderHoClass extends Component {
669
669
  popupError: this.state.popupError,
670
670
  popupSuccess: this.state.popupSuccess,
671
671
  isModalOpen: isModalOpen.verifyEmail,
672
- continueUrl: buildOnboardingUrl("/welcome"),
672
+ continueUrl: `${getConfig("onboardingUrl")}/welcome`,
673
673
  error: verifyEmailError,
674
674
  isSuccess: !verifyEmailError,
675
675
  onModalSwitch: () => {
@@ -17,13 +17,13 @@ const LinkIcon = () => /* @__PURE__ */ jsxs(
17
17
  /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
18
18
  "path",
19
19
  {
20
- d: "M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859\r\n c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318\r\n c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6\r\n c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581\r\n c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0\r\n c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0\r\n c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z"
20
+ d: "M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859\n c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318\n c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6\n c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581\n c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0\n c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0\n c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z"
21
21
  }
22
22
  ) }) }),
23
23
  /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
24
24
  "path",
25
25
  {
26
- d: "M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387\r\n c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877\r\n l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768\r\n l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0\r\n c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893\r\n c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365\r\n c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597\r\n c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403\r\n l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z"
26
+ d: "M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387\n c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877\n l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768\n l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0\n c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893\n c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365\n c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597\n c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403\n l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z"
27
27
  }
28
28
  ) }) }),
29
29
  /* @__PURE__ */ jsx("g", {}),
@@ -1,8 +1,3 @@
1
- import { getConfig } from "../runtime-config.js";
2
- function getPlatformURL() {
3
- const domain = getConfig("websiteDomain");
4
- return domain ? `https://${domain}` : "";
5
- }
6
1
  const walletTypes = {
7
2
  LIQUID: "liquid"
8
3
  };
@@ -83,7 +78,6 @@ export {
83
78
  USInvestorAcreditationStatuses,
84
79
  UserTypes,
85
80
  emailRegex,
86
- getPlatformURL,
87
81
  transactionTypeDisplayNames,
88
82
  walletTypes
89
83
  };