diff --git a/packages/client/src/Client.jsx b/packages/client/src/Client.jsx
index fca4c8eff2..b4dd246e87 100644
--- a/packages/client/src/Client.jsx
+++ b/packages/client/src/Client.jsx
@@ -191,7 +191,7 @@ const ClientContent = (props) => {
);
};
-const Client = inject(
+export const Client = inject(
({
authStore,
clientLoadingStore,
@@ -262,5 +262,3 @@ const Client = inject(
};
},
)(withTranslation("Common")(observer(ClientContent)));
-
-export default () => ;
diff --git a/packages/client/src/components/Error520Wrapper/index.tsx b/packages/client/src/components/Error520Wrapper/index.tsx
index e8616ab957..cb791fb744 100644
--- a/packages/client/src/components/Error520Wrapper/index.tsx
+++ b/packages/client/src/components/Error520Wrapper/index.tsx
@@ -33,17 +33,19 @@ const Error520Wrapper = (props: Error520Props) => {
return ;
};
-export default inject(({ authStore, settingsStore, userStore }) => {
- const { firebaseHelper, currentDeviceType, currentColorScheme } =
- settingsStore;
- const { user } = userStore;
- const version = authStore.version;
+export const Error520Component = inject(
+ ({ authStore, settingsStore, userStore }) => {
+ const { firebaseHelper, currentDeviceType, currentColorScheme } =
+ settingsStore;
+ const { user } = userStore;
+ const version = authStore.version;
- return {
- user,
- version,
- firebaseHelper,
- currentDeviceType,
- currentColorScheme,
- };
-})(observer(Error520Wrapper));
+ return {
+ user,
+ version,
+ firebaseHelper,
+ currentDeviceType,
+ currentColorScheme,
+ };
+ },
+)(observer(Error520Wrapper));
diff --git a/packages/client/src/components/ErrorUnavailableWrapper/index.tsx b/packages/client/src/components/ErrorUnavailableWrapper/index.tsx
index bb2f976005..7a0cf8958f 100644
--- a/packages/client/src/components/ErrorUnavailableWrapper/index.tsx
+++ b/packages/client/src/components/ErrorUnavailableWrapper/index.tsx
@@ -33,7 +33,7 @@ const ErrorUnavailableWrapper = (props: ErrorUnavailableProps) => {
return ;
};
-export default inject(({ settingsStore }) => {
+export const Component = inject(({ settingsStore }) => {
const { whiteLabelLogoUrls } = settingsStore;
return {
diff --git a/packages/client/src/components/System/index.js b/packages/client/src/components/System/index.js
index 0a47cc4ca3..a34333a9bf 100644
--- a/packages/client/src/components/System/index.js
+++ b/packages/client/src/components/System/index.js
@@ -29,7 +29,7 @@ import AppLoader from "@docspace/common/components/AppLoader";
import Error404 from "@docspace/shared/components/errors/Error404";
import ErrorBoundary from "../ErrorBoundaryWrapper";
-import Error520 from "../Error520Wrapper";
+import { Error520Component } from "../Error520Wrapper";
function loadComponent(scope, module) {
return async () => {
@@ -115,7 +115,7 @@ const System = (props) => {
if (failed) {
console.log(`Failed to load dynamic script: ${props.system.url}`);
- return ;
+ return ;
}
const Component = React.lazy(
diff --git a/packages/client/src/components/dialogs/PreparationPortalDialog/index.js b/packages/client/src/components/dialogs/PreparationPortalDialog/index.js
index 01b38af475..be64109899 100644
--- a/packages/client/src/components/dialogs/PreparationPortalDialog/index.js
+++ b/packages/client/src/components/dialogs/PreparationPortalDialog/index.js
@@ -28,7 +28,7 @@ import React from "react";
import { ModalDialog } from "@docspace/shared/components/modal-dialog";
import { withTranslation } from "react-i18next";
import { inject, observer } from "mobx-react";
-import PreparationPortal from "@docspace/shared/pages/PreparationPortal";
+import { PreparationPortal } from "@docspace/shared/pages/PreparationPortal";
import StyledPreparationPortalDialog from "./StyledPreparationPortalDialog";
import { PRODUCT_NAME } from "@docspace/shared/constants";
diff --git a/packages/client/src/pages/About/index.js b/packages/client/src/pages/About/index.js
index 95a94d924d..116d6eb8f6 100644
--- a/packages/client/src/pages/About/index.js
+++ b/packages/client/src/pages/About/index.js
@@ -49,7 +49,7 @@ const BodyWrapper = inject(({ settingsStore }) => {
};
})(withTranslation(["About", "Common"])(observer(Body)));
-const About = (props) => {
+export const About = (props) => {
return (
@@ -61,5 +61,3 @@ const About = (props) => {
);
};
-
-export default About;
diff --git a/packages/client/src/pages/FormGallery/index.js b/packages/client/src/pages/FormGallery/index.js
index 6c658a991d..bdbc23f156 100644
--- a/packages/client/src/pages/FormGallery/index.js
+++ b/packages/client/src/pages/FormGallery/index.js
@@ -127,7 +127,7 @@ const FormGallery = ({
);
};
-export default inject(({ oformsStore }) => ({
+export const WrappedComponent = inject(({ oformsStore }) => ({
oformsLoadError: oformsStore.oformsLoadError,
currentCategory: oformsStore.currentCategory,
diff --git a/packages/client/src/pages/Home/Section/SettingsBody/index.js b/packages/client/src/pages/Home/Section/SettingsBody/index.js
index cbd5c3c4f2..733ee7d45f 100644
--- a/packages/client/src/pages/Home/Section/SettingsBody/index.js
+++ b/packages/client/src/pages/Home/Section/SettingsBody/index.js
@@ -28,7 +28,7 @@ import React, { useCallback } from "react";
import { useTranslation } from "react-i18next";
import styled, { css } from "styled-components";
-import Error520 from "../../../../components/Error520Wrapper";
+import { Error520Component } from "../../../../components/Error520Wrapper";
import { inject, observer } from "mobx-react";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
import config from "PACKAGE_FILE";
@@ -87,7 +87,7 @@ const SectionBodyContent = ({ isErrorSettings, user }) => {
//const showAdminSettings = user.isAdmin || user.isOwner;
return isErrorSettings ? (
-
+
) : (
{
+export const AccountsView = () => {
return (
{(context) => (
@@ -40,5 +40,3 @@ const AccountsView = () => {
);
};
-
-export default AccountsView;
diff --git a/packages/client/src/pages/Home/View/Files.js b/packages/client/src/pages/Home/View/Files.js
index 07b3240d3b..84278a564a 100644
--- a/packages/client/src/pages/Home/View/Files.js
+++ b/packages/client/src/pages/Home/View/Files.js
@@ -29,7 +29,7 @@ import { Consumer } from "@docspace/shared/utils";
import { SectionBodyContent } from "../Section";
-const FilesView = () => {
+export const FilesView = () => {
return (
{(context) => (
@@ -42,5 +42,3 @@ const FilesView = () => {
);
};
-
-export default FilesView;
diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js
index ffea1f5615..252693483f 100644
--- a/packages/client/src/pages/Home/index.js
+++ b/packages/client/src/pages/Home/index.js
@@ -422,7 +422,7 @@ const PureHome = (props) => {
const Home = withTranslation(["Files", "People"])(PureHome);
-export default inject(
+export const Component = inject(
({
authStore,
filesStore,
diff --git a/packages/client/src/pages/PortalUnavailable/index.js b/packages/client/src/pages/PortalUnavailable/index.js
index 721736b801..1bb6946f3e 100644
--- a/packages/client/src/pages/PortalUnavailable/index.js
+++ b/packages/client/src/pages/PortalUnavailable/index.js
@@ -123,7 +123,7 @@ const PortalUnavailable = ({ onLogoutClick }) => {
);
};
-export default inject(({ profileActionsStore }) => {
+export const Component = inject(({ profileActionsStore }) => {
const { onLogoutClick } = profileActionsStore;
return { onLogoutClick };
diff --git a/packages/client/src/pages/PublicPreview/PublicPreview.tsx b/packages/client/src/pages/PublicPreview/PublicPreview.tsx
index 3aac95eb4a..1ff1ed36ed 100644
--- a/packages/client/src/pages/PublicPreview/PublicPreview.tsx
+++ b/packages/client/src/pages/PublicPreview/PublicPreview.tsx
@@ -8,7 +8,7 @@ import { UrlActionType } from "@docspace/shared/enums";
import { toastr } from "@docspace/shared/components/toast";
import MediaViewer from "@docspace/shared/components/media-viewer/MediaViewer";
import { ViewerLoader } from "@docspace/shared/components/media-viewer/sub-components/ViewerLoader";
-import Error403 from "@docspace/shared/components/errors/Error403";
+import { Error403 } from "@docspace/shared/components/errors/Error403";
import type { TFile } from "@docspace/shared/api/files/types";
import type {
@@ -132,9 +132,12 @@ const PublicPreview = ({
);
};
-export default inject(({ filesSettingsStore, settingsStore }) => {
- const { getFilesSettings, getIcon, extsImagePreviewed } = filesSettingsStore;
- const { openUrl } = settingsStore;
+export const WrappedComponent = inject(
+ ({ filesSettingsStore, settingsStore }) => {
+ const { getFilesSettings, getIcon, extsImagePreviewed } =
+ filesSettingsStore;
+ const { openUrl } = settingsStore;
- return { getFilesSettings, getIcon, openUrl, extsImagePreviewed };
-})(observer(PublicPreview));
+ return { getFilesSettings, getIcon, openUrl, extsImagePreviewed };
+ },
+)(observer(PublicPreview));
diff --git a/packages/client/src/pages/PublicRoom/index.js b/packages/client/src/pages/PublicRoom/index.js
index a62d372f29..7516ebc47c 100644
--- a/packages/client/src/pages/PublicRoom/index.js
+++ b/packages/client/src/pages/PublicRoom/index.js
@@ -127,7 +127,7 @@ const PublicRoom = (props) => {
);
};
-export default inject(
+export const WrappedComponent = inject(
({
settingsStore,
publicRoomStore,
diff --git a/packages/client/src/pages/Sdk/index.js b/packages/client/src/pages/Sdk/index.js
index aace4bd817..f440e439b8 100644
--- a/packages/client/src/pages/Sdk/index.js
+++ b/packages/client/src/pages/Sdk/index.js
@@ -307,7 +307,7 @@ const Sdk = ({
return component;
};
-export default inject(
+export const Component = inject(
({
authStore,
settingsStore,
diff --git a/packages/client/src/pages/Wizard/index.js b/packages/client/src/pages/Wizard/index.js
index 801f581dd5..a659d22432 100644
--- a/packages/client/src/pages/Wizard/index.js
+++ b/packages/client/src/pages/Wizard/index.js
@@ -525,54 +525,56 @@ const Wizard = (props) => {
);
};
-export default inject(({ authStore, settingsStore, wizardStore }) => {
- const {
- passwordSettings,
- wizardToken,
- timezone,
- urlLicense,
- hashSettings,
- setWizardComplete,
- getPortalTimezones,
- getPortalPasswordSettings,
- theme,
- } = settingsStore;
+export const WrappedComponent = inject(
+ ({ authStore, settingsStore, wizardStore }) => {
+ const {
+ passwordSettings,
+ wizardToken,
+ timezone,
+ urlLicense,
+ hashSettings,
+ setWizardComplete,
+ getPortalTimezones,
+ getPortalPasswordSettings,
+ theme,
+ } = settingsStore;
- const { language } = authStore;
- const {
- isWizardLoaded,
- machineName,
- isLicenseRequired,
- licenseUpload,
- setIsWizardLoaded,
- getMachineName,
- getIsRequiredLicense,
+ const { language } = authStore;
+ const {
+ isWizardLoaded,
+ machineName,
+ isLicenseRequired,
+ licenseUpload,
+ setIsWizardLoaded,
+ getMachineName,
+ getIsRequiredLicense,
- setLicense,
- resetLicenseUploaded,
- } = wizardStore;
+ setLicense,
+ resetLicenseUploaded,
+ } = wizardStore;
- return {
- theme,
- isLoaded: authStore.isLoaded,
- culture: language,
- wizardToken,
- passwordSettings,
- timezone,
- urlLicense,
- hashSettings,
- isWizardLoaded,
- machineName,
- isLicenseRequired,
- licenseUpload,
- setWizardComplete,
- getPortalPasswordSettings,
- getPortalTimezones,
- setIsWizardLoaded,
- getMachineName,
- getIsRequiredLicense,
+ return {
+ theme,
+ isLoaded: authStore.isLoaded,
+ culture: language,
+ wizardToken,
+ passwordSettings,
+ timezone,
+ urlLicense,
+ hashSettings,
+ isWizardLoaded,
+ machineName,
+ isLicenseRequired,
+ licenseUpload,
+ setWizardComplete,
+ getPortalPasswordSettings,
+ getPortalTimezones,
+ setIsWizardLoaded,
+ getMachineName,
+ getIsRequiredLicense,
- setLicense,
- resetLicenseUploaded,
- };
-})(withCultureNames(observer(Wizard)));
+ setLicense,
+ resetLicenseUploaded,
+ };
+ },
+)(withCultureNames(observer(Wizard)));
diff --git a/packages/client/src/routes/client.js b/packages/client/src/routes/client.js
index c57849412d..205f179da5 100644
--- a/packages/client/src/routes/client.js
+++ b/packages/client/src/routes/client.js
@@ -34,78 +34,38 @@ import Error404 from "@docspace/shared/components/errors/Error404";
import componentLoader from "@docspace/shared/utils/component-loader";
import ErrorBoundary from "../components/ErrorBoundaryWrapper";
-import FilesView from "SRC_DIR/pages/Home/View/Files";
-import AccountsView from "SRC_DIR/pages/Home/View/Accounts";
-import SettingsView from "SRC_DIR/pages/Home/View/Settings";
-const PublicPreview = loadable(() =>
- componentLoader(() => import("../pages/PublicPreview/PublicPreview")),
-);
-
import { generalRoutes } from "./general";
-const Client = loadable(() => componentLoader(() => import("../Client")));
-
-const Home = loadable(() => componentLoader(() => import("../pages/Home")));
-
-const Sdk = loadable(() => componentLoader(() => import("../pages/Sdk")));
-
-const FormGallery = loadable(() =>
- componentLoader(() => import("../pages/FormGallery")),
-);
const PublicRoom = loadable(() =>
componentLoader(() => import("../pages/PublicRoom")),
);
-const About = loadable(() => componentLoader(() => import("../pages/About")));
const Wizard = loadable(() => componentLoader(() => import("../pages/Wizard")));
-const PreparationPortal = loadable(() =>
- componentLoader(() => import("@docspace/shared/pages/PreparationPortal")),
-);
-const PortalUnavailable = loadable(() =>
- componentLoader(() => import("../pages/PortalUnavailable")),
-);
-const ErrorUnavailable = loadable(() =>
- componentLoader(() => import("../components/ErrorUnavailableWrapper")),
-);
-
-const Error401 = loadable(() =>
- componentLoader(() => import("@docspace/shared/components/errors/Error401")),
-);
-
-const Error403 = loadable(() =>
- componentLoader(() => import("@docspace/shared/components/errors/Error403")),
-);
-
-const Error520 = loadable(() =>
- componentLoader(() => import("../components/Error520Wrapper")),
-);
-
-const ErrorAccessRestricted = loadable(() =>
- componentLoader(
- () => import("@docspace/shared/components/errors/AccessRestricted"),
- ),
-);
-
-const ErrorOffline = loadable(() =>
- componentLoader(
- () => import("@docspace/shared/components/errors/ErrorOffline"),
- ),
-);
const ClientRoutes = [
{
path: "/",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Client } = await import("SRC_DIR/Client");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
errorElement: ,
children: [
{
path: "/",
- element: ,
+ async lazy() {
+ const { Component } = await import("SRC_DIR/pages/Home");
+
+ return { Component };
+ },
children: [
{
index: true,
@@ -133,107 +93,237 @@ const ClientRoutes = [
},
{
path: "rooms/personal",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/personal/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "files/trash",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "files/trash/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/shared",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/shared/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/shared/:room",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/shared/:room/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/archived",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/archived/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/archived/:room",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "rooms/archived/:room/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "media/view/:id",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import(
+ "SRC_DIR/pages/Home/View/Files"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "accounts",
@@ -273,11 +363,21 @@ const ClientRoutes = [
},
{
path: "accounts/people/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { AccountsView } = await import(
+ "SRC_DIR/pages/Home/View/Accounts"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "accounts/groups",
@@ -289,11 +389,21 @@ const ClientRoutes = [
},
{
path: "accounts/groups/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { AccountsView } = await import(
+ "SRC_DIR/pages/Home/View/Accounts"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "accounts/groups/:groupId",
@@ -305,36 +415,22 @@ const ClientRoutes = [
},
{
path: "accounts/groups/:groupId/filter",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { AccountsView } = await import(
+ "SRC_DIR/pages/Home/View/Accounts"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
- /*{
- path: "settings",
- element: (
-
-
-
- ),
- },
- {
- path: "settings/personal",
- element: (
-
-
-
- ),
- },
- {
- path: "settings/general",
- element: (
-
-
-
- ),
- },*/
],
},
{
@@ -355,186 +451,322 @@ const ClientRoutes = [
},
{
path: "/form-gallery",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import("SRC_DIR/pages/FormGallery");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/form-gallery/:fromFolderId",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import("SRC_DIR/pages/FormGallery");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/form-gallery/:fromFolderId/filter",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import("SRC_DIR/pages/FormGallery");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/share/preview/:id",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import(
+ "SRC_DIR/pages/PublicPreview/PublicPreview"
+ );
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/rooms/share",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import("SRC_DIR/pages/PublicRoom");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
errorElement: ,
children: [
{
index: true,
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import("SRC_DIR/pages/Home/View/Files");
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "media/view/:id",
- element: (
-
-
-
- ),
+ async lazy() {
+ const { FilesView } = await import("SRC_DIR/pages/Home/View/Files");
+
+ const Component = () => {
+ return (
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
],
},
{
path: "/wizard",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { WrappedComponent } = await import("SRC_DIR/pages/Wizard");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/sdk/:mode",
- element: ,
+ lazy: () => import("SRC_DIR/pages/Sdk"),
},
{
path: "/about",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { About } = await import("SRC_DIR/pages/About");
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/portal-unavailable",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Component } = await import("SRC_DIR/pages/PortalUnavailable");
+
+ const WrappedComponent = () => (
+
+
+
+
+
+ );
+
+ return { Component: WrappedComponent };
+ },
},
{
path: "/unavailable",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Component } = await import(
+ "SRC_DIR/components/ErrorUnavailableWrapper"
+ );
+
+ const WrappedComponent = () => (
+
+
+
+
+
+ );
+
+ return { Component: WrappedComponent };
+ },
},
{
path: "/access-restricted",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { AccessRestricted } = await import(
+ "@docspace/shared/components/errors/AccessRestricted"
+ );
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/preparation-portal",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { PreparationPortal } = await import(
+ "@docspace/shared/pages/PreparationPortal"
+ );
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/error/401",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Error401 } = await import(
+ "@docspace/shared/components/errors/Error401"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "/error/403",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Error403 } = await import(
+ "@docspace/shared/components/errors/Error403"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "/error/520",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { Error520Component } = await import(
+ "SRC_DIR/components/Error520Wrapper"
+ );
+
+ const Component = () => {
+ return (
+
+
+
+
+
+ );
+ };
+
+ return { Component };
+ },
},
{
path: "/error/access/restricted",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { AccessRestricted } = await import(
+ "@docspace/shared/components/errors/AccessRestricted"
+ );
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
{
path: "/error/offline",
- element: (
-
-
-
-
-
- ),
+ async lazy() {
+ const { ErrorOfflineContainer } = await import(
+ "@docspace/shared/components/errors/ErrorOffline"
+ );
+
+ const Component = () => (
+
+
+
+
+
+ );
+
+ return { Component };
+ },
},
];
diff --git a/packages/management/src/App.tsx b/packages/management/src/App.tsx
index dedebe9254..0818b50e32 100644
--- a/packages/management/src/App.tsx
+++ b/packages/management/src/App.tsx
@@ -33,7 +33,7 @@ import { ThemeKeys } from "@docspace/shared/enums";
import { Toast } from "@docspace/shared/components/toast";
import { Portal } from "@docspace/shared/components/portal";
import AppLoader from "@docspace/shared/components/app-loader";
-import Error403 from "@docspace/shared/components/errors/Error403";
+import { Error403 } from "@docspace/shared/components/errors/Error403";
import tryRedirectTo from "@docspace/shared/utils/tryRedirectTo";
diff --git a/packages/management/src/router.tsx b/packages/management/src/router.tsx
index 2b34b66b31..2eb295b260 100644
--- a/packages/management/src/router.tsx
+++ b/packages/management/src/router.tsx
@@ -41,7 +41,7 @@ import Bonus from "./categories/bonus";
import ErrorBoundary from "./components/ErrorBoundaryWrapper";
import Error404 from "@docspace/shared/components/errors/Error404";
-import PreparationPortal from "@docspace/shared/pages/PreparationPortal";
+import { PreparationPortal } from "@docspace/shared/pages/PreparationPortal";
const routes = [
{
diff --git a/packages/shared/components/errors/AccessRestricted.tsx b/packages/shared/components/errors/AccessRestricted.tsx
index 5ef89807f9..6d0ef17593 100644
--- a/packages/shared/components/errors/AccessRestricted.tsx
+++ b/packages/shared/components/errors/AccessRestricted.tsx
@@ -31,7 +31,7 @@ import ErrorContainer from "../error-container/ErrorContainer";
import { AccessRestrictedWrapper } from "./Errors.styled";
import { PRODUCT_NAME } from "../../constants";
-const AccessRestricted = () => {
+export const AccessRestricted = () => {
const { t, ready } = useTranslation("Common");
useEffect(() => {
@@ -49,5 +49,3 @@ const AccessRestricted = () => {
)
);
};
-
-export default AccessRestricted;
diff --git a/packages/shared/components/errors/Error401.tsx b/packages/shared/components/errors/Error401.tsx
index a759a102b3..58a0d49c48 100644
--- a/packages/shared/components/errors/Error401.tsx
+++ b/packages/shared/components/errors/Error401.tsx
@@ -27,10 +27,8 @@
import { useTranslation } from "react-i18next";
import ErrorContainer from "../error-container/ErrorContainer";
-const Error401 = () => {
+export const Error401 = () => {
const { t } = useTranslation("Common");
return ;
};
-
-export default Error401;
diff --git a/packages/shared/components/errors/Error403.tsx b/packages/shared/components/errors/Error403.tsx
index 63993279d6..08a3535a8b 100644
--- a/packages/shared/components/errors/Error403.tsx
+++ b/packages/shared/components/errors/Error403.tsx
@@ -29,10 +29,8 @@ import { useTranslation } from "react-i18next";
import ErrorContainer from "../error-container/ErrorContainer";
-const Error403 = () => {
+export const Error403 = () => {
const { t } = useTranslation("Common");
return ;
};
-
-export default Error403;
diff --git a/packages/shared/components/errors/ErrorOffline.tsx b/packages/shared/components/errors/ErrorOffline.tsx
index 7f4b387f59..ea7e829f8e 100644
--- a/packages/shared/components/errors/ErrorOffline.tsx
+++ b/packages/shared/components/errors/ErrorOffline.tsx
@@ -29,10 +29,8 @@ import { useTranslation } from "react-i18next";
import ErrorContainer from "../error-container/ErrorContainer";
-const ErrorOfflineContainer = () => {
+export const ErrorOfflineContainer = () => {
const { t } = useTranslation("Common");
return ;
};
-
-export default ErrorOfflineContainer;
diff --git a/packages/shared/pages/PreparationPortal/index.tsx b/packages/shared/pages/PreparationPortal/index.tsx
index 580cbf6cd5..a916cc6d1a 100644
--- a/packages/shared/pages/PreparationPortal/index.tsx
+++ b/packages/shared/pages/PreparationPortal/index.tsx
@@ -46,7 +46,7 @@ const secondBound = 63;
let timerId: ReturnType | null;
let progressTimerId: ReturnType | null;
-const PreparationPortal = (props: IPreparationPortal) => {
+export const PreparationPortal = (props: IPreparationPortal) => {
const { withoutHeader, style, isDialog } = props;
const { t } = useTranslation(["PreparationPortal", "Common"]);
@@ -127,5 +127,3 @@ const PreparationPortal = (props: IPreparationPortal) => {
);
};
-
-export default PreparationPortal;