💄 tighten dashboard and navigation layout
Browse files at this commitcb8e4ff70d61bc444c0a2f85f69bccb6c61d73e3Parent: 7c6d289- style
- 💄 tighten dashboard and navigation layout
6 changed files +11 -24
- src/components/layout/page-header.tsx +4 -4
- src/components/layout/side-nav.tsx +2 -3
- src/components/notes/note-list.tsx +1 -1
- src/pages/dashboard-page.tsx +0 -4
- src/pages/exams-page.tsx +0 -8
- src/pages/notes-page.tsx +4 -4
src/components/layout/page-header.tsxmodified+4 -4
| @@ -42,17 +42,17 @@ export function PageHeader( | ||
| 42 | 42 | "relative flex flex-col sm:flex-row sm:items-center sm:justify-between", |
| 43 | 43 | props.compact |
| 44 | 44 | ? "gap-3 px-4 py-3 sm:px-5 sm:py-3.5" |
| 45 | - : "gap-4 p-6 sm:items-end sm:p-8", | |
| 45 | + : "gap-3 px-4 py-4 sm:items-end sm:px-5 sm:py-5", | |
| 46 | 46 | )} |
| 47 | 47 | > |
| 48 | - <div class={cn("min-w-0", props.compact ? "space-y-0.5" : "max-w-2xl space-y-1.5")}> | |
| 48 | + <div class={cn("min-w-0", props.compact ? "space-y-0.5" : "max-w-2xl space-y-1")}> | |
| 49 | 49 | <Show when={props.eyebrow && !props.compact}> |
| 50 | 50 | <p class="text-xs font-medium text-muted-foreground">{props.eyebrow}</p> |
| 51 | 51 | </Show> |
| 52 | 52 | <h1 |
| 53 | 53 | class={cn( |
| 54 | 54 | "font-display font-semibold tracking-tight", |
| 55 | - props.compact ? "text-lg sm:text-xl" : "text-2xl sm:text-3xl", | |
| 55 | + props.compact ? "text-lg sm:text-xl" : "text-xl sm:text-2xl", | |
| 56 | 56 | )} |
| 57 | 57 | > |
| 58 | 58 | {props.title} |
| @@ -61,7 +61,7 @@ export function PageHeader( | ||
| 61 | 61 | <p |
| 62 | 62 | class={cn( |
| 63 | 63 | "text-muted-foreground", |
| 64 | - props.compact ? "text-xs sm:text-sm" : "text-sm sm:text-base", | |
| 64 | + props.compact ? "text-xs sm:text-sm" : "text-sm", | |
| 65 | 65 | )} |
| 66 | 66 | > |
| 67 | 67 | {props.description} |
src/components/layout/side-nav.tsxmodified+2 -3
| @@ -26,11 +26,11 @@ type NavItem = { | ||
| 26 | 26 | |
| 27 | 27 | const MAIN_ITEMS: NavItem[] = [ |
| 28 | 28 | { to: "/", labelKey: "nav.home", Icon: IconHome, exact: true }, |
| 29 | - { to: "/notes", labelKey: "nav.notes", Icon: IconNote }, | |
| 30 | - { to: "/events", labelKey: "nav.events", Icon: IconCalendar }, | |
| 31 | 29 | { to: "/courses", labelKey: "nav.courses", Icon: IconBook }, |
| 32 | 30 | { to: "/exams", labelKey: "nav.exams", Icon: IconExam }, |
| 33 | 31 | { to: "/marks", labelKey: "nav.marks", Icon: IconChart }, |
| 32 | + { to: "/notes", labelKey: "nav.notes", Icon: IconNote }, | |
| 33 | + { to: "/events", labelKey: "nav.events", Icon: IconCalendar }, | |
| 34 | 34 | { to: "/admin/users", labelKey: "nav.users", Icon: IconUsers, adminOnly: true }, |
| 35 | 35 | ]; |
| 36 | 36 | |
| @@ -119,7 +119,6 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) | ||
| 119 | 119 | </For> |
| 120 | 120 | </div> |
| 121 | 121 | |
| 122 | - {/* Guide sits just above the sidebar footer */} | |
| 123 | 122 | <div class="mt-auto border-t border-border px-2 pb-1 pt-2"> |
| 124 | 123 | <NavLink item={GUIDE_ITEM} collapsed={props.collapsed} onNavigate={props.onNavigate} /> |
| 125 | 124 | </div> |
src/components/notes/note-list.tsxmodified+1 -1
| @@ -17,7 +17,7 @@ export function NoteList(props: { | ||
| 17 | 17 | </div> |
| 18 | 18 | } |
| 19 | 19 | > |
| 20 | - <ul class="grid gap-4 sm:grid-cols-2 xl:grid-cols-2"> | |
| 20 | + <ul class="grid gap-4 sm:grid-cols-2 xl:grid-cols-3"> | |
| 21 | 21 | <For each={props.notes}> |
| 22 | 22 | {(note) => ( |
| 23 | 23 | <li class="animate-fade-up"> |
src/pages/dashboard-page.tsxmodified+0 -4
| @@ -8,7 +8,6 @@ import { formatApiError } from "@/api/client"; | ||
| 8 | 8 | import type { Event, Exam, Note } from "@/api/types"; |
| 9 | 9 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 10 | 10 | import { PageHeader } from "@/components/layout/page-header"; |
| 11 | -import { RoleHomePanel } from "@/components/dashboard/role-home-panel"; | |
| 12 | 11 | import { Alert } from "@/components/ui/alert"; |
| 13 | 12 | import { Badge } from "@/components/ui/badge"; |
| 14 | 13 | import { Button } from "@/components/ui/button"; |
| @@ -64,7 +63,6 @@ function DashboardContent() { | ||
| 64 | 63 | |
| 65 | 64 | return ( |
| 66 | 65 | <div class="space-y-5"> |
| 67 | - {/* Compact greeting + guide */} | |
| 68 | 66 | <PageHeader |
| 69 | 67 | compact |
| 70 | 68 | accent="mint" |
| @@ -79,8 +77,6 @@ function DashboardContent() { | ||
| 79 | 77 | } |
| 80 | 78 | /> |
| 81 | 79 | |
| 82 | - <RoleHomePanel role={user().role} /> | |
| 83 | - | |
| 84 | 80 | <Show when={resourceError()}> |
| 85 | 81 | {(msg) => <Alert variant="destructive">{msg()}</Alert>} |
| 86 | 82 | </Show> |
src/pages/exams-page.tsxmodified+0 -8
| @@ -8,7 +8,6 @@ import { PageHeader } from "@/components/layout/page-header"; | ||
| 8 | 8 | import { CollapsibleHelp } from "@/components/ui/collapsible-help"; |
| 9 | 9 | import { Alert } from "@/components/ui/alert"; |
| 10 | 10 | import { Badge } from "@/components/ui/badge"; |
| 11 | -import { Button } from "@/components/ui/button"; | |
| 12 | 11 | import { formatApiError } from "@/api/client"; |
| 13 | 12 | import { IconChevronRight } from "@/components/ui/icons"; |
| 14 | 13 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| @@ -66,13 +65,6 @@ function ExamsContent() { | ||
| 66 | 65 | eyebrow={t("nav.exams")} |
| 67 | 66 | title={t("exams.title")} |
| 68 | 67 | description={t("exams.subtitle")} |
| 69 | - actions={ | |
| 70 | - canCreate() ? ( | |
| 71 | - <Link to="/courses"> | |
| 72 | - <Button>{t("courses.addExam")}</Button> | |
| 73 | - </Link> | |
| 74 | - ) : undefined | |
| 75 | - } | |
| 76 | 68 | /> |
| 77 | 69 | |
| 78 | 70 | <CollapsibleHelp title={t("exams.helpTitle")}> |
src/pages/notes-page.tsxmodified+4 -4
| @@ -47,9 +47,9 @@ function NotesContent() { | ||
| 47 | 47 | |
| 48 | 48 | <CollapsibleHelp title={t("notes.helpTitle")}>{t("notes.helpBody")}</CollapsibleHelp> |
| 49 | 49 | |
| 50 | - <div class="grid gap-6 lg:grid-cols-[minmax(0,22rem)_1fr]"> | |
| 51 | - <section class="surface-card h-fit p-5 lg:sticky lg:top-24"> | |
| 52 | - <h2 class="mb-4 font-display text-lg font-semibold">{t("notes.new")}</h2> | |
| 50 | + <div class="space-y-5"> | |
| 51 | + <section class="surface-card p-4 sm:p-5"> | |
| 52 | + <h2 class="mb-3 font-display text-lg font-semibold">{t("notes.new")}</h2> | |
| 53 | 53 | <NoteForm |
| 54 | 54 | submitLabel={t("common.create")} |
| 55 | 55 | onSubmit={(values) => |
| @@ -64,7 +64,7 @@ function NotesContent() { | ||
| 64 | 64 | {error() && <p class="mt-3 text-sm text-destructive">{error()}</p>} |
| 65 | 65 | </section> |
| 66 | 66 | |
| 67 | - <section> | |
| 67 | + <section class="min-w-0"> | |
| 68 | 68 | <Suspense fallback={<PageSpinner />}> |
| 69 | 69 | <Show when={notes.error}> |
| 70 | 70 | <Alert variant="destructive">{formatApiError(notes.error)}</Alert> |