fix: TypeScript error in profile page, improve container styles

This commit is contained in:
fullsizemalt 2025-12-20 21:21:30 -08:00
parent 8fa04e9690
commit f501bd02c8
2 changed files with 17 additions and 14 deletions

View file

@ -116,31 +116,34 @@
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
/* Container constraints for large screens */
.container {
width: 100%;
max-width: 1280px;
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
@layer utilities {
.container {
width: 100% !important;
max-width: 1280px !important;
margin-left: auto !important;
margin-right: auto !important;
padding-left: 1.5rem !important;
padding-right: 1.5rem !important;
}
}
@media (min-width: 640px) {
.container {
padding-left: 2rem;
padding-right: 2rem;
padding-left: 2rem !important;
padding-right: 2rem !important;
}
}
@media (min-width: 1024px) {
.container {
padding-left: 4rem;
padding-right: 4rem;
padding-left: 4rem !important;
padding-right: 4rem !important;
}
}
}

View file

@ -66,8 +66,8 @@ export default function ProfilePage() {
fetch(`${getApiUrl()}/users/${data.id}/stats`, {
headers: { Authorization: `Bearer ${token}` }
})
.then(res => res.ok ? res.json() : {})
.then(data => setStats(data))
.then(res => res.ok ? res.json() : { attendance_count: 0, review_count: 0, group_count: 0 })
.then((statsData: { attendance_count: number; review_count: number; group_count: number }) => setStats(statsData))
})
.catch(err => console.error(err))
.finally(() => setLoading(false))