Add skeleton loading states across all tracking pages
- Replace CircularProgress spinners with content-aware skeleton screens - Add FormSkeleton for form loading states (feeding, sleep, diaper pages) - Add ActivityListSkeleton for recent activities loading - Improves perceived performance with layout-matching placeholders 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
Chip,
|
||||
Snackbar,
|
||||
} from '@mui/material';
|
||||
import { FormSkeleton, ActivityListSkeleton } from '@/components/common/LoadingSkeletons';
|
||||
import {
|
||||
ArrowBack,
|
||||
Refresh,
|
||||
@@ -320,8 +321,17 @@ export default function SleepTrackPage() {
|
||||
return (
|
||||
<ProtectedRoute>
|
||||
<AppShell>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', py: 8 }}>
|
||||
<CircularProgress />
|
||||
<Box>
|
||||
<Typography variant="h4" fontWeight="600" sx={{ mb: 3 }}>
|
||||
Track Sleep
|
||||
</Typography>
|
||||
<Paper sx={{ p: 3, mb: 3 }}>
|
||||
<FormSkeleton />
|
||||
</Paper>
|
||||
<Typography variant="h6" fontWeight="600" sx={{ mb: 2 }}>
|
||||
Recent Sleep Activities
|
||||
</Typography>
|
||||
<ActivityListSkeleton count={3} />
|
||||
</Box>
|
||||
</AppShell>
|
||||
</ProtectedRoute>
|
||||
@@ -536,9 +546,7 @@ export default function SleepTrackPage() {
|
||||
</Box>
|
||||
|
||||
{sleepsLoading ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', py: 4 }}>
|
||||
<CircularProgress size={30} />
|
||||
</Box>
|
||||
<ActivityListSkeleton count={3} />
|
||||
) : recentSleeps.length === 0 ? (
|
||||
<Box sx={{ textAlign: 'center', py: 4 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
|
||||
Reference in New Issue
Block a user