@@ -9,6 +9,7 @@ import { CHAIN_LABELS, CHAIN_SHORT, chainKeyOf, explorerAddress, explorerName, s
99import { BRIDGE_CHAINS , isBridgeChainId } from "@/lib/bridge/types" ;
1010import { VISIBLE_CHAINS } from "@/lib/launchpad/config" ;
1111import WalletAvatar from "./WalletAvatar" ;
12+ import { ChainLogo } from "./launchpad/ChainLogo" ;
1213import styles from "./WalletMenu.module.css" ;
1314
1415/** Official network marks (app/public/brand). A chain with a dark-mode variant lists both; the CSS swaps them by theme. */
@@ -30,6 +31,16 @@ function NetworkLogo({ chain }: { chain: ChainKey }) {
3031 ) ;
3132}
3233
34+ /**
35+ * The header chip's network, pinned to the avatar's corner like the chain on a token avatar, or a warm "!" on a
36+ * network the site doesn't support. The chip's name for it pushed the Launch button out of the header, so only the
37+ * mobile row spells it out.
38+ */
39+ function NetworkBadge ( { chain } : { chain : ChainKey | null } ) {
40+ if ( ! chain ) return < span className = { styles . networkWarn } aria-hidden > !</ span > ;
41+ return < ChainLogo chain = { chain } size = { 14 } className = "absolute -right-1 -bottom-1 ring-2 ring-card" /> ;
42+ }
43+
3344type WalletMenuProps = {
3445 address : string ;
3546 chainId ?: number ;
@@ -100,11 +111,12 @@ function AccountMenu({ address, chainId, connectorName, block = false, switching
100111 < Popover . Trigger
101112 className = { `${ styles . trigger } ${ block ? styles . block : "" } ` }
102113 aria-label = { `Wallet ${ shortAddr ( address ) } , ${ network } . Open account menu` }
114+ title = { block ? undefined : key || bridgeNetwork ? `On ${ network } ` : "Unsupported network. Open to switch" }
103115 data-unsupported = { ( ! key && ! bridgeNetwork ) || undefined }
104116 >
105- < span className = { styles . triggerMark } > < WalletAvatar address = { address } /> < span className = { styles . connectionDot } /> </ span >
117+ < span className = { styles . triggerMark } > < WalletAvatar address = { address } /> { block ? < span className = { styles . connectionDot } /> : < NetworkBadge chain = { key ?? bridgeNetwork ?. key ?? null } /> } </ span >
106118 < span className = { styles . triggerAddress } > { shortAddr ( address ) } </ span >
107- < span className = { styles . triggerNetwork } > { key || bridgeNetwork ? network : "Switch" } </ span >
119+ { block ? < span className = { styles . triggerNetwork } > { key || bridgeNetwork ? network : "Switch" } </ span > : null }
108120 < ChevronDown size = { 13 } className = { styles . chevron } aria-hidden />
109121 </ Popover . Trigger >
110122 < Popover . Portal >
0 commit comments