Add route-based code splitting and loading skeletons
- Lazy-load Dashboard, Comparison, Slides via React.lazy + Suspense - Main bundle reduced from 606KB to 256KB - Replace full-screen spinner with skeleton cards during load - Skeleton used for both initial data fetch and route transitions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
src/components/shared/LoadingSkeleton.tsx
Normal file
27
src/components/shared/LoadingSkeleton.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
|
||||
function SkeletonCard({ wide = false }: { wide?: boolean }) {
|
||||
return (
|
||||
<div className={`skeleton-card ${wide ? 'skeleton-card-wide' : ''}`}>
|
||||
<div className="skeleton-line skeleton-line-short" />
|
||||
<div className="skeleton-line skeleton-line-tall" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function LoadingSkeleton() {
|
||||
return (
|
||||
<div className="skeleton-container">
|
||||
<div className="skeleton-stats">
|
||||
<SkeletonCard />
|
||||
<SkeletonCard />
|
||||
<SkeletonCard />
|
||||
<SkeletonCard />
|
||||
</div>
|
||||
<div className="skeleton-charts">
|
||||
<SkeletonCard wide />
|
||||
<SkeletonCard wide />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user