diff --git a/presale-app/client/src/pages/Home.tsx b/presale-app/client/src/pages/Home.tsx index 819001c..f49f506 100644 --- a/presale-app/client/src/pages/Home.tsx +++ b/presale-app/client/src/pages/Home.tsx @@ -357,44 +357,7 @@ function EVMPurchasePanel({ network, lang, wallet }: { network: "BSC" | "ETH"; l } }, [purchaseState.step, purchaseState.error, purchaseState.tokenAmount, lang]); - if (!wallet.isConnected) { - return ( -
-

{t("buy_connect_msg")}

- { - // WalletSelector already called eth_requestAccounts and got the address - // Just show success toast; wallet state will auto-update via accountsChanged event - toast.success(lang === "zh" ? `已连接: ${addr.slice(0, 6)}...${addr.slice(-4)}` : `Connected: ${addr.slice(0, 6)}...${addr.slice(-4)}`); - }} - compact - /> -
{t("buy_connect_hint")}
-
- ); - } - - if (isWrongNetwork) { - return ( -
-
-
⚠️
-

{t("buy_wrong_network")}

-

{t("buy_wrong_msg")} {CONTRACTS[network].chainName}

- -
-
- ); - } - - if (purchaseState.step === "success") { + if (purchaseState.step === "success") { return (
🎉
@@ -425,16 +388,32 @@ function EVMPurchasePanel({ network, lang, wallet }: { network: "BSC" | "ETH"; l return (
- {/* Wallet info */} -
-
-
- {shortenAddress(wallet.address || "")} + {/* Wallet info — only shown when connected */} + {wallet.isConnected && !isWrongNetwork && ( +
+
+
+ {shortenAddress(wallet.address || "")} +
+ {usdtBalance !== null && ( + {t("buy_balance")} {usdtBalance.toFixed(2)} USDT + )}
- {usdtBalance !== null && ( - {t("buy_balance")} {usdtBalance.toFixed(2)} USDT - )} -
+ )} + {/* Wrong network banner */} + {isWrongNetwork && ( +
+
⚠️
+

{t("buy_wrong_network")}

+

{t("buy_wrong_msg")} {CONTRACTS[network].chainName}

+ +
+ )} {/* USDT Amount Input */}
@@ -502,19 +481,34 @@ function EVMPurchasePanel({ network, lang, wallet }: { network: "BSC" | "ETH"; l
)} - {/* Buy Button */} - + {/* Buy Button — or Connect Wallet if not connected */} + {!wallet.isConnected ? ( +
+

{t("buy_connect_msg")}

+ { + toast.success(lang === "zh" ? `已连接: ${addr.slice(0, 6)}...${addr.slice(-4)}` : `Connected: ${addr.slice(0, 6)}...${addr.slice(-4)}`); + }} + compact + /> +
{t("buy_connect_hint")}
+
+ ) : isWrongNetwork ? null : ( + + )}

{PRESALE_CONFIG.maxPurchaseUSDT > 0