Browse Source

make layout modules universal

Yuki Takei 1 year ago
parent
commit
9774ae4e1e

+ 20 - 16
apps/app/src/components-universal/Layout/BasicLayout.tsx

@@ -5,7 +5,7 @@ import dynamic from 'next/dynamic';
 import { DndProvider } from 'react-dnd';
 import { HTML5Backend } from 'react-dnd-html5-backend';
 
-import { Sidebar } from '../Sidebar';
+import { Sidebar } from '~/components/Sidebar';
 
 import { RawLayout } from './RawLayout';
 
@@ -15,22 +15,26 @@ import styles from './BasicLayout.module.scss';
 const moduleClass = styles['grw-basic-layout'] ?? '';
 
 
-const AlertSiteUrlUndefined = dynamic(() => import('../AlertSiteUrlUndefined').then(mod => mod.AlertSiteUrlUndefined), { ssr: false });
-const DeleteAttachmentModal = dynamic(() => import('../PageAttachment/DeleteAttachmentModal').then(mod => mod.DeleteAttachmentModal), { ssr: false });
-const HotkeysManager = dynamic(() => import('../Hotkeys/HotkeysManager'), { ssr: false });
-const GrowiNavbarBottom = dynamic(() => import('../Navbar/GrowiNavbarBottom').then(mod => mod.GrowiNavbarBottom), { ssr: false });
-const ShortcutsModal = dynamic(() => import('../ShortcutsModal'), { ssr: false });
-const SystemVersion = dynamic(() => import('../SystemVersion'), { ssr: false });
-const PutbackPageModal = dynamic(() => import('../PutbackPageModal'), { ssr: false });
+const AlertSiteUrlUndefined = dynamic(() => import('~/components/AlertSiteUrlUndefined').then(mod => mod.AlertSiteUrlUndefined), { ssr: false });
+const DeleteAttachmentModal = dynamic(
+  () => import('~/components/PageAttachment/DeleteAttachmentModal').then(mod => mod.DeleteAttachmentModal), { ssr: false },
+);
+const HotkeysManager = dynamic(() => import('~/components/Hotkeys/HotkeysManager'), { ssr: false });
+const GrowiNavbarBottom = dynamic(() => import('~/components/Navbar/GrowiNavbarBottom').then(mod => mod.GrowiNavbarBottom), { ssr: false });
+const ShortcutsModal = dynamic(() => import('~/components/ShortcutsModal'), { ssr: false });
+const SystemVersion = dynamic(() => import('~/components/SystemVersion'), { ssr: false });
+const PutbackPageModal = dynamic(() => import('~/components/PutbackPageModal'), { ssr: false });
 // Page modals
-const PageCreateModal = dynamic(() => import('../PageCreateModal'), { ssr: false });
-const PageDuplicateModal = dynamic(() => import('../PageDuplicateModal'), { ssr: false });
-const PageDeleteModal = dynamic(() => import('../PageDeleteModal'), { ssr: false });
-const PageRenameModal = dynamic(() => import('../PageRenameModal'), { ssr: false });
-const PagePresentationModal = dynamic(() => import('../PagePresentationModal'), { ssr: false });
-const PageAccessoriesModal = dynamic(() => import('../PageAccessoriesModal').then(mod => mod.PageAccessoriesModal), { ssr: false });
-const GrantedGroupsInheritanceSelectModal = dynamic(() => import('../GrantedGroupsInheritanceSelectModal'), { ssr: false });
-const DeleteBookmarkFolderModal = dynamic(() => import('../DeleteBookmarkFolderModal').then(mod => mod.DeleteBookmarkFolderModal), { ssr: false });
+const PageCreateModal = dynamic(() => import('~/components/PageCreateModal'), { ssr: false });
+const PageDuplicateModal = dynamic(() => import('~/components/PageDuplicateModal'), { ssr: false });
+const PageDeleteModal = dynamic(() => import('~/components/PageDeleteModal'), { ssr: false });
+const PageRenameModal = dynamic(() => import('~/components/PageRenameModal'), { ssr: false });
+const PagePresentationModal = dynamic(() => import('~/components/PagePresentationModal'), { ssr: false });
+const PageAccessoriesModal = dynamic(() => import('~/components/PageAccessoriesModal').then(mod => mod.PageAccessoriesModal), { ssr: false });
+const GrantedGroupsInheritanceSelectModal = dynamic(() => import('~/components/GrantedGroupsInheritanceSelectModal'), { ssr: false });
+const DeleteBookmarkFolderModal = dynamic(
+  () => import('~/components/DeleteBookmarkFolderModal').then(mod => mod.DeleteBookmarkFolderModal), { ssr: false },
+);
 const SearchModal = dynamic(() => import('../../features/search/client/components/SearchModal'), { ssr: false });
 
 

+ 4 - 4
apps/app/src/components-universal/Layout/ShareLinkLayout.tsx

@@ -7,10 +7,10 @@ import { useEditorModeClassName } from '../../client/services/layout';
 
 import { RawLayout } from './RawLayout';
 
