diff --git a/packages/client/src/pages/Profile/index.js b/packages/client/src/pages/Profile/index.js index 49c8015fba..a5c9d69d52 100644 --- a/packages/client/src/pages/Profile/index.js +++ b/packages/client/src/pages/Profile/index.js @@ -25,17 +25,20 @@ // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode import React from "react"; +import { useLocation } from "react-router-dom"; import PropTypes from "prop-types"; -import Section from "@docspace/shared/components/section"; -import SectionWrapper from "SRC_DIR/components/Section"; -import { SectionHeaderContent, SectionBodyContent } from "./Section"; - -import Dialogs from "../Home/Section/AccountsBody/Dialogs"; - -import withCultureNames from "SRC_DIR/HOCs/withCultureNames"; import { inject, observer } from "mobx-react"; import { withTranslation } from "react-i18next"; +import Section from "@docspace/shared/components/section"; + +import SectionWrapper from "SRC_DIR/components/Section"; +import PrivateRoute from "SRC_DIR/components/PrivateRouteWrapper"; +import Dialogs from "SRC_DIR/pages/Home/Section/AccountsBody/Dialogs"; +import withCultureNames from "SRC_DIR/HOCs/withCultureNames"; + +import { SectionHeaderContent, SectionBodyContent } from "./Section"; + class Profile extends React.Component { componentDidMount() { const { @@ -137,7 +140,7 @@ Profile.propTypes = { language: PropTypes.string, }; -export default inject( +const ComponentPure = inject( ({ authStore, settingsStore, @@ -194,3 +197,17 @@ export default inject( }; }, )(observer(withTranslation(["Profile", "Common"])(withCultureNames(Profile)))); + +export const Component = () => { + const location = useLocation(); + + const fileManagement = location.pathname.includes("file-management"); + + return ( + + + + ); +}; + +Component.displayName = "Profile"; diff --git a/packages/client/src/routes/general.js b/packages/client/src/routes/general.js index 946291ab4c..d35a8f711d 100644 --- a/packages/client/src/routes/general.js +++ b/packages/client/src/routes/general.js @@ -24,16 +24,7 @@ // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -import React from "react"; import { Navigate } from "react-router-dom"; -import loadable from "@loadable/component"; - -import PrivateRoute from "../components/PrivateRouteWrapper"; -import componentLoader from "@docspace/shared/utils/component-loader"; - -const Profile = loadable(() => - componentLoader(() => import("../pages/Profile")), -); const generalRoutes = [ { @@ -51,35 +42,19 @@ const generalRoutes = [ }, { path: "login", - element: ( - - - - ), + lazy: () => import("../pages/Profile"), }, { path: "notifications", - element: ( - - - - ), + lazy: () => import("../pages/Profile"), }, { path: "file-management", - element: ( - - - - ), + lazy: () => import("../pages/Profile"), }, { path: "interface-theme", - element: ( - - - - ), + lazy: () => import("../pages/Profile"), }, ], }, diff --git a/packages/client/src/routes/index.js b/packages/client/src/routes/index.js index 3a1f402997..4aabc7b2af 100644 --- a/packages/client/src/routes/index.js +++ b/packages/client/src/routes/index.js @@ -27,7 +27,13 @@ import PortalSettingsRoutes from "./portalSettings"; import ClientRoutes from "./client"; import ConfirmRoutes from "./confirm"; +import { generalRoutes } from "./general"; -const routes = [...ClientRoutes, PortalSettingsRoutes, ...ConfirmRoutes]; +const routes = [ + ...ClientRoutes, + PortalSettingsRoutes, + ...ConfirmRoutes, + // ...generalRoutes, +]; export default routes; diff --git a/packages/client/src/routes/portalSettings.js b/packages/client/src/routes/portalSettings.js index 6ec84d734d..4ca9b602fb 100644 --- a/packages/client/src/routes/portalSettings.js +++ b/packages/client/src/routes/portalSettings.js @@ -37,7 +37,6 @@ import ErrorBoundary from "../components/ErrorBoundaryWrapper"; import { generalRoutes } from "./general"; import SettingsContainer from "../pages/PortalSettings/categories/integration/LDAP/sub-components/SettingsContainer"; import SyncContainer from "../pages/PortalSettings/categories/integration/LDAP/sub-components/SyncContainer"; -import StyledLdapPage from "../pages/PortalSettings/categories/integration/LDAP/styled-components/StyledLdapPage"; const PortalSettings = loadable(() => componentLoader(() => import("../pages/PortalSettings")),