Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eight-pandas-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Respect buy with fiat disabled in pay embed
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
supportedSourcesQuery.data &&
sourceSupportedTokens && (
<TokenSelectorScreen
fiatSupported={props.payOptions.buyWithFiat !== false}
client={props.client}
sourceTokens={sourceSupportedTokens}
sourceSupportedTokens={sourceSupportedTokens}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function TokenSelectorScreen(props: {
onSelectToken: (wallet: Wallet, token: TokenInfo, chain: Chain) => void;
onConnect: () => void;
onPayWithFiat: () => void;
fiatSupported: boolean;
}) {
const connectedWallets = useConnectedWallets();
const activeAccount = useActiveAccount();
Expand Down Expand Up @@ -255,29 +256,31 @@ export function TokenSelectorScreen(props: {
</Text>
</Container>
</Button>
<Button
variant="secondary"
fullWidth
onClick={props.onPayWithFiat}
bg="tertiaryBg"
style={{
border: `1px solid ${theme.colors.borderColor}`,
padding: spacing.sm,
}}
>
<Container
flex="row"
gap="sm"
center="y"
expand
color="secondaryIconColor"
{props.fiatSupported && (
<Button
variant="secondary"
fullWidth
onClick={props.onPayWithFiat}
bg="tertiaryBg"
style={{
border: `1px solid ${theme.colors.borderColor}`,
padding: spacing.sm,
}}
>
<CardStackIcon width={iconSize.md} height={iconSize.md} />
<Text size="sm" color="primaryText">
Pay with credit card
</Text>
</Container>
</Button>
<Container
flex="row"
gap="sm"
center="y"
expand
color="secondaryIconColor"
>
<CardStackIcon width={iconSize.md} height={iconSize.md} />
<Text size="sm" color="primaryText">
Pay with credit card
</Text>
</Container>
</Button>
)}
</Container>
</Container>
</Container>
Expand Down
Loading