Skip to content

Commit ea78827

Browse files
committed
Polish task card tag and action layout
1 parent 8456641 commit ea78827

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

src/components/task-row.tsx

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ function ActionLink({
1717
href,
1818
label,
1919
icon,
20-
tone = "local"
20+
tone = "local",
21+
className
2122
}: {
2223
href: string;
2324
label: string;
2425
icon: keyof typeof ACTION_ICONS;
2526
tone?: "local" | "preview" | "preview-primary";
27+
className?: string;
2628
}) {
2729
const Icon = ACTION_ICONS[icon];
2830

@@ -34,7 +36,8 @@ function ActionLink({
3436
? "tb-button-primary"
3537
: tone === "preview"
3638
? "tb-button-ghost bg-[#ffe9de]"
37-
: "tb-button-secondary bg-[#d7ebf6]"
39+
: "tb-button-secondary bg-[#d7ebf6]",
40+
className
3841
)}
3942
href={href}
4043
target="_blank"
@@ -57,41 +60,36 @@ export function TaskRow({
5760

5861
return (
5962
<article className="tb-frame bg-[#fffdf9] p-4 sm:p-5">
60-
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
61-
<div className="min-w-0 flex-1">
62-
<div className="flex flex-wrap items-center gap-2">
63-
<h2 className="min-w-0 font-heading text-[2rem] font-bold leading-[0.95] text-[#25314d] sm:text-[2.35rem]">
64-
{taskTitle(task)}
65-
</h2>
66-
{task.maturity ? <MaturityBadge maturity={task.maturity} /> : null}
67-
{preview ? (
68-
<span className="rounded-full bg-[#ecffe5] px-3 py-1 text-[11px] font-bold text-[#25314d]">
69-
Preview ready
70-
</span>
71-
) : null}
72-
</div>
73-
74-
<div className="mt-3 flex flex-wrap items-center gap-2 text-xs text-slate-600">
75-
<code className="rounded-full border-2 border-[#25314d] bg-white px-2.5 py-1 font-mono text-[11px] font-semibold text-[#25314d]">
76-
{taskHandle(task)}
77-
</code>
78-
</div>
79-
</div>
63+
<div className="min-w-0">
64+
<h2 className="min-w-0 font-heading text-[2rem] font-bold leading-[0.95] text-[#25314d] sm:text-[2.35rem]">
65+
{taskTitle(task)}
66+
</h2>
8067

81-
<div className="self-start rounded-full bg-[#e2f3fb] px-4 py-2 text-sm font-bold text-[#25314d]">
82-
Updated {formatShortDate(task.last_updated)}
68+
<div className="mt-3 flex flex-wrap items-center gap-2 text-xs text-slate-600">
69+
<code className="rounded-full border-2 border-[#25314d] bg-white px-2.5 py-1 font-mono text-[11px] font-semibold text-[#25314d]">
70+
{taskHandle(task)}
71+
</code>
72+
{task.maturity ? <MaturityBadge maturity={task.maturity} /> : null}
73+
{preview ? (
74+
<span className="rounded-full bg-[#ecffe5] px-3 py-1 text-[11px] font-bold text-[#25314d]">
75+
Preview ready
76+
</span>
77+
) : null}
78+
<span className="rounded-full bg-[#e2f3fb] px-4 py-2 text-[11px] font-bold text-[#25314d]">
79+
{formatShortDate(task.last_updated)}
80+
</span>
8381
</div>
8482
</div>
8583

86-
<div className="mt-4 flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between">
84+
<div className="mt-4 grid gap-4 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start">
8785
<p className="max-w-4xl text-sm leading-7 text-slate-700 sm:text-base">
8886
{task.short_description || "No description provided."}
8987
</p>
9088

91-
<div className="flex flex-wrap gap-2 xl:justify-end">
89+
<div className="flex flex-wrap gap-2 xl:flex-col xl:items-end">
9290
<button
9391
type="button"
94-
className="tb-focus-ring tb-button-primary"
92+
className="tb-focus-ring tb-button-primary min-w-[190px] whitespace-nowrap"
9593
onClick={() => onOpen(task)}
9694
>
9795
Expand details
@@ -102,6 +100,7 @@ export function TaskRow({
102100
label="Run Preview"
103101
icon="play"
104102
tone="preview-primary"
103+
className="min-w-[190px] whitespace-nowrap justify-center"
105104
/>
106105
) : null}
107106
</div>

0 commit comments

Comments
 (0)