mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-26 12:53:59 +02:00
refactor: restyle filter chips as minimal dot toggles
Replace rounded-full pill buttons with subtle text toggles that use a small colored dot indicator when active. Blends better with the sidebar aesthetic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -68,27 +68,32 @@ function relativeTime(iso: string): string {
|
|||||||
return new Date(iso).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
|
return new Date(iso).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Filter chip ────────────────────────────────────────────── */
|
/* ── Filter toggle ──────────────────────────────────────────── */
|
||||||
|
|
||||||
function FilterChip({
|
function FilterToggle({
|
||||||
label,
|
label,
|
||||||
active,
|
active,
|
||||||
activeClass,
|
dotColor,
|
||||||
onClick,
|
onClick,
|
||||||
}: {
|
}: {
|
||||||
label: string;
|
label: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
activeClass: string;
|
dotColor: string;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={`rounded-full px-2 py-0.5 text-[10px] font-medium transition ${
|
className={`flex items-center gap-1 text-[11px] transition ${
|
||||||
active ? activeClass : 'bg-zinc-800/60 text-zinc-500 hover:bg-zinc-800 hover:text-zinc-400'
|
active ? 'text-zinc-300' : 'text-zinc-600 hover:text-zinc-400'
|
||||||
}`}
|
}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
<span
|
||||||
|
className={`inline-block size-1.5 rounded-full transition-colors ${
|
||||||
|
active ? dotColor : 'bg-zinc-700'
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
{label}
|
{label}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
@@ -504,11 +509,11 @@ export function Sidebar({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex items-center gap-3">
|
||||||
<FilterChip label="Running" active={filterRunning} activeClass="bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/25" onClick={() => setFilterRunning(!filterRunning)} />
|
<FilterToggle label="Running" active={filterRunning} dotColor="bg-blue-400" onClick={() => setFilterRunning(!filterRunning)} />
|
||||||
<FilterChip label="Error" active={filterErrored} activeClass="bg-red-500/15 text-red-300 ring-1 ring-red-500/25" onClick={() => setFilterErrored(!filterErrored)} />
|
<FilterToggle label="Error" active={filterErrored} dotColor="bg-red-400" onClick={() => setFilterErrored(!filterErrored)} />
|
||||||
<FilterChip label="Pinned" active={filterPinned} activeClass="bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/25" onClick={() => setFilterPinned(!filterPinned)} />
|
<FilterToggle label="Pinned" active={filterPinned} dotColor="bg-amber-400" onClick={() => setFilterPinned(!filterPinned)} />
|
||||||
<FilterChip label="Archived" active={filterIncludeArchived} activeClass="bg-zinc-600/20 text-zinc-300 ring-1 ring-zinc-600/30" onClick={() => setFilterIncludeArchived(!filterIncludeArchived)} />
|
<FilterToggle label="Archived" active={filterIncludeArchived} dotColor="bg-zinc-400" onClick={() => setFilterIncludeArchived(!filterIncludeArchived)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user