feat(component): improve fallback skeleton (#2323)

This commit is contained in:
Himself65
2023-05-11 13:35:42 +08:00
committed by himself65
parent f8e184a6c0
commit 9902892615
12 changed files with 130 additions and 60 deletions
+2 -4
View File
@@ -84,9 +84,7 @@ function AuthContext({ children }: PropsWithChildren): ReactElement {
}
}, [login]);
if (!login) {
return (
<PageLoading text="No login, redirecting to local workspace page..." />
);
return <PageLoading />;
}
return <>{children}</>;
}
@@ -278,7 +276,7 @@ export const AffinePlugin: WorkspacePlugin<WorkspaceFlavour.AFFINE> = {
UI: {
Provider: ({ children }) => {
return (
<Suspense fallback={<PageLoading text="Checking login status..." />}>
<Suspense fallback={<PageLoading />}>
<AuthContext>{children}</AuthContext>
</Suspense>
);