File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ respect supportedTokens prop in PayEmbed
Original file line number Diff line number Diff line change 11import { useQueryClient } from "@tanstack/react-query" ;
22import { useCallback , useMemo , useState } from "react" ;
33import type { Chain } from "../../../../../../chains/types.js" ;
4+ import { getCachedChain } from "../../../../../../chains/utils.js" ;
45import type { ThirdwebClient } from "../../../../../../client/client.js" ;
56import { NATIVE_TOKEN_ADDRESS } from "../../../../../../constants/addresses.js" ;
67import type { BuyWithCryptoStatus } from "../../../../../../pay/buyWithCrypto/getStatus.js" ;
@@ -112,10 +113,21 @@ export default function BuyScreen(props: BuyScreenProps) {
112113 return < LoadingScreen /> ;
113114 }
114115
116+ const supportedDestinations = props . supportedTokens
117+ ? Object . entries ( props . supportedTokens ) . map ( ( [ chainId , tokens ] ) => ( {
118+ chain : getCachedChain ( Number . parseInt ( chainId ) ) ,
119+ tokens : tokens . map ( ( t ) => ( {
120+ ...t ,
121+ buyWithCryptoEnabled : true ,
122+ buyWithFiatEnabled : true ,
123+ } ) ) ,
124+ } ) )
125+ : supportedDestinationsQuery . data ;
126+
115127 return (
116128 < BuyScreenContent
117129 { ...props }
118- supportedDestinations = { supportedDestinationsQuery . data }
130+ supportedDestinations = { supportedDestinations }
119131 />
120132 ) ;
121133}
You can’t perform that action at this time.
0 commit comments