Skip to content

Commit 5067bc4

Browse files
committed
✨ donations
1 parent e085dfc commit 5067bc4

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

app/src/sub/SettingsWindow/credits.tsx

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Popover } from "@/components/ui/popover";
2+
import { cn } from "@/utils/cn";
23
import { open } from "@tauri-apps/plugin-shell";
3-
import { ExternalLink, Heart, User } from "lucide-react";
4+
import { Calendar, ExternalLink, Heart, Server, User } from "lucide-react";
45
import "./assets/font.css";
56

67
interface DonationData {
@@ -10,7 +11,12 @@ interface DonationData {
1011
currency?: string;
1112
}
1213

14+
// 新的在前
1315
const donations: DonationData[] = [
16+
{ user: "购买服务器", note: "zty012", amount: -480 },
17+
{ user: "域名 2y.nz", note: "zty012", amount: -151.8 },
18+
// { user: "MacBook", note: "littlefean", amount: -7599.2 },
19+
{ user: "域名 project-graph.top", note: "zty012", amount: -13.66 },
1420
{ user: "ShawnSnow", note: "感谢PG", amount: 40 },
1521
{ user: "飞度", note: "做的很酷,真的谢谢你们", amount: 50 },
1622
{ user: "鳕鱼", note: "支持开源支持国产,加油", amount: 70 },
@@ -94,9 +100,29 @@ export default function CreditsTab() {
94100
<div className="bg-muted/50 flex flex-1 flex-col gap-2 rounded-lg border p-4">
95101
<div className="flex items-center justify-center gap-2">
96102
<Heart className="h-5 w-5" />
103+
<span className="text-lg">合计</span>
104+
</div>
105+
<div
106+
className={cn(
107+
"flex items-end justify-center gap-2 text-center *:font-[DINPro]",
108+
totalAmount < 0 ? "text-red-500" : "text-green-500",
109+
)}
110+
>
111+
<span className="text-3xl">{totalAmount.toFixed(2)}</span>
112+
<span className="text-xl">CNY</span>
113+
</div>
114+
</div>
115+
<div className="bg-muted/50 flex flex-1 flex-col gap-2 rounded-lg border p-4">
116+
<div className="flex items-center justify-center gap-2">
117+
<Calendar className="h-5 w-5" />
97118
<span className="text-lg">平均每月</span>
98119
</div>
99-
<div className="flex items-end justify-center gap-2 text-center *:font-[DINPro]">
120+
<div
121+
className={cn(
122+
"flex items-end justify-center gap-2 text-center *:font-[DINPro]",
123+
averageMonthlyAmount < 0 ? "text-red-500" : "text-green-500",
124+
)}
125+
>
100126
<span className="text-3xl">{averageMonthlyAmount.toFixed(2)}</span>
101127
<span className="text-xl">CNY</span>
102128
</div>
@@ -146,11 +172,13 @@ function Donation({
146172
}) {
147173
return (
148174
<div
149-
className="bg-muted/50 mb-4 inline-flex w-full break-inside-avoid flex-col gap-2 rounded-lg border p-4"
150-
style={{ pageBreakInside: "avoid" }}
175+
className={cn(
176+
"bg-muted/50 mb-4 inline-flex w-full break-inside-avoid flex-col gap-2 rounded-lg border p-4",
177+
amount < 0 && "bg-destructive/25",
178+
)}
151179
>
152180
<div className="flex items-center gap-2">
153-
<User className="h-4 w-4" />
181+
{amount < 0 ? <Server className="size-4" /> : <User className="size-4" />}
154182
<span className="text-sm font-medium">{user || "匿名"}</span>
155183
</div>
156184

docs-pg/服务器.prg

80 Bytes
Binary file not shown.

docs/content/docs/app/misc/donate.zh-CN.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@ icon: Heart
2626
| Mac 触摸板支持 | 以后会有的云存储功能 | |
2727
| 其他功能开发…… | UI 设计 | |
2828
| ![](@/img/donate-littlefean.png) | ![](@/img/donate-zty012.png) | …… |
29-
30-
### 项目当前支出
31-
32-
- 域名:$4.88/年 (zty012)
33-
- MacBook: ¥7599.2 (Littlefean, 2025年4月13日, 会为mac用户开发触摸板等兼容功能)

0 commit comments

Comments
 (0)