diff --git a/CHANGELOG.md b/CHANGELOG.md index 938867d3e..3982a6655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # 更新日志 +## [1.0.7] - 2026-02-18 + +修复钱包列表链水印映射并在地址前显示链名称 + + + ## [1.0.6] - 2026-02-18 修复 BSC 转账广播链路并透传 tokenAddress diff --git a/manifest.json b/manifest.json index ebe024f68..76891bdb5 100644 --- a/manifest.json +++ b/manifest.json @@ -18,8 +18,8 @@ "author": [ "@bfmeta.info" ], - "version": "1.0.6", - "change_log": "修复 BSC 转账广播链路并透传 tokenAddress", + "version": "1.0.7", + "change_log": "修复钱包列表链水印映射并在地址前显示链名称", "categories": [ "application", "wallet" diff --git a/package.json b/package.json index d5beb9a89..a328b4dbb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@biochain/keyapp", "private": true, - "version": "1.0.6", + "version": "1.0.7", "type": "module", "packageManager": "pnpm@10.28.0", "scripts": { @@ -218,5 +218,5 @@ "packages/*", "miniapps/*" ], - "lastChangelogCommit": "b6845de129e00e7720e0f12402c89008b995b93f" + "lastChangelogCommit": "8e72ba46aec9acb2ac56f38c1783441966f16f9a" } diff --git a/src/stackflow/activities/sheets/WalletListJob.tsx b/src/stackflow/activities/sheets/WalletListJob.tsx index f80ed80bb..ef741168e 100644 --- a/src/stackflow/activities/sheets/WalletListJob.tsx +++ b/src/stackflow/activities/sheets/WalletListJob.tsx @@ -1,22 +1,28 @@ -import type { ActivityComponentType } from "@stackflow/react"; -import { BottomSheet } from "@/components/layout/bottom-sheet"; -import { useTranslation } from "react-i18next"; -import { IconPlus, IconCircleCheckFilled } from "@tabler/icons-react"; -import { cn } from "@/lib/utils"; -import { useFlow } from "../../stackflow"; -import { useWallets, useCurrentWallet, walletActions } from "@/stores"; -import { useWalletTheme } from "@/hooks/useWalletTheme"; -import { useChainIconUrls } from "@/hooks/useChainIconUrls"; -import { WalletMiniCard } from "@/components/wallet/wallet-mini-card"; +import { useMemo } from 'react'; +import type { ActivityComponentType } from '@stackflow/react'; +import { BottomSheet } from '@/components/layout/bottom-sheet'; +import { useTranslation } from 'react-i18next'; +import { IconPlus, IconCircleCheckFilled } from '@tabler/icons-react'; +import { cn } from '@/lib/utils'; +import { useFlow } from '../../stackflow'; +import { useWallets, useCurrentWallet, useChainPreferences, useChainConfigs, walletActions } from '@/stores'; +import { useWalletTheme } from '@/hooks/useWalletTheme'; +import { useChainIconUrls } from '@/hooks/useChainIconUrls'; +import { WalletMiniCard } from '@/components/wallet/wallet-mini-card'; export const WalletListJob: ActivityComponentType = () => { - const { t } = useTranslation(["wallet", "common"]); + const { t } = useTranslation(['wallet', 'common']); const { pop, push } = useFlow(); const wallets = useWallets(); const currentWallet = useCurrentWallet(); + const chainPreferences = useChainPreferences(); + const chainConfigs = useChainConfigs(); const currentWalletId = currentWallet?.id; const { getWalletTheme } = useWalletTheme(); const chainIconUrls = useChainIconUrls(); + const chainNameMap = useMemo(() => { + return Object.fromEntries(chainConfigs.map((config) => [config.id, config.name])); + }, [chainConfigs]); const handleSelectWallet = (walletId: string) => { walletActions.setCurrentWallet(walletId); @@ -25,7 +31,7 @@ export const WalletListJob: ActivityComponentType = () => { const handleAddWallet = () => { pop(); - push("WalletAddJob", {}); + push('WalletAddJob', {}); }; const handleCancel = () => { pop(); @@ -36,22 +42,29 @@ export const WalletListJob: ActivityComponentType = () => {
{/* Handle */}
-
+
{/* Title */} -
-

{t("common:a11y.tabWallet")}

+
+

{t('common:a11y.tabWallet')}

{/* Wallet List */}
{wallets.map((wallet) => { const isActive = wallet.id === currentWalletId; - const address = wallet.chainAddresses[0]?.address; + const preferredChain = chainPreferences[wallet.id] ?? wallet.chain; + const resolvedChain = wallet.chainAddresses.some((ca) => ca.chain === preferredChain) + ? preferredChain + : (wallet.chainAddresses[0]?.chain ?? wallet.chain); + const chainAddress = wallet.chainAddresses.find((ca) => ca.chain === resolvedChain); + const address = chainAddress?.address ?? wallet.address; + const chainName = + chainNameMap[resolvedChain] ?? t(`common:chains.${resolvedChain}`, { defaultValue: resolvedChain }); const displayAddress = address - ? `${address.slice(0, 6)}...${address.slice(-4)}` - : "---"; + ? `${chainName} · ${address.slice(0, 6)}...${address.slice(-4)}` + : `${chainName} · ---`; const themeHue = getWalletTheme(wallet.id); return ( @@ -59,31 +72,21 @@ export const WalletListJob: ActivityComponentType = () => { key={wallet.id} onClick={() => handleSelectWallet(wallet.id)} className={cn( - "flex w-full items-center gap-3 rounded-xl p-4 transition-all", - "active:scale-[0.98]", - isActive - ? "bg-primary/10 ring-2 ring-primary" - : "bg-muted/50 hover:bg-muted" + 'flex w-full items-center gap-3 rounded-xl p-4 transition-all', + 'active:scale-[0.98]', + isActive ? 'bg-primary/10 ring-primary ring-2' : 'bg-muted/50 hover:bg-muted', )} > {/* 钱包小卡片图标 */} - + {/* 钱包信息 */}
{wallet.name} - {isActive && ( - - )} + {isActive && }
-

- {displayAddress} -

+

{displayAddress}

); @@ -91,16 +94,16 @@ export const WalletListJob: ActivityComponentType = () => {
{/* Add wallet button */} -
+