mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
fix(ui): refine tracked repo row — add xs button size, move status to info group
- Add 'xs' button size tier (px-2 py-1 text-xs) to Button component - Use xs buttons for tracked repo Update/Uninstall actions to reduce visual weight in row-level controls - Move clean/modified status from action area to info group (left side) as Badge — status is metadata, not an action - clean: subtle default Badge; modified: warning Badge with dot - Remove unused Check icon import
This commit is contained in:
@@ -4,7 +4,7 @@ import Spinner from './Spinner';
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
children: ReactNode;
|
||||
variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'link';
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
size?: 'xs' | 'sm' | 'md' | 'lg';
|
||||
loading?: boolean;
|
||||
ref?: Ref<HTMLButtonElement>;
|
||||
}
|
||||
@@ -18,6 +18,7 @@ const variantClasses = {
|
||||
};
|
||||
|
||||
const sizeClasses = {
|
||||
xs: 'px-2 py-1 text-xs',
|
||||
sm: 'px-3 py-1.5 text-sm',
|
||||
md: 'px-5 py-2.5 text-sm',
|
||||
lg: 'px-6 py-3 text-base',
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
Download,
|
||||
GitBranch,
|
||||
AlertTriangle,
|
||||
Check,
|
||||
Trash2,
|
||||
Package,
|
||||
Zap,
|
||||
@@ -513,36 +512,30 @@ function TrackedReposSection({ repos }: { repos: { name: string; skillCount: num
|
||||
{displayName}
|
||||
</span>
|
||||
<Badge variant="info">{repo.skillCount} skills</Badge>
|
||||
{repo.dirty ? (
|
||||
<Badge variant="warning" dot>modified</Badge>
|
||||
) : (
|
||||
<Badge variant="default">clean</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2 shrink-0">
|
||||
{repo.dirty ? (
|
||||
<span className="flex items-center gap-1 text-warning text-sm">
|
||||
<AlertTriangle size={14} strokeWidth={2.5} />
|
||||
<span>modified</span>
|
||||
</span>
|
||||
) : (
|
||||
<span className="flex items-center gap-1 text-success text-sm">
|
||||
<Check size={14} strokeWidth={2.5} />
|
||||
<span>clean</span>
|
||||
</span>
|
||||
)}
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
size="xs"
|
||||
onClick={() => handleUpdateRepo(repo.name)}
|
||||
loading={isUpdating}
|
||||
disabled={hasAnyDeleteInProgress}
|
||||
>
|
||||
<RefreshCw size={14} />
|
||||
<RefreshCw size={12} />
|
||||
Update
|
||||
</Button>
|
||||
<Button
|
||||
variant="danger"
|
||||
size="sm"
|
||||
size="xs"
|
||||
onClick={() => setRepoToDelete(repo.name)}
|
||||
disabled={isBusy || repoToDelete !== null || updatingRepos.size > 0}
|
||||
>
|
||||
<Trash2 size={14} />
|
||||
<Trash2 size={12} />
|
||||
Uninstall
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user