feat: add preloading template (#2655)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
Flrande
2023-06-07 17:31:54 +08:00
committed by GitHub
parent c4c4ec6a67
commit 35fb10c95b
67 changed files with 6761 additions and 287 deletions
+2 -8
View File
@@ -1,5 +1,4 @@
import { AppContainer, MainContainer } from '@affine/component/workspace';
import { initPage } from '@affine/env/blocksuite';
import { useRouter } from 'next/router';
import { lazy, Suspense } from 'react';
@@ -16,17 +15,12 @@ const InitPagePage: NextPageWithLayout = () => {
if (!router.isReady) {
return <>loading...</>;
}
let testType: 'empty' | 'importMarkdown' = 'empty';
if (router.query.type === 'importMarkdown') {
testType = 'importMarkdown';
} else if (router.query.type === 'empty') {
testType = 'empty';
}
return (
<AppContainer>
<MainContainer>
<Suspense>
<Editor onInit={initPage} testType={testType} />
<Editor />
</Suspense>
<div id="toolWrapper" />
</MainContainer>