-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDonationLeaderboardEntry.tsx
More file actions
61 lines (56 loc) · 1.67 KB
/
DonationLeaderboardEntry.tsx
File metadata and controls
61 lines (56 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import Image from "next/image";
import Trophy from "@/common/assets/svgs/Trophy";
export type DonationLeaderboardEntryProps = {
rank: number;
image: string;
name: string;
amount: number;
type: "donor" | "sponsor";
};
export const DonationLeaderboardEntry: React.FC<
DonationLeaderboardEntryProps
> = ({ rank, image, name, amount, type }) => {
const bgClass =
rank === 1
? "bg-gradient-to-r from-orange-400 to-red-500 text-white"
: rank === 2
? "bg-gradient-to-r from-#F7F7F7 to-#DBDBDB"
: "bg-gradient-to-r from-#FCE9D5 to-#F8D3B0";
const rankText = ["1st", "2nd", "3rd"][rank - 1];
const iconClass =
rank === 1
? "fill-yellow-400"
: rank === 2
? "fill-gray-400"
: "fill-red-800";
return (
<div
className={`w-288px overflow-hidden rounded-2xl border border-gray-200 pb-4`}
>
<div className={`flex items-center justify-between p-4 ${bgClass}`}>
<div>
<Trophy className={`h-6 w-6 ${iconClass}`} />
</div>
<span className="text-lg font-bold">{rankText}</span>
</div>
<div className="p-20px flex flex-col items-center">
<Image
src={image ?? ""}
alt={name}
className="mb-12px h-20 w-20 rounded-full"
width={80}
height={80}
/>
<p className="font-500 text-#292929 font-14px mb-2 text-center">
{name}
</p>
<p className="font-600 text-center text-2xl">
{amount}{" "}
<span className="text-#292929 font-600 text-sm">
NEAR {type === "donor" ? "Donated" : "Sponsored"}
</span>
</p>
</div>
</div>
);
};