Skip to content

Commit

Permalink
Merge pull request #315 from aptos-labs/shadcn-selector-bug-fix
Browse files Browse the repository at this point in the history
Fix bug in shadcn/ui wallet selector
  • Loading branch information
blakezimmerman authored Jun 13, 2024
2 parents f4b8a2f + 716fd69 commit df124b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-cheetahs-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-nextjs-example": patch
---

Fixed a bug where "More wallets" would still be displayed in the shadcn/ui wallet selector even if there aren't more wallets.
26 changes: 14 additions & 12 deletions apps/nextjs-example/src/components/WalletSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,20 @@ function ConnectWalletDialog({ close }: ConnectWalletDialogProps) {
<WalletRow key={wallet.name} wallet={wallet} onConnect={close} />
))}
</div>
<Collapsible className="flex flex-col gap-4">
<CollapsibleTrigger asChild>
<Button size="sm" variant="ghost" className="gap-2">
More wallets <ChevronDown />
</Button>
</CollapsibleTrigger>
<CollapsibleContent className="flex flex-col gap-3">
{moreWallets.map((wallet) => (
<WalletRow key={wallet.name} wallet={wallet} onConnect={close} />
))}
</CollapsibleContent>
</Collapsible>
{!!moreWallets.length && (
<Collapsible className="flex flex-col gap-4">
<CollapsibleTrigger asChild>
<Button size="sm" variant="ghost" className="gap-2">
More wallets <ChevronDown />
</Button>
</CollapsibleTrigger>
<CollapsibleContent className="flex flex-col gap-3">
{moreWallets.map((wallet) => (
<WalletRow key={wallet.name} wallet={wallet} onConnect={close} />
))}
</CollapsibleContent>
</Collapsible>
)}
</DialogContent>
);
}
Expand Down

0 comments on commit df124b9

Please sign in to comment.