chore: remove unused code (#3102)

This commit is contained in:
Alex Yang
2023-07-08 14:49:11 +08:00
committed by GitHub
parent c4d53d59b5
commit da140b0b85
10 changed files with 1 additions and 1621 deletions

View File

@@ -1,24 +0,0 @@
import { AffineLoading } from '@affine/component/affine-loading';
import type { StoryFn } from '@storybook/react';
export default {
title: 'AFFiNE/Loading',
component: AffineLoading,
};
export const Default: StoryFn = ({ width, loop, autoplay, autoReverse }) => (
<div
style={{
width: width,
height: width,
}}
>
<AffineLoading loop={loop} autoplay={autoplay} autoReverse={autoReverse} />
</div>
);
Default.args = {
width: 100,
loop: true,
autoplay: true,
autoReverse: true,
};

View File

@@ -1,6 +1,5 @@
import { Empty } from '@affine/component';
import { toast } from '@affine/component';
import { AffineLoading } from '@affine/component/affine-loading';
import type { OperationCellProps } from '@affine/component/page-list';
import { PageListTrashView } from '@affine/component/page-list';
import { PageList } from '@affine/component/page-list';
@@ -13,7 +12,7 @@ import { userEvent } from '@storybook/testing-library';
export default {
title: 'AFFiNE/PageList',
component: AffineLoading,
component: PageList,
};
export const AffineOperationCell: StoryFn<OperationCellProps> = ({

View File

@@ -1,3 +0,0 @@
import { Loading } from './page-loading';
export * from './page-loading';
export default Loading;

View File

@@ -1,24 +0,0 @@
import { AffineLoading } from '@affine/component/affine-loading';
import { memo, Suspense } from 'react';
export const Loading = memo(function Loading() {
return (
<div
style={{
height: '180px',
width: '180px',
}}
>
<Suspense>
<AffineLoading loop={true} autoplay={true} autoReverse={true} />
</Suspense>
</div>
);
});
/**
* @deprecated use skeleton instead
*/
export const PageLoading = () => {
return null;
};

View File

@@ -8,7 +8,6 @@ import { useRouter } from 'next/router';
import React, { useCallback } from 'react';
import { getUIAdapter } from '../../../adapters/workspace';
import { PageLoading } from '../../../components/pure/loading';
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
import { useRouterHelper } from '../../../hooks/use-router-helper';
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
@@ -31,9 +30,6 @@ const AllPage: NextPageWithLayout = () => {
},
[currentWorkspace, jumpToPage]
);
if (!router.isReady) {
return <PageLoading />;
}
if (typeof router.query.workspaceId !== 'string') {
throw new QueryParamError('workspaceId', router.query.workspaceId);
}

View File

@@ -7,7 +7,6 @@ import React, { useCallback } from 'react';
import { getUIAdapter } from '../../../adapters/workspace';
import { BlockSuitePageList } from '../../../components/blocksuite/block-suite-page-list';
import { PageLoading } from '../../../components/pure/loading';
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
import { useRouterHelper } from '../../../hooks/use-router-helper';
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
@@ -28,9 +27,6 @@ const SharedPages: NextPageWithLayout = () => {
},
[currentWorkspace, jumpToPage]
);
if (currentWorkspace === null) {
return <PageLoading />;
}
const blockSuiteWorkspace = currentWorkspace.blockSuiteWorkspace;
assertExists(blockSuiteWorkspace);
const { Header } = getUIAdapter(currentWorkspace.flavour);

View File

@@ -7,7 +7,6 @@ import React, { useCallback } from 'react';
import { getUIAdapter } from '../../../adapters/workspace';
import { BlockSuitePageList } from '../../../components/blocksuite/block-suite-page-list';
import { PageLoading } from '../../../components/pure/loading';
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
import { useRouterHelper } from '../../../hooks/use-router-helper';
import { WorkspaceLayout } from '../../../layouts/workspace-layout';
@@ -31,9 +30,6 @@ const TrashPage: NextPageWithLayout = () => {
},
[currentWorkspace, jumpToPage]
);
if (!router.isReady || currentWorkspace === null) {
return <PageLoading />;
}
// todo(himself65): refactor to plugin
const blockSuiteWorkspace = currentWorkspace.blockSuiteWorkspace;
assertExists(blockSuiteWorkspace);