Skip to content

Commit bfea74d

Browse files
authored
feat(widgets): MultiProtocolWalletModal callback (#7226)
1 parent 643fe18 commit bfea74d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/gentle-mice-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperlane-xyz/widgets": minor
3+
---
4+
5+
Add optional callback for when protocol is selected in MultiProtocolWalletModal

typescript/widgets/src/walletIntegrations/MultiProtocolWalletModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ export function MultiProtocolWalletModal({
1111
isOpen,
1212
close,
1313
protocols,
14+
onProtocolSelected,
1415
}: {
1516
isOpen: boolean;
1617
close: () => void;
1718
protocols?: ProtocolType[]; // defaults to all protocols if not provided
19+
onProtocolSelected?: (protocol: ProtocolType) => void;
1820
}) {
1921
const connectFns = useConnectFns();
2022

2123
const onClickProtocol = (protocol: ProtocolType) => {
2224
close();
2325
const connectFn = connectFns[protocol];
26+
if (onProtocolSelected) onProtocolSelected(protocol);
2427
if (connectFn) connectFn();
2528
};
2629

0 commit comments

Comments
 (0)