From 716fd69fe5039798e91405862d16bc400bb086e6 Mon Sep 17 00:00:00 2001 From: Blake Zimmerman Date: Thu, 13 Jun 2024 11:22:05 -0400 Subject: [PATCH] Fix bug in shadcn/ui wallet selector --- .changeset/fresh-cheetahs-promise.md | 5 ++++ .../src/components/WalletSelector.tsx | 26 ++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .changeset/fresh-cheetahs-promise.md diff --git a/.changeset/fresh-cheetahs-promise.md b/.changeset/fresh-cheetahs-promise.md new file mode 100644 index 00000000..cb28be57 --- /dev/null +++ b/.changeset/fresh-cheetahs-promise.md @@ -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. diff --git a/apps/nextjs-example/src/components/WalletSelector.tsx b/apps/nextjs-example/src/components/WalletSelector.tsx index 3b087874..6f06b01b 100644 --- a/apps/nextjs-example/src/components/WalletSelector.tsx +++ b/apps/nextjs-example/src/components/WalletSelector.tsx @@ -99,18 +99,20 @@ function ConnectWalletDialog({ close }: ConnectWalletDialogProps) { ))} - - - - - - {moreWallets.map((wallet) => ( - - ))} - - + {!!moreWallets.length && ( + + + + + + {moreWallets.map((wallet) => ( + + ))} + + + )} ); }