File tree Expand file tree Collapse file tree 3 files changed +31
-22
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy Expand file tree Collapse file tree 3 files changed +31
-22
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Respect buy with fiat disabled in pay embed
Original file line number Diff line number Diff line change @@ -558,6 +558,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
558
558
supportedSourcesQuery . data &&
559
559
sourceSupportedTokens && (
560
560
< TokenSelectorScreen
561
+ fiatSupported = { props . payOptions . buyWithFiat !== false }
561
562
client = { props . client }
562
563
sourceTokens = { sourceSupportedTokens }
563
564
sourceSupportedTokens = { sourceSupportedTokens }
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export function TokenSelectorScreen(props: {
69
69
onSelectToken : ( wallet : Wallet , token : TokenInfo , chain : Chain ) => void ;
70
70
onConnect : ( ) => void ;
71
71
onPayWithFiat : ( ) => void ;
72
+ fiatSupported : boolean ;
72
73
} ) {
73
74
const connectedWallets = useConnectedWallets ( ) ;
74
75
const activeAccount = useActiveAccount ( ) ;
@@ -255,29 +256,31 @@ export function TokenSelectorScreen(props: {
255
256
</ Text >
256
257
</ Container >
257
258
</ Button >
258
- < Button
259
- variant = "secondary"
260
- fullWidth
261
- onClick = { props . onPayWithFiat }
262
- bg = "tertiaryBg"
263
- style = { {
264
- border : `1px solid ${ theme . colors . borderColor } ` ,
265
- padding : spacing . sm ,
266
- } }
267
- >
268
- < Container
269
- flex = "row"
270
- gap = "sm"
271
- center = "y"
272
- expand
273
- color = "secondaryIconColor"
259
+ { props . fiatSupported && (
260
+ < Button
261
+ variant = "secondary"
262
+ fullWidth
263
+ onClick = { props . onPayWithFiat }
264
+ bg = "tertiaryBg"
265
+ style = { {
266
+ border : `1px solid ${ theme . colors . borderColor } ` ,
267
+ padding : spacing . sm ,
268
+ } }
274
269
>
275
- < CardStackIcon width = { iconSize . md } height = { iconSize . md } />
276
- < Text size = "sm" color = "primaryText" >
277
- Pay with credit card
278
- </ Text >
279
- </ Container >
280
- </ Button >
270
+ < Container
271
+ flex = "row"
272
+ gap = "sm"
273
+ center = "y"
274
+ expand
275
+ color = "secondaryIconColor"
276
+ >
277
+ < CardStackIcon width = { iconSize . md } height = { iconSize . md } />
278
+ < Text size = "sm" color = "primaryText" >
279
+ Pay with credit card
280
+ </ Text >
281
+ </ Container >
282
+ </ Button >
283
+ ) }
281
284
</ Container >
282
285
</ Container >
283
286
</ Container >
You can’t perform that action at this time.
0 commit comments