Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kien-ngo committed Dec 12, 2024
1 parent ce0da51 commit bbb3ab1
Show file tree
Hide file tree
Showing 10 changed files with 489 additions and 191 deletions.
20 changes: 20 additions & 0 deletions .changeset/metal-mails-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"thirdweb": patch
---

- Add onClose callback to Connect Details modal

```tsx
<ConnectButton
detailsModal={{
onClose: (screen: string) => {
// The last screen name that was being shown when user closed the modal
console.log({ screen });
}
}}
/>
```

- Small fix for ChainIcon: Always resolve IPFS URI

- Improve test coverage
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ export type ConnectButton_detailsModalOptions = {
* Note: Not all tokens are resolvable to a fiat value. In that case, nothing will be shown.
*/
showBalanceInFiat?: SupportedFiatCurrency;

/**
*
* @param screen The screen's name that was last shown when user closed the modal
* @returns
*/
onClose?: (screen: string) => void;
};

/**
Expand Down
11 changes: 11 additions & 0 deletions packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@ const TW_CONNECT_WALLET = "tw-connect-wallet";
* />
* ```
*
* ### Callback for when the details modal is closed
* ```tsx
* <ConnectButton
* detailsModal={{
* onClose: (screen: string) => {
* console.log({ screen });
* }
* }}
* />
* ```
*
* @param props
* Props for the `ConnectButton` component
*
Expand Down
Loading

0 comments on commit bbb3ab1

Please sign in to comment.