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:
Thomas Trompette
2026-03-11 14:56:49 +01:00
committed by GitHub
parent 2c5af2654d
commit b346f4fb59
6 changed files with 87 additions and 95 deletions
@@ -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>
);