@stokr/components-library 3.0.26 → 3.0.28
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 +33 -119
- package/dist/analytics/index.js +0 -1
- package/dist/components/2FA/login-with-otp-flow.js +4 -5
- package/dist/components/Footer/FooterLayout.js +1 -1
- package/dist/components/Header/Header.js +21 -21
- package/dist/components/MainMenu/MainMenu.js +7 -7
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +3 -3
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +1 -1
- package/dist/components/headerHo/HeaderHo.js +5 -5
- package/dist/components/icons/LinkIcon.js +2 -2
- package/dist/config.js +9 -4
- package/dist/constants/globalVariables.js +0 -6
- package/dist/context/AuthContext.js +91 -48
- package/dist/firebase-config.js +5 -4
- package/dist/index.js +3 -21
- package/dist/routing/navigate-app.js +0 -12
- package/dist/runtime-config.js +10 -6
- package/dist/static/country-list.json +251 -251
- package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
- package/dist/static/fonts/icomoon/selection.json +910 -910
- package/dist/static/fonts/icomoon/style.css +139 -139
- package/dist/static/images/copy_icon.svg +4 -4
- package/dist/static/images/download_icon.svg +3 -3
- package/dist/static/images/numbers/number_eight.svg +3 -3
- package/dist/static/images/numbers/number_five.svg +4 -4
- package/dist/static/images/numbers/number_four.svg +3 -3
- package/dist/static/images/numbers/number_nine.svg +4 -4
- package/dist/static/images/numbers/number_one.svg +4 -4
- package/dist/static/images/numbers/number_seven.svg +4 -4
- package/dist/static/images/numbers/number_six.svg +4 -4
- package/dist/static/images/numbers/number_three.svg +3 -3
- package/dist/static/images/numbers/number_two.svg +4 -4
- package/dist/static/images/numbers/number_zero.svg +3 -3
- package/dist/static/images/plus-icon.svg +4 -4
- package/dist/static/images/search-icon.svg +3 -3
- package/dist/static/images/transfer-icon.svg +10 -10
- package/dist/static/images/warning-filled.svg +3 -3
- package/dist/utils/app-urls.js +8 -26
- package/dist/utils/checklistGenerator.js +2 -3
- package/dist/utils/user-identity.js +7 -0
- package/package.json +1 -1
- package/dist/routing/app-routes.js +0 -22
- 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
|
-
- [
|
|
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
|
-
###
|
|
205
|
+
### URL variables and behavior {#url-variables-and-behavior}
|
|
201
206
|
|
|
202
|
-
|
|
207
|
+
The URL model is now explicit: pass full app URLs instead of routing mode/path segment rules.
|
|
203
208
|
|
|
204
|
-
|
|
209
|
+
Expected URL env variables (matching current `.env.local`):
|
|
205
210
|
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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`, `
|
|
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
|
|
package/dist/analytics/index.js
CHANGED
|
@@ -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 {
|
|
12
|
-
import "../../
|
|
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
|
-
|
|
72
|
+
navigateToHref(navigate, getPlatformURL());
|
|
74
73
|
},
|
|
75
74
|
onModalSwitch: () => {
|
|
76
|
-
|
|
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 "../../
|
|
7
|
+
import { getPlatformURL } from "../../runtime-config.js";
|
|
8
8
|
function getFooterGroups() {
|
|
9
9
|
const platformURL = getPlatformURL();
|
|
10
10
|
return [
|
|
@@ -15,17 +15,16 @@ import { SocialLink, ArrowDown } from "../Footer/FooterMenu.styles.js";
|
|
|
15
15
|
import { Collapse } from "react-collapse";
|
|
16
16
|
import { usePrevious, useMobileView } from "../../utils/customHooks.js";
|
|
17
17
|
import { checkTodoStatus } from "../../utils/check-todo-status.js";
|
|
18
|
+
import { hasLoggedInSession } from "../../utils/user-identity.js";
|
|
18
19
|
import { Breakdown } from "../breakdown/Breakdown.js";
|
|
19
20
|
import { socialSvg } from "../Footer/FooterMenu.js";
|
|
20
21
|
import { Wrapper, FlexContainer } from "../Grid/Grid.styles.js";
|
|
21
22
|
import { getFooterGroups } from "../Footer/FooterLayout.js";
|
|
22
|
-
import { getPlatformURL } from "../../
|
|
23
|
-
import {
|
|
23
|
+
import { getPlatformURL, getConfig } from "../../runtime-config.js";
|
|
24
|
+
import { navigateToHref } from "../../routing/navigate-app.js";
|
|
24
25
|
import { withRouter } from "../../utils/withRouter.js";
|
|
25
26
|
import { sizes } from "../../styles/rwd.js";
|
|
26
27
|
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
28
|
const UserAvatarComponent = ({ avatar }) => {
|
|
30
29
|
const [photo, setphoto] = useState(avatarPlaceholder);
|
|
31
30
|
const prevAvatar = usePrevious(avatar);
|
|
@@ -93,13 +92,14 @@ function HeaderView({
|
|
|
93
92
|
noFixedPosition = false,
|
|
94
93
|
withoutLoginSignupButton = false
|
|
95
94
|
}) {
|
|
95
|
+
const platformURL = getPlatformURL();
|
|
96
96
|
const productMenuItems = useMemo(
|
|
97
97
|
() => [
|
|
98
98
|
{
|
|
99
99
|
name: "End-to-End Tokenization",
|
|
100
100
|
onClick: () => {
|
|
101
101
|
track("header_link_clicked", { link: "end-to-end tokenization" });
|
|
102
|
-
navigateToHref(navigate, `${
|
|
102
|
+
navigateToHref(navigate, `${platformURL}/solutions/asset-tokenization`);
|
|
103
103
|
},
|
|
104
104
|
link: "/solutions/asset-tokenization"
|
|
105
105
|
},
|
|
@@ -107,12 +107,12 @@ function HeaderView({
|
|
|
107
107
|
name: "Tokenization-as-a-Service",
|
|
108
108
|
onClick: () => {
|
|
109
109
|
track("header_link_clicked", { link: "tokenization-as-a-service" });
|
|
110
|
-
navigateToHref(navigate, `${
|
|
110
|
+
navigateToHref(navigate, `${platformURL}/solutions/tokenization-as-service`);
|
|
111
111
|
},
|
|
112
112
|
link: "/solutions/tokenization-as-service"
|
|
113
113
|
}
|
|
114
114
|
],
|
|
115
|
-
[navigate]
|
|
115
|
+
[navigate, platformURL]
|
|
116
116
|
);
|
|
117
117
|
const mediaMenuItems = useMemo(
|
|
118
118
|
() => [
|
|
@@ -120,7 +120,7 @@ function HeaderView({
|
|
|
120
120
|
name: "Press Releases",
|
|
121
121
|
onClick: () => {
|
|
122
122
|
track("header_link_clicked", { link: "press releases" });
|
|
123
|
-
navigateToHref(navigate, `${
|
|
123
|
+
navigateToHref(navigate, `${platformURL}/press-releases`);
|
|
124
124
|
},
|
|
125
125
|
link: "/press-releases"
|
|
126
126
|
},
|
|
@@ -128,12 +128,12 @@ function HeaderView({
|
|
|
128
128
|
name: "Stoke Post",
|
|
129
129
|
onClick: () => {
|
|
130
130
|
track("header_link_clicked", { link: "stoke post" });
|
|
131
|
-
navigateToHref(navigate, `${
|
|
131
|
+
navigateToHref(navigate, `${platformURL}/stoke-post`);
|
|
132
132
|
},
|
|
133
133
|
link: "/stoke-post"
|
|
134
134
|
}
|
|
135
135
|
],
|
|
136
|
-
[navigate]
|
|
136
|
+
[navigate, platformURL]
|
|
137
137
|
);
|
|
138
138
|
const [currentActiveMenu, setcurrentActiveMenu] = useState(null);
|
|
139
139
|
const [currentActiveSubMenu, setcurrentActiveSubMenu] = useState(null);
|
|
@@ -183,13 +183,13 @@ function HeaderView({
|
|
|
183
183
|
const isAdmin = userType === "company_pa" || userType === "company_sa" || userType === "sa";
|
|
184
184
|
const isVentureDashboard = withSidebar;
|
|
185
185
|
const socialLinks = getFooterGroups()?.filter((group) => group.social)[0]?.items || [];
|
|
186
|
-
const newPlatformUrl = useRelativePathForMenu ? "" :
|
|
187
|
-
const newPlatformUrlForUserMenu = useRelativePathForUserMenu ? "" :
|
|
186
|
+
const newPlatformUrl = useRelativePathForMenu ? "" : platformURL;
|
|
187
|
+
const newPlatformUrlForUserMenu = useRelativePathForUserMenu ? "" : getConfig("dashboardUrl");
|
|
188
188
|
return /* @__PURE__ */ jsx(StyledHeader, { noFixedPosition, children: /* @__PURE__ */ jsxs(Wrapper, { flex: withSidebar, children: [
|
|
189
189
|
withSidebar && /* @__PURE__ */ jsx(SidebarToggle, { isSidebarExpanded, onClick: sidebarHandler, children: /* @__PURE__ */ jsx(HamburgerIcon, {}) }),
|
|
190
190
|
/* @__PURE__ */ jsxs(HeaderInner, { withSidebar, children: [
|
|
191
191
|
/* @__PURE__ */ jsxs(MainNavWrap, { hasProgress: progress, children: [
|
|
192
|
-
/* @__PURE__ */ jsx(Logo, { isHighlight: currentActiveMenu === "main", children: /* @__PURE__ */ jsx("a", { href:
|
|
192
|
+
/* @__PURE__ */ jsx(Logo, { isHighlight: currentActiveMenu === "main", children: /* @__PURE__ */ jsx("a", { href: platformURL, "data-cy": "logo-nav-link", children: /* @__PURE__ */ jsx(stdin_default$1, {}) }) }),
|
|
193
193
|
!progress && /* @__PURE__ */ jsx(HeaderMainNav, { children: /* @__PURE__ */ jsx(MenuNav, { children: /* @__PURE__ */ jsxs("ul", { children: [
|
|
194
194
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
195
195
|
"a",
|
|
@@ -256,12 +256,12 @@ function HeaderView({
|
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
258
|
isMobile && checkTodoStatus(user) > 0 && !signupFlow && /* @__PURE__ */ jsx(NotificationCounter, { mobile: true, isActive: currentActiveMenu === "main", children: checkTodoStatus(user) }),
|
|
259
|
-
/* @__PURE__ */ jsx(HeaderQuickNav, { isUserLogged: user
|
|
259
|
+
/* @__PURE__ */ jsx(HeaderQuickNav, { isUserLogged: hasLoggedInSession(user), children: /* @__PURE__ */ jsx(Fragment, { children: hasLoggedInSession(user) ? /* @__PURE__ */ jsx(Fragment, { children: signupFlow ? /* @__PURE__ */ jsx(Button, { onClick: logoutUser, children: "Log Out" }) : /* @__PURE__ */ jsxs(FlexContainer, { itemsCenter: true, children: [
|
|
260
260
|
/* @__PURE__ */ jsx(Breakdown, { children: /* @__PURE__ */ jsx(
|
|
261
261
|
LoginButton,
|
|
262
262
|
{
|
|
263
263
|
onClick: () => {
|
|
264
|
-
isAdmin ?
|
|
264
|
+
isAdmin ? navigateToHref(navigate, getConfig("adminUrl")) : !newPlatformUrlForUserMenu ? navigate("/overview") : navigateToHref(navigate, getConfig("dashboardUrl") + "/overview");
|
|
265
265
|
},
|
|
266
266
|
"data-cy": "dashboard-nav-link",
|
|
267
267
|
children: "Dashboard"
|
|
@@ -325,14 +325,14 @@ function HeaderView({
|
|
|
325
325
|
),
|
|
326
326
|
/* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { href: newPlatformUrl + "/team", children: "Team" }) })
|
|
327
327
|
] }) }) }) }),
|
|
328
|
-
user
|
|
328
|
+
hasLoggedInSession(user) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
329
329
|
!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
330
|
"a",
|
|
331
331
|
{
|
|
332
|
-
href:
|
|
332
|
+
href: getConfig("adminUrl"),
|
|
333
333
|
onClick: (e) => {
|
|
334
334
|
e.preventDefault();
|
|
335
|
-
|
|
335
|
+
navigateToHref(navigate, getConfig("adminUrl"));
|
|
336
336
|
toggleMenu("main");
|
|
337
337
|
},
|
|
338
338
|
children: "Dashboard"
|
|
@@ -342,13 +342,13 @@ function HeaderView({
|
|
|
342
342
|
/* @__PURE__ */ jsx(
|
|
343
343
|
"a",
|
|
344
344
|
{
|
|
345
|
-
href: newPlatformUrlForUserMenu ? `${newPlatformUrlForUserMenu}
|
|
345
|
+
href: newPlatformUrlForUserMenu ? `${newPlatformUrlForUserMenu}/overview` : "/overview",
|
|
346
346
|
onClick: (e) => {
|
|
347
347
|
e.preventDefault();
|
|
348
348
|
if (newPlatformUrlForUserMenu) {
|
|
349
|
-
|
|
349
|
+
navigateToHref(navigate, getConfig("dashboardUrl") + "/overview");
|
|
350
350
|
} else {
|
|
351
|
-
navigate(
|
|
351
|
+
navigate("/overview");
|
|
352
352
|
}
|
|
353
353
|
toggleMenu("main");
|
|
354
354
|
},
|
|
@@ -5,10 +5,10 @@ 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 {
|
|
9
|
-
import "../../
|
|
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";
|
|
11
|
+
import { hasLoggedInSession } from "../../utils/user-identity.js";
|
|
12
12
|
class MainMenuClass extends PureComponent {
|
|
13
13
|
state = {
|
|
14
14
|
isSettingsActive: false,
|
|
@@ -61,7 +61,7 @@ class MainMenuClass extends PureComponent {
|
|
|
61
61
|
letterSpacing: "1.5px",
|
|
62
62
|
cursor: "pointer"
|
|
63
63
|
};
|
|
64
|
-
const isUserLogged =
|
|
64
|
+
const isUserLogged = hasLoggedInSession(user);
|
|
65
65
|
return /* @__PURE__ */ jsxs(StyledMainMenu, { children: [
|
|
66
66
|
/* @__PURE__ */ jsx(IoniconsStyles, {}),
|
|
67
67
|
/* @__PURE__ */ jsx(Collapse, { isOpened: isMenuActive && isUserLogged, hasNestedCollapse: true, children: /* @__PURE__ */ jsxs(MainMenuContainer, { children: [
|
|
@@ -84,11 +84,11 @@ class MainMenuClass extends PureComponent {
|
|
|
84
84
|
isDashboard: true,
|
|
85
85
|
onClick: () => {
|
|
86
86
|
if (isAdmin) {
|
|
87
|
-
|
|
87
|
+
navigateToHref(navigate, getConfig("adminUrl"));
|
|
88
88
|
} else if (!platformUrlForUserMenu) {
|
|
89
|
-
navigate(
|
|
89
|
+
navigate("/overview");
|
|
90
90
|
} else {
|
|
91
|
-
|
|
91
|
+
navigateToHref(navigate, `${getConfig("dashboardUrl")}/overview`);
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
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 {
|
|
19
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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\
|
|
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\
|
|
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", {}),
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { initFirebase } from "./firebase-config.js";
|
|
1
|
+
import { isValidFirebaseConfig, initFirebase } from "./firebase-config.js";
|
|
2
2
|
import axiosInstance from "./model/axios.js";
|
|
3
3
|
import axiosInstance$1 from "./model/axiosPublic.js";
|
|
4
4
|
import { assignRuntimeConfig } from "./runtime-config.js";
|
|
@@ -12,9 +12,14 @@ function configure(config = {}) {
|
|
|
12
12
|
if (config.baseUrlPublic != null) {
|
|
13
13
|
axiosInstance$1.defaults.baseURL = config.baseUrlPublic;
|
|
14
14
|
}
|
|
15
|
-
if (config
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(config, "firebase")) {
|
|
16
|
+
const fb = config.firebase;
|
|
17
|
+
if (fb != null && isValidFirebaseConfig(fb)) {
|
|
18
|
+
_lastFirebaseConfig = fb;
|
|
19
|
+
initFirebase(fb);
|
|
20
|
+
} else {
|
|
21
|
+
_lastFirebaseConfig = null;
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
function getLastFirebaseConfig() {
|
|
@@ -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
|
};
|