Kaynağa Gözat

feat: LP Token 和当前价格可点击跳转 dextools 页面

- my-lp 页面 LP Token 列添加 dextools 链接
- DataTable 当前价格添加 dextools 链接
- PNL Percent 列标题简化为 PNL%
- 当前价格显示精度从 6 位改为 4 位
lushdog@outlook.com 3 hafta önce
ebeveyn
işleme
cf4acbf43d
2 değiştirilmiş dosya ile 18 ekleme ve 7 silme
  1. 9 2
      src/app/components/DataTable.tsx
  2. 9 5
      src/app/my-lp/page.tsx

+ 9 - 2
src/app/components/DataTable.tsx

@@ -917,8 +917,15 @@ function DataTableContent() {
 					}
 				/>
 				<span className="ml-2 mr-2 text-lg font-bold text-green-500">
-					余额:{balance} {tokenName} (${balanceUsd}) | 当前价格:$
-					{Number(currentPrice).toFixed(4)} | 24h Fee:
+					余额:{balance} {tokenName} (${balanceUsd}) |{' '}
+					<Typography.Link
+						href={`https://www.dextools.io/app/solana/pair-explorer/${selectedPoolAddress}`}
+						target="_blank"
+						style={{ fontSize: '18px', fontWeight: 'bold', color: '#22c55e' }}
+					>
+						当前价格:${Number(currentPrice).toFixed(4)}
+					</Typography.Link>{' '}
+					| 24h Fee:
 					<span className="text-orange-500 font-bold text-xl">
 						${Number(feeUsd1d).toFixed(2)}
 					</span>{' '}

+ 9 - 5
src/app/my-lp/page.tsx

@@ -598,7 +598,7 @@ function MyLPPageContent() {
 			title: 'LP Token',
 			dataIndex: 'lpToken',
 			key: 'lpToken',
-			render: (text: string, record: RecordInfo) => (
+			render: (_text: string, record: RecordInfo) => (
 				<div className="flex items-center gap-2">
 					<span className="inline-flex items-center">
 						<Image
@@ -616,9 +616,13 @@ function MyLPPageContent() {
 							style={{ borderRadius: '50%' }}
 						/>
 					</span>
-					<span className="font-mono text-sm">
+					<Typography.Link
+						href={`https://www.dextools.io/app/solana/pair-explorer/${record.poolAddress}`}
+						target="_blank"
+						className="font-mono text-sm"
+					>
 						{getPoolInfo(record.poolAddress).lpToken}
-					</span>
+					</Typography.Link>
 				</div>
 			),
 		},
@@ -808,7 +812,7 @@ function MyLPPageContent() {
 			),
 		},
 		{
-			title: 'PNL Percent',
+			title: 'PNL%',
 			dataIndex: 'pnlUsdPercent',
 			key: 'pnlUsdPercent',
 			render: (text: string) => (
@@ -844,7 +848,7 @@ function MyLPPageContent() {
 			key: 'price',
 			render: (text: string, record: RecordInfo) => (
 				<span className="font-mono text-sm">
-					${Number(getPoolInfo(record.poolAddress).price[0]).toFixed(6)}
+					${Number(getPoolInfo(record.poolAddress).price[0]).toFixed(4)}
 				</span>
 			),
 		},