feat(ui): 适配手机端布局与触控交互
窄屏改用抽屉导航和卡片列表,加大触控区域并处理安全区,避免表格横向溢出。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,8 +14,8 @@ export function Table({
|
||||
return (
|
||||
<div className="w-full overflow-x-auto">
|
||||
<table
|
||||
className={cn(
|
||||
"w-full text-sm",
|
||||
className={cn(
|
||||
"w-full min-w-max text-sm",
|
||||
bordered &&
|
||||
"border border-[var(--color-border)] [&_tr]:divide-x [&_tr]:divide-[var(--color-border)]",
|
||||
striped && "[&_tbody_tr:nth-child(even)]:bg-[var(--color-muted)]/50",
|
||||
@@ -46,9 +46,9 @@ export function TR({ className, ...props }: React.HTMLAttributes<HTMLTableRowEle
|
||||
}
|
||||
|
||||
export function TH({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>) {
|
||||
return <th className={cn("px-4 py-3 font-medium", className)} {...props} />;
|
||||
return <th className={cn("px-3 py-2.5 font-medium md:px-4 md:py-3", className)} {...props} />;
|
||||
}
|
||||
|
||||
export function TD({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>) {
|
||||
return <td className={cn("px-4 py-3 align-middle", className)} {...props} />;
|
||||
return <td className={cn("px-3 py-2.5 align-middle md:px-4 md:py-3", className)} {...props} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user