Skip to content

Commit 7d1464e

Browse files
committed
fix: img to Image
1 parent 35443c9 commit 7d1464e

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

app/components/Hero.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ export function Hero() {
192192
#{idx + 1}
193193
</div>
194194
<div className="w-16 h-16 bg-neutral-100 dark:bg-neutral-800 border border-[var(--foreground)] mb-4 transition-transform group-hover:scale-110 overflow-hidden">
195-
<img
195+
<Image
196196
src={user.avatarUrl}
197197
alt={user.name}
198+
width={64}
199+
height={64}
198200
className="w-full h-full object-cover transition-all duration-300"
199201
/>
200202
</div>

app/components/rank/ContributorRow.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import * as Dialog from "@radix-ui/react-dialog";
44
import { X, ExternalLink } from "lucide-react";
55
import Link from "next/link";
6-
import { cn } from "@/lib/utils";
6+
import Image from "next/image";
77

88
type Contributor = {
99
id: string;
@@ -35,9 +35,11 @@ export function ContributorRow({
3535
#{idx + 1}
3636
</div>
3737
<div className="w-12 h-12 bg-neutral-200 dark:bg-neutral-800 border border-[var(--foreground)] transition-transform group-hover:scale-110 overflow-hidden shrink-0">
38-
<img
38+
<Image
3939
src={user.avatarUrl}
4040
alt={user.name}
41+
width={48}
42+
height={48}
4143
className="w-full h-full object-cover transition-all duration-300"
4244
/>
4345
</div>
@@ -71,9 +73,11 @@ export function ContributorRow({
7173
<div className="flex gap-5 md:gap-6 items-start w-full pr-12">
7274
{/* 用户头像 */}
7375
<div className="w-20 h-20 md:w-24 md:h-24 bg-neutral-200 dark:bg-neutral-800 border-2 border-[#111111] dark:border-neutral-200 shrink-0 overflow-hidden">
74-
<img
76+
<Image
7577
src={user.avatarUrl}
7678
alt={user.name}
79+
width={96}
80+
height={96}
7781
className="w-full h-full object-cover"
7882
/>
7983
</div>

app/rank/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Header } from "@/app/components/Header";
22
import { Footer } from "@/app/components/Footer";
3-
import { AnimatedBar } from "@/app/components/rank/AnimatedBar";
4-
import { cn } from "@/lib/utils";
53
import { ContributorRow } from "@/app/components/rank/ContributorRow";
64

75
import leaderboardData from "@/generated/site-leaderboard.json";

0 commit comments

Comments
 (0)