fix: move suspense to the correct place (#1954)

This commit is contained in:
Himself65 2023-04-14 15:44:23 -05:00 committed by GitHub
parent b771a2504b
commit 43a96fe8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -1,4 +1,3 @@
import { ListSkeleton } from '@affine/component';
import type { AffinePublicWorkspace } from '@affine/workspace/type';
import { useAtom } from 'jotai';
import Head from 'next/head';
@ -7,7 +6,6 @@ import type React from 'react';
import { lazy, Suspense } from 'react';
import { openQuickSearchModalAtom } from '../atoms';
import { StyledTableContainer } from '../components/blocksuite/block-suite-page-list/page-list/styles';
import { useRouterTitle } from '../hooks/use-router-title';
import { MainContainer, StyledPage } from './styles';
@ -61,14 +59,6 @@ export const PublicWorkspaceLayout: React.FC<
React.PropsWithChildren
> = props => {
return (
<Suspense
fallback={
<StyledTableContainer>
<ListSkeleton />
</StyledTableContainer>
}
>
<PublicWorkspaceLayoutInner>{props.children}</PublicWorkspaceLayoutInner>
</Suspense>
<PublicWorkspaceLayoutInner>{props.children}</PublicWorkspaceLayoutInner>
);
};

View File

@ -75,7 +75,13 @@ const ListPageInner: React.FC<{
<SearchIcon />
</IconButton>
</NavContainer>
<Suspense>
<Suspense
fallback={
<StyledTableContainer>
<ListSkeleton />
</StyledTableContainer>
}
>
<BlockSuitePublicPageList
onOpenPage={handleClickPage}
blockSuiteWorkspace={blockSuiteWorkspace}