Skip to content

[NEB-206] Nebula: UI element position tweaks in chat textarea #6886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 35 additions & 28 deletions apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@ export function ChatBar(props: {
<div className="grow">
{props.showContextSelector && (
<div className="flex flex-wrap gap-2 [&>*]:w-auto">
{props.connectedWallets.length > 1 &&
!props.isConnectingWallet && (
<WalletSelector
client={props.client}
wallets={props.connectedWallets}
activeAccountAddress={props.activeAccountAddress}
onClick={(walletMeta) => {
props.setActiveWallet(walletMeta);
props.setContext({
walletAddress: walletMeta.address,
chainIds: props.context?.chainIds || [],
networks: props.context?.networks || null,
});
}}
/>
)}

{props.isConnectingWallet && (
<Badge
variant="outline"
className="h-auto w-auto shrink-0 gap-1.5 px-2 py-1.5"
>
<Spinner className="size-3" />
<span>Connecting Wallet</span>
</Badge>
)}

<MultiNetworkSelector
client={props.client}
hideTestnets
Expand Down Expand Up @@ -145,33 +172,6 @@ export function ChatBar(props: {
10, // optimism
]}
/>

{props.connectedWallets.length > 1 &&
!props.isConnectingWallet && (
<WalletSelector
client={props.client}
wallets={props.connectedWallets}
activeAccountAddress={props.activeAccountAddress}
onClick={(walletMeta) => {
props.setActiveWallet(walletMeta);
props.setContext({
walletAddress: walletMeta.address,
chainIds: props.context?.chainIds || [],
networks: props.context?.networks || null,
});
}}
/>
)}

{props.isConnectingWallet && (
<Badge
variant="outline"
className="h-auto w-auto shrink-0 gap-1.5 px-2 py-1.5"
>
<Spinner className="size-3" />
<span>Connecting Wallet</span>
</Badge>
)}
</div>
)}
</div>
Expand Down Expand Up @@ -251,6 +251,13 @@ function WalletSelector(props: {
return null;
}

// show smart account first
const sortedWallets = props.wallets.sort((a, b) => {
if (a.walletId === "smart") return -1;
if (b.walletId === "smart") return 1;
return 0;
});

return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
Expand Down Expand Up @@ -289,7 +296,7 @@ function WalletSelector(props: {
</div>

<div className="[&>*:not(:last-child)]:border-b">
{props.wallets.map((wallet) => (
{sortedWallets.map((wallet) => (
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
<div
key={wallet.address}
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/components/buttons/MismatchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const MismatchButton = forwardRef<
HTMLButtonElement,
MistmatchButtonProps
>((props, ref) => {
const { txChainId, isLoggedIn, ...buttonProps } = props;
const { txChainId, isLoggedIn, isPending, ...buttonProps } = props;
const account = useActiveAccount();
const wallet = useActiveWallet();
const activeWalletChain = useActiveWalletChain();
Expand Down Expand Up @@ -161,7 +161,7 @@ export const MismatchButton = forwardRef<
// if user is about to trigger a transaction on txChain, but txChainBalance is not yet loaded and is required before proceeding
(!showSwitchChainPopover && txChainBalance.isPending && isBalanceRequired);

const showSpinner = props.isPending || switchNetworkMutation.isPending;
const showSpinner = isPending || switchNetworkMutation.isPending;

return (
<>
Expand Down
Loading