@@ -93,6 +93,33 @@ export function ChatBar(props: {
93
93
< div className = "grow" >
94
94
{ props . showContextSelector && (
95
95
< 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
+
96
123
< MultiNetworkSelector
97
124
client = { props . client }
98
125
hideTestnets
@@ -145,33 +172,6 @@ export function ChatBar(props: {
145
172
10 , // optimism
146
173
] }
147
174
/>
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
- ) }
175
175
</ div >
176
176
) }
177
177
</ div >
@@ -251,6 +251,13 @@ function WalletSelector(props: {
251
251
return null ;
252
252
}
253
253
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
+
254
261
return (
255
262
< Popover open = { open } onOpenChange = { setOpen } >
256
263
< PopoverTrigger asChild >
@@ -289,7 +296,7 @@ function WalletSelector(props: {
289
296
</ div >
290
297
291
298
< div className = "[&>*:not(:last-child)]:border-b" >
292
- { props . wallets . map ( ( wallet ) => (
299
+ { sortedWallets . map ( ( wallet ) => (
293
300
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
294
301
< div
295
302
key = { wallet . address }
0 commit comments