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

View file

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