-const PageCreateModal = dynamic(() => import('../PageCreateModal'), { ssr: false });
-const GrowiNavbarBottom = dynamic(() => import('../Navbar/GrowiNavbarBottom').then(mod => mod.GrowiNavbarBottom), { ssr: false });
-const ShortcutsModal = dynamic(() => import('../ShortcutsModal'), { ssr: false });
-const SystemVersion = dynamic(() => import('../SystemVersion'), { ssr: false });
+const PageCreateModal = dynamic(() => import('~/components/PageCreateModal'), { ssr: false });
+const GrowiNavbarBottom = dynamic(() => import('~/components/Navbar/GrowiNavbarBottom').then(mod => mod.GrowiNavbarBottom), { ssr: false });
+const ShortcutsModal = dynamic(() => import('~/components/ShortcutsModal'), { ssr: false });
+const SystemVersion = dynamic(() => import('~/components/SystemVersion'), { ssr: false });
 
 
 type Props = {

+ 1 - 1
apps/app/src/pages/[[...path]].page.tsx

@@ -21,6 +21,7 @@ import { useRouter } from 'next/router';
 import superjson from 'superjson';
 
 import { useEditorModeClassName } from '~/client/services/layout';
+import { BasicLayout } from '~/components-universal/Layout/BasicLayout';
 import { DrawioViewerScript } from '~/components-universal/Script/DrawioViewerScript';
 import { PageView } from '~/components/Page/PageView';
 import { SupportedAction, type SupportedActionType } from '~/interfaces/activity';
@@ -53,7 +54,6 @@ import { useSetupGlobalSocket, useSetupGlobalSocketForPage } from '~/stores/webs
 import { useCurrentPageYjsData, useSWRMUTxCurrentPageYjsData } from '~/stores/yjs';
 import loggerFactory from '~/utils/logger';
 
-import { BasicLayout } from '../components/Layout/BasicLayout';
 import GrowiContextualSubNavigationSubstance from '../components/Navbar/GrowiContextualSubNavigation';
 import { DisplaySwitcher } from '../components/Page/DisplaySwitcher';
 

+ 1 - 1
apps/app/src/pages/me/[[...path]].page.tsx

@@ -9,7 +9,7 @@ import dynamic from 'next/dynamic';
 import Head from 'next/head';
 import { useRouter } from 'next/router';
 
-import { BasicLayout } from '~/components/Layout/BasicLayout';
+import { BasicLayout } from '~/components-universal/Layout/BasicLayout';
 import { GroundGlassBar } from '~/components/Navbar/GroundGlassBar';
 import type { CrowiRequest } from '~/interfaces/crowi-request';
 import type { RendererConfig } from '~/interfaces/services/renderer';

+ 1 - 1
apps/app/src/pages/share/[[...path]].page.tsx

@@ -8,8 +8,8 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import Head from 'next/head';
 import superjson from 'superjson';
 
+import { ShareLinkLayout } from '~/components-universal/Layout/ShareLinkLayout';
 import { DrawioViewerScript } from '~/components-universal/Script/DrawioViewerScript';
-import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
 import GrowiContextualSubNavigationSubstance from '~/components/Navbar/GrowiContextualSubNavigation';
 import { ShareLinkPageView } from '~/components/ShareLinkPageView';
 import type { SupportedActionType } from '~/interfaces/activity';

+ 1 - 1
apps/app/src/pages/tags.page.tsx

@@ -9,6 +9,7 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
 import Head from 'next/head';
 
+import { BasicLayout } from '~/components-universal/Layout/BasicLayout';
 import { GroundGlassBar } from '~/components/Navbar/GroundGlassBar';
 import type { CrowiRequest } from '~/interfaces/crowi-request';
 import type { RendererConfig } from '~/interfaces/services/renderer';
@@ -17,7 +18,6 @@ import type { IDataTagCount } from '~/interfaces/tag';
 import { useCurrentPageId, useSWRxCurrentPage } from '~/stores/page';
 import { useSWRxTagsList } from '~/stores/tag';
 
-import { BasicLayout } from '../components/Layout/BasicLayout';
 import {
   useCurrentUser, useIsSearchPage,
   useIsSearchServiceConfigured, useIsSearchServiceReachable,

+ 1 - 1
apps/app/src/pages/trash.page.tsx

@@ -7,6 +7,7 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
 import Head from 'next/head';
 
+import { BasicLayout } from '~/components-universal/Layout/BasicLayout';
 import { PagePathNavSticky } from '~/components/Common/PagePathNav';
 import { GroundGlassBar } from '~/components/Navbar/GroundGlassBar';
 import type { CrowiRequest } from '~/interfaces/crowi-request';
@@ -14,7 +15,6 @@ import type { RendererConfig } from '~/interfaces/services/renderer';
 import type { ISidebarConfig } from '~/interfaces/sidebar-config';
 import { useCurrentPageId, useSWRxCurrentPage } from '~/stores/page';
 
-import { BasicLayout } from '../components/Layout/BasicLayout';
 import {
   useCurrentUser, useCurrentPathname, useGrowiCloudUri,
   useIsSearchServiceConfigured, useIsSearchServiceReachable,