📐 let detail pages use the full width and drop the holidays card
Browse files at this commitb05b03b49f5977d22804e96010548c807718357fParent: 881f809- fix
- 📐 let detail pages use the full width and drop the holidays card
12 changed files +17 -12
- src/components/ui/chart-line.tsx +3 -1
- src/pages/admin-user-detail-page.tsx +1 -1
- src/pages/bank-question-detail-page.tsx +1 -1
- src/pages/class-detail-page.tsx +1 -1
- src/pages/course-detail-page.tsx +1 -1
- src/pages/dashboard-page.tsx +4 -1
- src/pages/exam-detail-page.tsx +1 -1
- src/pages/holidays-page.tsx +1 -1
- src/pages/homework-detail-page.tsx +1 -1
- src/pages/instance-detail-page.tsx +1 -1
- src/pages/question-detail-page.tsx +1 -1
- src/pages/question-generation-page.tsx +1 -1
src/components/ui/chart-line.tsxmodified+3 -1
| @@ -118,9 +118,11 @@ export const ChartLine: Component<ChartLineProps> = (props) => { | ||
| 118 | 118 | </div> |
| 119 | 119 | </dl> |
| 120 | 120 | |
| 121 | + {/* The floor only keeps axis text legible on a phone: at 640px it | |
| 122 | + forced a sideways scroller into the card on a 1280px screen. */} | |
| 121 | 123 | <div class="overflow-x-auto pb-1"> |
| 122 | 124 | <svg |
| 123 | - class="h-60 min-w-[640px] w-full" | |
| 125 | + class="h-60 min-w-[480px] w-full" | |
| 124 | 126 | viewBox={`0 0 ${VIEW_WIDTH} ${VIEW_HEIGHT}`} |
| 125 | 127 | role="img" |
| 126 | 128 | aria-label={props.items.map((item) => `${item.label}${item.caption ? ` (${item.caption})` : ""}: ${item.formattedValue ?? item.value}`).join(", ")} |
src/pages/admin-user-detail-page.tsxmodified+1 -1
| @@ -63,7 +63,7 @@ function AdminUserDetailContent() { | ||
| 63 | 63 | } |
| 64 | 64 | > |
| 65 | 65 | {(current) => ( |
| 66 | - <div class="mx-auto w-full max-w-[1100px] space-y-5"> | |
| 66 | + <div class="w-full space-y-5"> | |
| 67 | 67 | <Show when={error()}> |
| 68 | 68 | <Alert variant="destructive">{error()}</Alert> |
| 69 | 69 | </Show> |
src/pages/bank-question-detail-page.tsxmodified+1 -1
| @@ -97,7 +97,7 @@ function BankQuestionDetailContent() { | ||
| 97 | 97 | } |
| 98 | 98 | > |
| 99 | 99 | {(current) => ( |
| 100 | - <div class="mx-auto w-full max-w-[1100px] space-y-6"> | |
| 100 | + <div class="w-full space-y-6"> | |
| 101 | 101 | <Show when={error()}> |
| 102 | 102 | <Alert variant="destructive">{error()}</Alert> |
| 103 | 103 | </Show> |
src/pages/class-detail-page.tsxmodified+1 -1
| @@ -283,7 +283,7 @@ function ClassDetailContent() { | ||
| 283 | 283 | } |
| 284 | 284 | > |
| 285 | 285 | {(c) => ( |
| 286 | - <div class="mx-auto w-full max-w-[1440px] space-y-4"> | |
| 286 | + <div class="w-full space-y-4"> | |
| 287 | 287 | <section class="rounded-xl border border-border-line bg-surface-base px-4 py-3 shadow-xs sm:px-5"> |
| 288 | 288 | <Breadcrumbs items={[{ label: t("classGroups.title"), to: "/management/classes" }, { label: c().name }]} /> |
| 289 | 289 | <PageHeader |
src/pages/course-detail-page.tsxmodified+1 -1
| @@ -264,7 +264,7 @@ function CourseDetailContent() { | ||
| 264 | 264 | {(c) => ( |
| 265 | 265 | <Show when={accessReady()} fallback={<PageSpinner />}> |
| 266 | 266 | <Show when={canViewCourse()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> |
| 267 | - <div class="mx-auto w-full max-w-[1440px] space-y-4"> | |
| 267 | + <div class="w-full space-y-4"> | |
| 268 | 268 | <section class="rounded-xl border border-border-line bg-surface-base px-4 py-3 shadow-xs sm:px-5"> |
| 269 | 269 | <Breadcrumbs |
| 270 | 270 | items={[ |
src/pages/dashboard-page.tsxmodified+4 -1
| @@ -848,7 +848,7 @@ function DashboardContent() { | ||
| 848 | 848 | (this week's pomodoro minutes), so it gets the rail slot the |
| 849 | 849 | design reserves for that kind of card. */} |
| 850 | 850 | <div class="grid grid-cols-1 gap-3 lg:grid-cols-4"> |
| 851 | - <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-3 lg:grid-cols-3"> | |
| 851 | + <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-3"> | |
| 852 | 852 | <Show when={on("marks")}> |
| 853 | 853 | <ChartBar |
| 854 | 854 | title={t("dashboard.progressOverview")} |
| @@ -858,6 +858,7 @@ function DashboardContent() { | ||
| 858 | 858 | itemsPerPage={5} |
| 859 | 859 | /> |
| 860 | 860 | <ChartLine |
| 861 | + class="sm:order-first sm:col-span-2" | |
| 861 | 862 | title={t("dashboard.successTrend")} |
| 862 | 863 | subtitle={t("dashboard.successTrendMine")} |
| 863 | 864 | items={myMarkTrend()} |
| @@ -927,12 +928,14 @@ function DashboardContent() { | ||
| 927 | 928 | <Show when={on("exams")}> |
| 928 | 929 | <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-2"> |
| 929 | 930 | <ChartLine |
| 931 | + class="sm:col-span-2" | |
| 930 | 932 | title={t("dashboard.successTrend")} |
| 931 | 933 | subtitle={t("dashboard.successTrendSchool")} |
| 932 | 934 | items={examAverageTrend()} |
| 933 | 935 | maxScale={100} |
| 934 | 936 | /> |
| 935 | 937 | <ChartBar |
| 938 | + class="sm:col-span-2" | |
| 936 | 939 | title={t("dashboard.courseAverages")} |
| 937 | 940 | subtitle={t("dashboard.courseAveragesSchool")} |
| 938 | 941 | items={courseAverageBars()} |
src/pages/exam-detail-page.tsxmodified+1 -1
| @@ -401,7 +401,7 @@ function ExamDetailContent() { | ||
| 401 | 401 | {(ex) => ( |
| 402 | 402 | <Show when={accessReady()} fallback={<PageSpinner />}> |
| 403 | 403 | <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> |
| 404 | - <div class="mx-auto w-full max-w-[1100px] space-y-5"> | |
| 404 | + <div class="w-full space-y-5"> | |
| 405 | 405 | <section class="data-shell space-y-2 p-4 sm:p-5"> |
| 406 | 406 | <Breadcrumbs items={[{ label: t("exams.title"), to: "/exams" }, { label: ex().title }]} /> |
| 407 | 407 | <PageHeader |
src/pages/holidays-page.tsxmodified+1 -1
| @@ -148,7 +148,7 @@ function HolidaysContent() { | ||
| 148 | 148 | <Show when={flash()}><Alert variant="success">{flash()}</Alert></Show> |
| 149 | 149 | <Show when={error() && !panelOpen()}><Alert variant="destructive">{error()}</Alert></Show> |
| 150 | 150 | |
| 151 | - <section class="data-shell space-y-4 p-0"> | |
| 151 | + <section class="space-y-4"> | |
| 152 | 152 | <Suspense fallback={<DataTableSkeleton columns={5} rows={6} />}> |
| 153 | 153 | <Show when={list.error}> |
| 154 | 154 | <ErrorAlert message={formatApiError(list.error)} onRetry={() => void refetch()} /> |
src/pages/homework-detail-page.tsxmodified+1 -1
| @@ -63,7 +63,7 @@ export default function HomeworkDetailPage() { | ||
| 63 | 63 | fallback={<Show when={homework.error} fallback={<PageSpinner />}><Alert variant="destructive">{formatApiError(homework.error, locale())}</Alert></Show>} |
| 64 | 64 | > |
| 65 | 65 | {(item) => ( |
| 66 | - <div class="mx-auto w-full max-w-[1100px] space-y-5"> | |
| 66 | + <div class="w-full space-y-5"> | |
| 67 | 67 | <section class="data-shell space-y-2 p-4 sm:p-5"> |
| 68 | 68 | <Breadcrumbs items={[{ label: t("homework.title"), to: "/homework" }, { label: item().title }]} /> |
| 69 | 69 | <PageHeader title={item().title} description={item().description || undefined} /> |
src/pages/instance-detail-page.tsxmodified+1 -1
| @@ -334,7 +334,7 @@ function InstanceDetailContent() { | ||
| 334 | 334 | } |
| 335 | 335 | > |
| 336 | 336 | {(inst) => ( |
| 337 | - <div class="mx-auto w-full max-w-[1440px] space-y-4"> | |
| 337 | + <div class="w-full space-y-4"> | |
| 338 | 338 | <div class="space-y-1.5"> |
| 339 | 339 | <Breadcrumbs |
| 340 | 340 | items={[ |
src/pages/question-detail-page.tsxmodified+1 -1
| @@ -114,7 +114,7 @@ function QuestionDetailContent() { | ||
| 114 | 114 | }; |
| 115 | 115 | |
| 116 | 116 | return ( |
| 117 | - <div class="space-y-6 max-w-4xl mx-auto"> | |
| 117 | + <div class="w-full space-y-6"> | |
| 118 | 118 | <Suspense fallback={<PageSpinner />}> |
| 119 | 119 | <Show when={question()}> |
| 120 | 120 | {(q) => ( |
src/pages/question-generation-page.tsxmodified+1 -1
| @@ -103,7 +103,7 @@ function QuestionGenerationContent() { | ||
| 103 | 103 | }; |
| 104 | 104 | |
| 105 | 105 | return ( |
| 106 | - <div class="mx-auto w-full max-w-[1100px] space-y-5"> | |
| 106 | + <div class="w-full space-y-5"> | |
| 107 | 107 | <section class="data-shell p-4 sm:p-5"> |
| 108 | 108 | <PageHeader title={t("nav.questionGeneration")} description={t("qgen.subtitle")} /> |
| 109 | 109 | </section> |