Skip to content

Commit f7728bd

Browse files
committed
update
1 parent aad6586 commit f7728bd

File tree

12 files changed

+744
-233
lines changed

12 files changed

+744
-233
lines changed

.changeset/metal-mails-ring.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
- Add onClose callback to Connect Details modal
6+
7+
```tsx
8+
<ConnectButton
9+
detailsModal={{
10+
onClose: (screen: string) => {
11+
// The last screen name that was being shown when user closed the modal
12+
console.log({ screen });
13+
}
14+
}}
15+
/>
16+
```
17+
18+
- Small fix for ChainIcon: Always resolve IPFS URI
19+
20+
- Improve test coverage

packages/thirdweb/src/react/core/hooks/connection/ConnectButtonProps.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ export type ConnectButton_detailsModalOptions = {
339339
*/
340340
allowLinkingProfiles?: boolean;
341341
};
342+
343+
/**
344+
* @param screen The screen's name that was last shown when user closed the modal
345+
* @returns
346+
*/
347+
onClose?: (screen: string) => void;
342348
};
343349

344350
/**

packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,17 @@ const TW_CONNECT_WALLET = "tw-connect-wallet";
262262
* />
263263
* ```
264264
*
265+
* ### Callback for when the details modal is closed
266+
* ```tsx
267+
* <ConnectButton
268+
* detailsModal={{
269+
* onClose: (screen: string) => {
270+
* console.log({ screen });
271+
* }
272+
* }}
273+
* />
274+
* ```
275+
*
265276
* @param props
266277
* Props for the `ConnectButton` component
267278
*

0 commit comments

Comments
 (0)