mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor: rename WorkspacePlugin to WorkspaceAdapter (#2330)
This commit is contained in:
@@ -23,7 +23,7 @@ import { useSyncRecentViewsWithRouter } from '../../../hooks/use-recent-views';
|
||||
import { useRouterAndWorkspaceWithPageIdDefense } from '../../../hooks/use-router-and-workspace-with-page-id-defense';
|
||||
import { useRouterHelper } from '../../../hooks/use-router-helper';
|
||||
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
|
||||
import { WorkspacePlugins } from '../../../plugins';
|
||||
import { WorkspaceAdapters } from '../../../plugins';
|
||||
import type { BlockSuiteWorkspace, NextPageWithLayout } from '../../../shared';
|
||||
|
||||
function setEditorFlags(blockSuiteWorkspace: BlockSuiteWorkspace) {
|
||||
@@ -85,7 +85,8 @@ const WorkspaceDetail: React.FC = () => {
|
||||
}
|
||||
}, [currentWorkspace]);
|
||||
if (currentWorkspace.flavour === WorkspaceFlavour.AFFINE) {
|
||||
const PageDetail = WorkspacePlugins[currentWorkspace.flavour].UI.PageDetail;
|
||||
const PageDetail =
|
||||
WorkspaceAdapters[currentWorkspace.flavour].UI.PageDetail;
|
||||
return (
|
||||
<PageDetail
|
||||
currentWorkspace={currentWorkspace}
|
||||
@@ -93,7 +94,8 @@ const WorkspaceDetail: React.FC = () => {
|
||||
/>
|
||||
);
|
||||
} else if (currentWorkspace.flavour === WorkspaceFlavour.LOCAL) {
|
||||
const PageDetail = WorkspacePlugins[currentWorkspace.flavour].UI.PageDetail;
|
||||
const PageDetail =
|
||||
WorkspaceAdapters[currentWorkspace.flavour].UI.PageDetail;
|
||||
return (
|
||||
<PageDetail
|
||||
currentWorkspace={currentWorkspace}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspac
|
||||
import { useRouterHelper } from '../../../hooks/use-router-helper';
|
||||
import { useSyncRouterWithCurrentWorkspaceId } from '../../../hooks/use-sync-router-with-current-workspace-id';
|
||||
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
|
||||
import { WorkspacePlugins } from '../../../plugins';
|
||||
import { WorkspaceAdapters } from '../../../plugins';
|
||||
import type { NextPageWithLayout } from '../../../shared';
|
||||
|
||||
const AllPage: NextPageWithLayout = () => {
|
||||
@@ -43,7 +43,7 @@ const AllPage: NextPageWithLayout = () => {
|
||||
throw new QueryParamError('workspaceId', router.query.workspaceId);
|
||||
}
|
||||
if (currentWorkspace.flavour === WorkspaceFlavour.AFFINE) {
|
||||
const PageList = WorkspacePlugins[currentWorkspace.flavour].UI.PageList;
|
||||
const PageList = WorkspaceAdapters[currentWorkspace.flavour].UI.PageList;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -65,7 +65,7 @@ const AllPage: NextPageWithLayout = () => {
|
||||
</>
|
||||
);
|
||||
} else if (currentWorkspace.flavour === WorkspaceFlavour.LOCAL) {
|
||||
const PageList = WorkspacePlugins[currentWorkspace.flavour].UI.PageList;
|
||||
const PageList = WorkspaceAdapters[currentWorkspace.flavour].UI.PageList;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useOnTransformWorkspace } from '../../../hooks/root/use-on-transform-wo
|
||||
import { useSyncRouterWithCurrentWorkspaceId } from '../../../hooks/use-sync-router-with-current-workspace-id';
|
||||
import { useAppHelper } from '../../../hooks/use-workspaces';
|
||||
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
|
||||
import { WorkspacePlugins } from '../../../plugins';
|
||||
import { WorkspaceAdapters } from '../../../plugins';
|
||||
import type { NextPageWithLayout } from '../../../shared';
|
||||
import { toast } from '../../../utils';
|
||||
|
||||
@@ -116,7 +116,7 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
return <PageLoading />;
|
||||
} else if (currentWorkspace.flavour === WorkspaceFlavour.AFFINE) {
|
||||
const Setting =
|
||||
WorkspacePlugins[currentWorkspace.flavour].UI.SettingsDetail;
|
||||
WorkspaceAdapters[currentWorkspace.flavour].UI.SettingsDetail;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -142,7 +142,7 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
);
|
||||
} else if (currentWorkspace.flavour === WorkspaceFlavour.LOCAL) {
|
||||
const Setting =
|
||||
WorkspacePlugins[currentWorkspace.flavour].UI.SettingsDetail;
|
||||
WorkspaceAdapters[currentWorkspace.flavour].UI.SettingsDetail;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
||||
Reference in New Issue
Block a user