💄 data-table polish, exam status dots, past/finished status colors
Browse files at this commita001b1b7e2b3c5f33f753aee6ac0a498964fa140Parent: cd3f0a8- style
- 💄 data-table polish, exam status dots, past/finished status colors
3 changed files +21 -8
- src/index.css +10 -6
- src/lib/schedule-status.ts +4 -0
- src/pages/exams-page.tsx +7 -2
src/index.cssmodified+10 -6
| @@ -129,7 +129,7 @@ | ||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | .data-table-wrap { |
| 132 | - @apply max-h-[62vh] overflow-auto rounded-lg border border-border bg-card; | |
| 132 | + @apply max-h-[62vh] overflow-auto rounded-xl border border-border/80 bg-card shadow-sm; | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | .data-table { |
| @@ -137,23 +137,27 @@ | ||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | .data-table thead { |
| 140 | - @apply sticky top-0 z-10 border-b border-border bg-muted/95 text-muted-foreground backdrop-blur; | |
| 140 | + @apply sticky top-0 z-10 border-b border-border bg-muted/80 text-muted-foreground backdrop-blur; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | .data-table th { |
| 144 | - @apply h-8 overflow-hidden text-ellipsis whitespace-nowrap border-r border-border/60 px-3 text-left text-[10px] font-semibold uppercase tracking-[0.11em] last:border-r-0; | |
| 144 | + @apply h-9 overflow-hidden text-ellipsis whitespace-nowrap border-r border-border/50 px-3 text-left text-[10px] font-semibold uppercase tracking-[0.11em] last:border-r-0; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | .data-table td { |
| 148 | - @apply h-10 whitespace-nowrap border-r border-border/40 px-3 py-1.5 align-middle last:border-r-0; | |
| 148 | + @apply h-11 whitespace-nowrap border-r border-border/30 px-3 py-2 align-middle last:border-r-0; | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | .data-table tbody tr { |
| 152 | - @apply border-b border-border/70 transition-colors hover:bg-muted/60; | |
| 152 | + @apply border-b border-border/60 transition-colors hover:bg-primary/[0.045]; | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | .data-table tbody tr:nth-child(even) { |
| 156 | - background-color: hsl(var(--muted) / 0.28); | |
| 156 | + background-color: hsl(var(--muted) / 0.18); | |
| 157 | + } | |
| 158 | + | |
| 159 | + .data-table tbody tr:hover:nth-child(even) { | |
| 160 | + background-color: hsl(var(--primary) / 0.045); | |
| 157 | 161 | } |
| 158 | 162 | |
| 159 | 163 | .detail-breadcrumb { |
src/lib/schedule-status.tsmodified+4 -0
| @@ -15,11 +15,15 @@ export function scheduleStatusClass(status: ScheduleStatus | string): string { | ||
| 15 | 15 | if (status === "today" || status === "upcoming" || status === "soon") { |
| 16 | 16 | return "border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300"; |
| 17 | 17 | } |
| 18 | + if (status === "finished" || status === "past") { | |
| 19 | + return "border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"; | |
| 20 | + } | |
| 18 | 21 | return "border-muted bg-muted/50 text-muted-foreground"; |
| 19 | 22 | } |
| 20 | 23 | |
| 21 | 24 | export function scheduleStatusDotClass(status: ScheduleStatus | string): string { |
| 22 | 25 | if (status === "active") return "bg-emerald-600"; |
| 23 | 26 | if (status === "today" || status === "upcoming" || status === "soon") return "bg-amber-600"; |
| 27 | + if (status === "finished" || status === "past") return "bg-rose-600"; | |
| 24 | 28 | return "bg-muted-foreground"; |
| 25 | 29 | } |
src/pages/exams-page.tsxmodified+7 -2
| @@ -25,7 +25,7 @@ import { examKindLabel } from "@/lib/exam-labels"; | ||
| 25 | 25 | import { createFlash } from "@/lib/flash"; |
| 26 | 26 | import { formatDateTime } from "@/lib/format"; |
| 27 | 27 | import { hasMinRole } from "@/lib/roles"; |
| 28 | -import { scheduleStatusClass } from "@/lib/schedule-status"; | |
| 28 | +import { scheduleStatusClass, scheduleStatusDotClass } from "@/lib/schedule-status"; | |
| 29 | 29 | import { cn } from "@/lib/cn"; |
| 30 | 30 | import { useAuth } from "@/stores/auth-context"; |
| 31 | 31 | import { usePreferences, useT } from "@/stores/preferences-context"; |
| @@ -155,7 +155,12 @@ function ExamsContent() { | ||
| 155 | 155 | meta: { headerClass: "text-center", cellClass: "text-center" }, |
| 156 | 156 | cell: (cell) => { |
| 157 | 157 | const status = examStatus(cell.row.original); |
| 158 | - return <Badge variant="outline" class={cn("w-28 justify-center rounded-sm", scheduleStatusClass(status))}>{statusLabel(status)}</Badge>; | |
| 158 | + return ( | |
| 159 | + <Badge variant="outline" class={cn("w-28 justify-center rounded-sm", scheduleStatusClass(status))}> | |
| 160 | + <span class={cn("mr-1.5 h-1.5 w-1.5 rounded-full", scheduleStatusDotClass(status))} /> | |
| 161 | + {statusLabel(status)} | |
| 162 | + </Badge> | |
| 163 | + ); | |
| 159 | 164 | }, |
| 160 | 165 | }, |
| 161 | 166 | { |