mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
refactor: rename WorkspacePlugin to WorkspaceAdapter (#2330)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import type { AffineWorkspace, LocalWorkspace } from '@affine/workspace/type';
|
||||
import type {
|
||||
AffineLegacyCloudWorkspace,
|
||||
LocalWorkspace,
|
||||
} from '@affine/workspace/type';
|
||||
import { ExportIcon, PublishIcon, ShareIcon } from '@blocksuite/icons';
|
||||
import type { Page } from '@blocksuite/store';
|
||||
import { useBlockSuiteWorkspacePageIsPublic } from '@toeverything/hooks/use-block-suite-workspace-page-is-public';
|
||||
@@ -24,8 +27,8 @@ const tabIcons = {
|
||||
ShareWorkspace: <PublishIcon />,
|
||||
};
|
||||
export type ShareMenuProps<
|
||||
Workspace extends AffineWorkspace | LocalWorkspace =
|
||||
| AffineWorkspace
|
||||
Workspace extends AffineLegacyCloudWorkspace | LocalWorkspace =
|
||||
| AffineLegacyCloudWorkspace
|
||||
| LocalWorkspace
|
||||
> = {
|
||||
workspace: Workspace;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { AffineWorkspace, LocalWorkspace } from '@affine/workspace/type';
|
||||
import type {
|
||||
AffineLegacyCloudWorkspace,
|
||||
LocalWorkspace,
|
||||
} from '@affine/workspace/type';
|
||||
import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||
import type { FC } from 'react';
|
||||
|
||||
@@ -26,7 +29,9 @@ const ShareLocalWorkspace: FC<ShareMenuProps<LocalWorkspace>> = props => {
|
||||
);
|
||||
};
|
||||
|
||||
const ShareAffineWorkspace: FC<ShareMenuProps<AffineWorkspace>> = props => {
|
||||
const ShareAffineWorkspace: FC<
|
||||
ShareMenuProps<AffineLegacyCloudWorkspace>
|
||||
> = props => {
|
||||
const isPublicWorkspace = props.workspace.public;
|
||||
const t = useAFFiNEI18N();
|
||||
return (
|
||||
@@ -55,7 +60,9 @@ export const ShareWorkspace: FC<ShareMenuProps> = props => {
|
||||
);
|
||||
} else if (props.workspace.flavour === WorkspaceFlavour.AFFINE) {
|
||||
return (
|
||||
<ShareAffineWorkspace {...(props as ShareMenuProps<AffineWorkspace>)} />
|
||||
<ShareAffineWorkspace
|
||||
{...(props as ShareMenuProps<AffineLegacyCloudWorkspace>)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
throw new Error('Unreachable');
|
||||
|
||||
Reference in New Issue
Block a user