@@ -93,6 +93,33 @@ export function ChatBar(props: {
9393 < div className = "grow" >
9494 { props . showContextSelector && (
9595 < div className = "flex flex-wrap gap-2 [&>*]:w-auto" >
96+ { props . connectedWallets . length > 1 &&
97+ ! props . isConnectingWallet && (
98+ < WalletSelector
99+ client = { props . client }
100+ wallets = { props . connectedWallets }
101+ activeAccountAddress = { props . activeAccountAddress }
102+ onClick = { ( walletMeta ) => {
103+ props . setActiveWallet ( walletMeta ) ;
104+ props . setContext ( {
105+ walletAddress : walletMeta . address ,
106+ chainIds : props . context ?. chainIds || [ ] ,
107+ networks : props . context ?. networks || null ,
108+ } ) ;
109+ } }
110+ />
111+ ) }
112+
113+ { props . isConnectingWallet && (
114+ < Badge
115+ variant = "outline"
116+ className = "h-auto w-auto shrink-0 gap-1.5 px-2 py-1.5"
117+ >
118+ < Spinner className = "size-3" />
119+ < span > Connecting Wallet</ span >
120+ </ Badge >
121+ ) }
122+
96123 < MultiNetworkSelector
97124 client = { props . client }
98125 hideTestnets
@@ -145,33 +172,6 @@ export function ChatBar(props: {
145172 10 , // optimism
146173 ] }
147174 />
148-
149- { props . connectedWallets . length > 1 &&
150- ! props . isConnectingWallet && (
151- < WalletSelector
152- client = { props . client }
153- wallets = { props . connectedWallets }
154- activeAccountAddress = { props . activeAccountAddress }
155- onClick = { ( walletMeta ) => {
156- props . setActiveWallet ( walletMeta ) ;
157- props . setContext ( {
158- walletAddress : walletMeta . address ,
159- chainIds : props . context ?. chainIds || [ ] ,
160- networks : props . context ?. networks || null ,
161- } ) ;
162- } }
163- />
164- ) }
165-
166- { props . isConnectingWallet && (
167- < Badge
168- variant = "outline"
169- className = "h-auto w-auto shrink-0 gap-1.5 px-2 py-1.5"
170- >
171- < Spinner className = "size-3" />
172- < span > Connecting Wallet</ span >
173- </ Badge >
174- ) }
175175 </ div >
176176 ) }
177177 </ div >
@@ -251,6 +251,13 @@ function WalletSelector(props: {
251251 return null ;
252252 }
253253
254+ // show smart account first
255+ const sortedWallets = props . wallets . sort ( ( a , b ) => {
256+ if ( a . walletId === "smart" ) return - 1 ;
257+ if ( b . walletId === "smart" ) return 1 ;
258+ return 0 ;
259+ } ) ;
260+
254261 return (
255262 < Popover open = { open } onOpenChange = { setOpen } >
256263 < PopoverTrigger asChild >
@@ -289,7 +296,7 @@ function WalletSelector(props: {
289296 </ div >
290297
291298 < div className = "[&>*:not(:last-child)]:border-b" >
292- { props . wallets . map ( ( wallet ) => (
299+ { sortedWallets . map ( ( wallet ) => (
293300 // biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
294301 < div
295302 key = { wallet . address }
0 commit comments