Skip to content

Commit 53014d0

Browse files
committed
feat(support): support me component to add support for SOL currency and related icons
1 parent c8c2ae4 commit 53014d0

File tree

5 files changed

+53
-12
lines changed

5 files changed

+53
-12
lines changed

components/author/support-me.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ import { SUPPORTERS } from '~/data/supporters'
33
import { Image } from '~/components/ui/image'
44
import clsx from 'clsx'
55
import { EyeClosedIcon } from 'lucide-react'
6+
import Solana from '~/icons/solana.svg'
7+
8+
const getCurrencySymbol = (currency: string) => {
9+
switch (currency) {
10+
case 'CNY':
11+
return '¥'
12+
case 'USD':
13+
return '$'
14+
case 'SOL':
15+
return <Solana className="mr-[2px] mt-[-2px] inline-block h-4 w-4" />
16+
}
17+
}
618

719
export function SupportMe({ className }: { className?: string }) {
820
const supportersSort = SUPPORTERS.sort((a, b) => {
@@ -61,7 +73,7 @@ export function SupportMe({ className }: { className?: string }) {
6173
)}
6274
{supporter.amount && supporter.currency && (
6375
<span className="ml-2 font-medium text-green-600 dark:text-green-400">
64-
{supporter.currency === 'CNY' ? '¥' : '$'}
76+
{getCurrencySymbol(supporter.currency)}
6577
{supporter.amount}
6678
</span>
6779
)}

components/ui/brand.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import Commitlint from '~/icons/commitlint.svg'
5959
import Html from '~/icons/html5.svg'
6060
import Postcss from '~/icons/postcss.svg'
6161
import Env from '~/icons/env.svg'
62+
import Solana from '~/icons/solana.svg'
6263

6364
export const BrandsMap: Record<
6465
string,
@@ -311,6 +312,10 @@ export const BrandsMap: Record<
311312
Icon: Apple,
312313
url: 'https://www.apple.com/ios',
313314
},
315+
Solana: {
316+
Icon: Solana,
317+
url: 'https://sloana.com/',
318+
},
314319
}
315320

316321
export function Brand(props: {

data/supporters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export interface Supporter {
22
name?: string
33
amount?: number
4-
currency?: 'CNY' | 'USD'
4+
currency?: 'CNY' | 'USD' | 'SOL'
55
date: string
66
message?: string
77
via: 'Ko-fi' | 'WeChat' | 'Other'

icons/solana.svg

Lines changed: 22 additions & 0 deletions
Loading

json/tag-data.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"2023": 1,
33
"2024": 1,
44
"fe": 13,
5-
"react": 3,
6-
"react-router-dom": 1,
75
"javascript": 6,
86
"flat": 1,
7+
"react": 3,
8+
"react-router-dom": 1,
99
"vue": 5,
1010
"vue3": 2,
1111
"deno": 1,
@@ -26,12 +26,12 @@
2626
"effects-video": 1,
2727
"webgl": 2,
2828
"canvas": 2,
29+
"record-screen": 1,
30+
"html2canvas": 1,
2931
"video": 1,
3032
"android": 1,
3133
"webview": 2,
32-
"visualization": 1,
33-
"record-screen": 1,
34-
"html2canvas": 1,
34+
"visualization": 2,
3535
"life": 4,
3636
"year-end": 2,
3737
"summary": 2,
@@ -41,16 +41,19 @@
4141
"collect": 1,
4242
"optimization": 1,
4343
"webworker": 1,
44-
"travel": 1,
45-
"japan": 1,
4644
"blog": 1,
4745
"code-life": 1,
46+
"travel": 1,
47+
"japan": 1,
4848
"ai": 4,
49-
"deepseek": 1,
49+
"mcp": 3,
5050
"llm": 4,
51+
"deepseek": 1,
5152
"ollama": 1,
5253
"dify": 1,
53-
"mcp": 3,
54+
"test": 1,
55+
"mermaid": 1,
56+
"markdown": 2,
5457
"typescript": 3,
5558
"string": 1,
5659
"casing": 1,
@@ -70,7 +73,6 @@
7073
"spotify-api": 1,
7174
"ios": 1,
7275
"swiftui": 1,
73-
"markdown": 1,
7476
"code-block": 1,
7577
"syntax": 1,
7678
"npm": 1,

0 commit comments

Comments
 (0)