Skip to content

Commit 7241d6a

Browse files
committed
[NEB-206] Nebula: UI element position tweaks in chat textarea
1 parent 3d2324d commit 7241d6a

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx

+35-28
Original file line numberDiff line numberDiff line change
@@ -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}

apps/dashboard/src/components/buttons/MismatchButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const MismatchButton = forwardRef<
8686
HTMLButtonElement,
8787
MistmatchButtonProps
8888
>((props, ref) => {
89-
const { txChainId, isLoggedIn, ...buttonProps } = props;
89+
const { txChainId, isLoggedIn, isPending, ...buttonProps } = props;
9090
const account = useActiveAccount();
9191
const wallet = useActiveWallet();
9292
const activeWalletChain = useActiveWalletChain();
@@ -161,7 +161,7 @@ export const MismatchButton = forwardRef<
161161
// if user is about to trigger a transaction on txChain, but txChainBalance is not yet loaded and is required before proceeding
162162
(!showSwitchChainPopover && txChainBalance.isPending && isBalanceRequired);
163163

164-
const showSpinner = props.isPending || switchNetworkMutation.isPending;
164+
const showSpinner = isPending || switchNetworkMutation.isPending;
165165

166166
return (
167167
<>

0 commit comments

Comments
 (0)