diff --git a/src/locales/en.ts b/src/locales/en.ts index 95cdf62..c3e97cf 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -176,6 +176,7 @@ export const enDict: Dict = { close: "Close", walletConnect: "Connect Wallet", walletConnectedAs: "Connected wallet", + walletLoginAddress: "Login address", walletDisconnect: "Disconnect", walletLoginTitle: "Connect wallet", walletLoginDesc: diff --git a/src/locales/id.ts b/src/locales/id.ts index c240f0c..2111f0d 100644 --- a/src/locales/id.ts +++ b/src/locales/id.ts @@ -176,6 +176,7 @@ export const idDict: Dict = { close: "Tutup", walletConnect: "Hubungkan Dompet", walletConnectedAs: "Dompet terhubung", + walletLoginAddress: "Alamat login", walletDisconnect: "Putuskan", walletLoginTitle: "Hubungkan dompet", walletLoginDesc: diff --git a/src/locales/ja.ts b/src/locales/ja.ts index f6d0015..0eedd3a 100644 --- a/src/locales/ja.ts +++ b/src/locales/ja.ts @@ -175,6 +175,7 @@ export const jaDict: Dict = { close: "閉じる", walletConnect: "ウォレット接続", walletConnectedAs: "接続中のウォレット", + walletLoginAddress: "ログインアドレス", walletDisconnect: "切断", walletLoginTitle: "ウォレットを接続", walletLoginDesc: diff --git a/src/locales/ko.ts b/src/locales/ko.ts index 7142e4c..17a8f73 100644 --- a/src/locales/ko.ts +++ b/src/locales/ko.ts @@ -174,6 +174,7 @@ export const koDict: Dict = { close: "닫기", walletConnect: "지갑 연결", walletConnectedAs: "연결된 지갑", + walletLoginAddress: "로그인 주소", walletDisconnect: "연결 해제", walletLoginTitle: "지갑 연결", walletLoginDesc: diff --git a/src/locales/ms.ts b/src/locales/ms.ts index ceb109b..69d482d 100644 --- a/src/locales/ms.ts +++ b/src/locales/ms.ts @@ -174,6 +174,7 @@ export const msDict: Dict = { close: "Tutup", walletConnect: "Sambung Dompet", walletConnectedAs: "Dompet disambungkan", + walletLoginAddress: "Alamat log masuk", walletDisconnect: "Putuskan", walletLoginTitle: "Sambung dompet", walletLoginDesc: diff --git a/src/locales/vi.ts b/src/locales/vi.ts index 61a985d..ebd3e2c 100644 --- a/src/locales/vi.ts +++ b/src/locales/vi.ts @@ -173,6 +173,7 @@ export const viDict: Dict = { close: "Đóng", walletConnect: "Kết nối ví", walletConnectedAs: "Ví đã kết nối", + walletLoginAddress: "Địa chỉ đăng nhập", walletDisconnect: "Ngắt kết nối", walletLoginTitle: "Kết nối ví", walletLoginDesc: diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index cde1b97..d0a3791 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -167,6 +167,7 @@ export const zhDict: Dict = { close: "关闭", walletConnect: "连接钱包", walletConnectedAs: "已连接钱包", + walletLoginAddress: "登录地址", walletDisconnect: "断开连接", walletLoginTitle: "连接钱包", walletLoginDesc: "签名验证钱包地址,不会发起交易,也不需要 Gas。", diff --git a/src/wallet/WalletButton.tsx b/src/wallet/WalletButton.tsx index 2beb350..a6ce384 100644 --- a/src/wallet/WalletButton.tsx +++ b/src/wallet/WalletButton.tsx @@ -1,4 +1,4 @@ -import { Heart } from "lucide-react"; +import { Heart, LogOut } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { Link } from "react-router-dom"; import { WalletIcon } from "../components/icons/WalletIcon"; @@ -40,17 +40,30 @@ export function WalletButton({ if (wallet.status === "loggedIn" && wallet.address) { if (compact) { return ( -
-
- - {shortenAddress(wallet.address)} +
+
+
+ {t("walletLoginAddress")} +
+
+ + {wallet.address.slice(0, 5)} + + + {wallet.address.slice(5, -5)} + + + {wallet.address.slice(-5)} + +
); @@ -108,8 +121,10 @@ export function WalletButton({ wallet.openLoginModal(); }} className={[ - "inline-flex h-10 items-center justify-center gap-2 rounded-full border border-ark-gold bg-ark-gold px-4 text-sm font-bold text-black outline-none transition hover:bg-ark-gold2 focus-visible:ring-2 focus-visible:ring-ark-gold/80 focus-visible:ring-offset-2 focus-visible:ring-offset-ark-bg", - compact ? "w-full" : "min-w-[124px] shrink-0 whitespace-nowrap", + "inline-flex items-center justify-center gap-2 rounded-full border border-ark-gold bg-ark-gold px-4 text-black outline-none transition hover:bg-ark-gold2 focus-visible:ring-2 focus-visible:ring-ark-gold/80 focus-visible:ring-offset-2 focus-visible:ring-offset-ark-bg", + compact + ? "h-12 w-full text-[15px] font-medium" + : "h-10 min-w-[124px] shrink-0 whitespace-nowrap text-sm font-bold", ].join(" ")} >