refactor(pages): replace inline links with Button asChild and TabsList variant

This commit is contained in:
zetaloop
2026-02-25 14:54:15 +08:00
parent f0a8abefa5
commit 0cf2d272c9
4 changed files with 26 additions and 52 deletions
+22 -36
View File
@@ -62,14 +62,12 @@ export default function HomePage() {
</div>
<div className="flex flex-wrap gap-3">
{games.map((game) => (
<Link
key={game.id}
href={`/search?game=${encodeURIComponent(game.name)}`}
className="flex items-center gap-2 rounded-full bg-muted/50 text-muted-foreground px-4 py-2 hover:bg-muted hover:text-foreground transition-all"
>
<GameIcon name={game.icon} className="h-5 w-5" />
<span className="text-sm font-medium">{game.name}</span>
</Link>
<Button key={game.id} variant="secondary" className="rounded-full" asChild>
<Link href={`/search?game=${encodeURIComponent(game.name)}`}>
<GameIcon name={game.icon} className="h-5 w-5" />
{game.name}
</Link>
</Button>
))}
</div>
</section>
@@ -77,34 +75,22 @@ export default function HomePage() {
<section className="space-y-6">
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
<h2 className="text-xl font-semibold"></h2>
<div className="flex flex-wrap items-center gap-4 text-sm">
<Link href="/search?sort=composite" className="text-primary font-medium">
</Link>
<Link
href="/search?sort=rating"
className="text-muted-foreground hover:text-foreground transition-colors"
>
</Link>
<Link
href="/search?sort=orders"
className="text-muted-foreground hover:text-foreground transition-colors"
>
</Link>
<Link
href="/search?sort=price_asc"
className="text-muted-foreground hover:text-foreground transition-colors"
>
</Link>
<Link
href="/search?sort=price_desc"
className="text-muted-foreground hover:text-foreground transition-colors"
>
</Link>
<div className="flex flex-wrap items-center gap-1 text-sm">
<Button variant="ghost" size="sm" asChild>
<Link href="/search?sort=composite"></Link>
</Button>
<Button variant="ghost" size="sm" className="text-muted-foreground" asChild>
<Link href="/search?sort=rating"></Link>
</Button>
<Button variant="ghost" size="sm" className="text-muted-foreground" asChild>
<Link href="/search?sort=orders"></Link>
</Button>
<Button variant="ghost" size="sm" className="text-muted-foreground" asChild>
<Link href="/search?sort=price_asc"></Link>
</Button>
<Button variant="ghost" size="sm" className="text-muted-foreground" asChild>
<Link href="/search?sort=price_desc"></Link>
</Button>
</div>
</div>