forge
Explore
Log in

Don't you dare go Hollow

🧹 use shared PageHeader for the page header

Browse files at this commit

85410a9ed6b95a3fc07c51d2a2dfc1b3d42b8401Burak BoduroğluParent: 9f5a8a8
  • refactor
    • 🧹 use shared PageHeader for the page header
Show full message
refactor(marks): 🧹 use shared PageHeader for the page header

replace the bespoke <header> icon-chip block with <PageHeader>, matching
the 18 other pages; tab-dependent subtitle passed as description
src/pages/marks-page.tsxmodified+5 -13
@@ -6,6 +6,7 @@ import { Alert } from "@/components/ui/alert";
6 import { AttendanceReportView } from "@/components/attendance/attendance-report-view";6 import { AttendanceReportView } from "@/components/attendance/attendance-report-view";
7 import { MarksReportView } from "@/components/marks/marks-report-view";7 import { MarksReportView } from "@/components/marks/marks-report-view";
8 import { RouteGuard } from "@/components/layout/route-guard";8 import { RouteGuard } from "@/components/layout/route-guard";
9+import { PageHeader } from "@/components/layout/page-header";
9 import { EmptyState } from "@/components/ui/empty-state";10 import { EmptyState } from "@/components/ui/empty-state";
10 import { IconChart, IconClipboardCheck } from "@/components/ui/icons";11 import { IconChart, IconClipboardCheck } from "@/components/ui/icons";
11 import { PageSpinner } from "@/components/ui/page-spinner";12 import { PageSpinner } from "@/components/ui/page-spinner";
@@ -31,19 +32,10 @@ function MarksContent() {
31 32
32 return (33 return (
33 <div class="space-y-5">34 <div class="space-y-5">
34- <header class="flex items-center gap-3 border-b border-border pb-5">35+ <PageHeader
35- <span class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">36+ title={t("marks.title")}
36- <Show when={tab() === "marks"} fallback={<IconClipboardCheck class="h-5 w-5" />}>37+ description={tab() === "marks" ? t("marks.subtitle") : t("attendance.subtitle")}
37- <IconChart class="h-5 w-5" />38+ />
38- </Show>
39- </span>
40- <div class="min-w-0">
41- <h1 class="font-display text-2xl font-semibold tracking-tight">{t("marks.title")}</h1>
42- <p class="mt-0.5 text-sm text-muted-foreground">
43- {tab() === "marks" ? t("marks.subtitle") : t("attendance.subtitle")}
44- </p>
45- </div>
46- </header>
47 39
48 <Tabs40 <Tabs
49 class="space-y-4"41 class="space-y-4"