Add common loader (#18556)
To avoid white screens on reload, building a shared skeleton. Before https://github.com/user-attachments/assets/42bd0667-141d-4df4-9072-4077192cc71d After https://github.com/user-attachments/assets/e6031a72-2e25-47e3-a873-b89aaddfbd3a
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
import { PageContainer } from '@/ui/layout/page/components/PageContainer';
|
||||
import { type ReactNode, Suspense } from 'react';
|
||||
import { PageContentSkeletonLoader } from '~/loading/components/PageContentSkeletonLoader';
|
||||
|
||||
type LazyRouteProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export const LazyRoute = ({ children }: LazyRouteProps) => (
|
||||
<Suspense fallback={<></>}>{children}</Suspense>
|
||||
const LazyRouteFallback = () => (
|
||||
<PageContainer>
|
||||
<PageContentSkeletonLoader />
|
||||
</PageContainer>
|
||||
);
|
||||
|
||||
export const LazyRoute = ({ children }: LazyRouteProps) => (
|
||||
<Suspense fallback={<LazyRouteFallback />}>{children}</Suspense>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user