- {displayPlanList.map((plan) => {
- const code = String(plan.plan_code || "");
- const active = code === selectedPlanCode;
- const isQuarterly = code === "pro_quarterly";
- return (
+
+
+
+
+ {copy.proPlan}
+
+
+ {displayPlanList.map((plan) => {
+ const code = String(plan.plan_code || "");
+ const active = code === selectedPlanCode;
+ const isQuarterly = code === "pro_quarterly";
+ return (
+
setSelectedPlanCode(code)}
+ disabled={paymentBusy}
+ className={`rounded-xl border px-3 py-3 text-left transition-all ${
+ active
+ ? "border-blue-300 bg-blue-50 text-blue-900"
+ : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
+ }`}
+ >
+
+
+ {isQuarterly ? copy.quarterlyPlan : copy.monthlyPlan}
+
+ {plan.amount_usdc} USDC
+
+
+ {code} · {plan.duration_days} 天
+
+
+ );
+ })}
+
+ {appliedReferralCode && selectedPlanCode === "pro_monthly" ? (
+
+ {copy.referralDiscountHint}
+
+ ) : null}
+
+
+
+
+ {copy.referralTitle}
+
+
+ {copy.referralInviteLimit}
+
+
+
+
+
+ {copy.referralMyCode}
+
+
+
+ {referralCode || "--"}
+
+ {referralCode ? (
+ handleCopy(referralCode)}
+ className="rounded-xl border border-blue-700 bg-blue-600 px-3 text-xs font-bold text-white hover:bg-blue-700"
+ >
+ {copied ? : }
+
+ ) : null}
+
+
+ {copy.referralRewardHint}
+
+
+
+
+ {copy.referralApplyLabel}
+
+ {appliedReferralCode ? (
+
+ {appliedReferralCode}
+
+ ) : (
+
+ setReferralCodeInput(event.target.value)}
+ placeholder={copy.referralApplyPlaceholder}
+ className="min-w-0 flex-1 rounded-xl border border-slate-300 bg-white px-3 py-2 text-xs text-slate-950 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20"
+ />
+ void applyReferralCode()}
+ disabled={!canApplyReferralCode || referralApplying}
+ className="rounded-xl border border-slate-900 bg-slate-900 px-3 text-xs font-bold text-white hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-50"
+ >
+ {referralApplying ? "..." : copy.referralApplyButton}
+
+
+ )}
+
+ {copy.referralDiscountHint}
+
+
+
+
+
+
+
+
+
+
+
+ {copy.paymentGuardHint}
+
+
+
+
+ {availableChainList.length > 1 && (
+
+
+ {copy.paymentNetwork}
+
+
+ {availableChainList.map((chain) => {
+ const active = chain.chain_id === selectedPaymentChainId;
+ return (
+
{
+ setSelectedPaymentChainId(chain.chain_id);
+ const nextToken =
+ paymentConfig?.tokens?.find(
+ (token) =>
+ Number(token.chain_id || chain.chain_id) ===
+ chain.chain_id &&
+ token.is_default,
+ ) ||
+ paymentConfig?.tokens?.find(
+ (token) =>
+ Number(token.chain_id || chain.chain_id) ===
+ chain.chain_id,
+ );
+ if (nextToken?.address) {
+ setSelectedTokenAddress(
+ String(nextToken.address).toLowerCase(),
+ );
+ }
+ }}
+ disabled={paymentBusy}
+ className={`rounded-xl border px-3 py-2 text-left transition-all ${
+ active
+ ? "border-blue-300 bg-blue-50 text-blue-900"
+ : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
+ }`}
+ >
+
+ {chain.name || chainIdToDisplayName(chain.chain_id)}
+
+
+ {chain.native_currency_symbol || "ETH"} gas
+
+
+ );
+ })}
+
+
+ )}
+ {availableTokenList.length > 0 && (
+
+
+ {copy.paymentToken}
+
+
+ {availableTokenList.map((token) => {
+ const active =
+ token.address ===
+ (resolvedSelectedTokenAddress ||
+ token.address);
+ return (
+
+ setSelectedTokenAddress(
+ token.address,
+ )
+ }
+ disabled={paymentBusy}
+ className={`rounded-xl border px-3 py-2 text-left transition-all ${
+ active
+ ? "border-blue-300 bg-blue-50 text-blue-900"
+ : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
+ }`}
+ >
+
+ {token.symbol}
+
+
+ {token.name}
+
+
+ );
+ })}
+
+
+ )}
+
+ {/* Payment Method Tabs */}
+
+
+ {copy.paymentMethodLabel}
+
+
setSelectedPlanCode(code)}
- disabled={paymentBusy}
- className={`rounded-xl border px-3 py-3 text-left transition-all ${
- active
- ? "border-blue-300 bg-blue-50 text-blue-900"
- : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
+ onClick={() => setPaymentMethodTab("wallet")}
+ className={`py-2 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5 ${
+ paymentMethodTab === "wallet"
+ ? "bg-white text-blue-700 shadow-sm"
+ : "text-slate-500 hover:bg-white/70 hover:text-slate-900"
}`}
>
-
-
- {isQuarterly ? copy.quarterlyPlan : copy.monthlyPlan}
-
- {plan.amount_usdc} USDC
-
-
- {code} · {plan.duration_days} 天
-
+
+ {copy.paymentMethodWallet}
+
+
setPaymentMethodTab("manual")}
+ className={`py-2 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5 ${
+ paymentMethodTab === "manual"
+ ? "bg-white text-emerald-700 shadow-sm"
+ : "text-slate-500 hover:bg-white/70 hover:text-slate-900"
+ }`}
+ >
+
+ {copy.paymentMethodManual}
- );
- })}
-
- {appliedReferralCode && selectedPlanCode === "pro_monthly" ? (
-
- {copy.referralDiscountHint}
-
- ) : null}
-
-
-
-
- {copy.referralTitle}
-
-
- {copy.referralInviteLimit}
-
-
-
-
-
- {copy.referralMyCode}
-
-
-
- {referralCode || "--"}
-
- {referralCode ? (
- handleCopy(referralCode)}
- className="rounded-xl border border-blue-700 bg-blue-600 px-3 text-xs font-bold text-white hover:bg-blue-700"
- >
- {copied ? : }
-
- ) : null}
-
- {copy.referralRewardHint}
-
-
-
-
- {copy.referralApplyLabel}
-
- {appliedReferralCode ? (
-
- {appliedReferralCode}
-
- ) : (
-
- setReferralCodeInput(event.target.value)}
- placeholder={copy.referralApplyPlaceholder}
- className="min-w-0 flex-1 rounded-xl border border-slate-300 bg-white px-3 py-2 text-xs text-slate-950 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20"
- />
- void applyReferralCode()}
- disabled={!canApplyReferralCode || referralApplying}
- className="rounded-xl border border-slate-900 bg-slate-900 px-3 text-xs font-bold text-white hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-50"
- >
- {referralApplying ? "..." : copy.referralApplyButton}
-
-
- )}
-
- {copy.referralDiscountHint}
-
-
-
-
-
-
-
-
-
-
-
- {copy.paymentGuardHint}
-
-
- {availableChainList.length > 1 && (
-
-
- {copy.paymentNetwork}
-
-
- {availableChainList.map((chain) => {
- const active = chain.chain_id === selectedPaymentChainId;
- return (
-
{
- setSelectedPaymentChainId(chain.chain_id);
- const nextToken =
- paymentConfig?.tokens?.find(
- (token) =>
- Number(token.chain_id || chain.chain_id) ===
- chain.chain_id &&
- token.is_default,
- ) ||
- paymentConfig?.tokens?.find(
- (token) =>
- Number(token.chain_id || chain.chain_id) ===
- chain.chain_id,
- );
- if (nextToken?.address) {
- setSelectedTokenAddress(
- String(nextToken.address).toLowerCase(),
- );
- }
- }}
- disabled={paymentBusy}
- className={`rounded-xl border px-3 py-2 text-left transition-all ${
- active
- ? "border-blue-300 bg-blue-50 text-blue-900"
- : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
- }`}
- >
-
- {chain.name || chainIdToDisplayName(chain.chain_id)}
-
-
- {chain.native_currency_symbol || "ETH"} gas
-
-
- );
- })}
-
-
- )}
- {availableTokenList.length > 0 && (
-
-
- {copy.paymentToken}
-
-
- {availableTokenList.map((token) => {
- const active =
- token.address ===
- (resolvedSelectedTokenAddress ||
- token.address);
- return (
-
- setSelectedTokenAddress(
- token.address,
- )
- }
- disabled={paymentBusy}
- className={`rounded-xl border px-3 py-2 text-left transition-all ${
- active
- ? "border-blue-300 bg-blue-50 text-blue-900"
- : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50"
- }`}
- >
-
- {token.symbol}
-
-
- {token.name}
-
-
- );
- })}
-
-
- )}
- {/* Payment Method Tabs */}
-
-
- {copy.paymentMethodLabel}
-
-
- setPaymentMethodTab("wallet")}
- className={`py-2 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5 ${
- paymentMethodTab === "wallet"
- ? "bg-white text-blue-700 shadow-sm"
- : "text-slate-500 hover:bg-white/70 hover:text-slate-900"
- }`}
- >
-
- {copy.paymentMethodWallet}
-
- setPaymentMethodTab("manual")}
- className={`py-2 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5 ${
- paymentMethodTab === "manual"
- ? "bg-white text-emerald-700 shadow-sm"
- : "text-slate-500 hover:bg-white/70 hover:text-slate-900"
- }`}
- >
-
- {copy.paymentMethodManual}
-
-
-
- {paymentMethodTab === "wallet" ? (
-
-
- {copy.paymentWalletDesc}
-
-
- {copy.paymentGasWarning}
-
+ {paymentMethodTab === "wallet" ? (
+
+
+ {copy.paymentWalletDesc}
+
+
+ {copy.paymentGasWarning}
+
{boundWallets.length ? (
@@ -1574,6 +1582,8 @@ export function AccountCenter() {
)}
+
+
) : (
diff --git a/frontend/components/account/__tests__/paymentShell.test.ts b/frontend/components/account/__tests__/paymentShell.test.ts
index e48df0ed..0af3e062 100644
--- a/frontend/components/account/__tests__/paymentShell.test.ts
+++ b/frontend/components/account/__tests__/paymentShell.test.ts
@@ -173,6 +173,21 @@ export function runTests() {
accountFeatureSource.includes("只有 USDC 可能无法完成授权或支付"),
"payment wallet tab must warn users that Polygon POL gas is required in addition to USDC",
);
+ assert(
+ !accountCenterSource.includes("md:w-96"),
+ "account payment management must not use a narrow fixed sidebar that creates an overlong column",
+ );
+ assert(
+ accountCenterSource.includes("items-start") &&
+ accountCenterSource.includes("xl:grid-cols-[minmax(0,0.9fr)_minmax(620px,1.1fr)]"),
+ "account secondary sections must align cards to the top and give payment management a wider responsive column",
+ );
+ assert(
+ accountCenterSource.includes("data-testid=\"payment-management-grid\"") &&
+ accountCenterSource.includes("lg:grid-cols-[minmax(0,1fr)_minmax(320px,380px)]") &&
+ accountCenterSource.includes("data-testid=\"payment-guard-grid\""),
+ "payment management must split plans/referrals from payment controls and compact guard details into grids",
+ );
assert(
!appAnalyticsSource.includes('NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS === "true"') &&
!analyticsRouteSource.includes('NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS === "true"'),