Skip to content

Commit 0673b89

Browse files
committed
[MNY-180] SDK: Fix TransactionWidget not respecting currency prop
1 parent b5f9237 commit 0673b89

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

packages/thirdweb/src/react/core/hooks/useTransactionDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface UseTransactionDetailsOptions {
4545
transaction: PreparedTransaction;
4646
client: ThirdwebClient;
4747
wallet: Wallet | undefined;
48-
currency?: SupportedFiatCurrency;
48+
currency: SupportedFiatCurrency | undefined;
4949
}
5050

5151
/**

packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function TransactionPayment({
8989
client,
9090
transaction: uiOptions.transaction,
9191
wallet,
92+
currency: uiOptions.currency,
9293
});
9394

9495
// We can't use useWalletBalance here because erc20Value is a possibly async value

packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ const TransactionOverViewCompact = (props: {
210210
client: props.client,
211211
transaction: props.uiOptions.transaction,
212212
wallet: props.paymentMethod.payerWallet,
213+
currency: props.uiOptions.currency,
213214
});
214215

215216
if (!txInfo.data) {

packages/thirdweb/src/stories/Bridge/BridgeOrchestrator.stories.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,37 @@ export const TransactionLight: Story = {
241241
},
242242
};
243243

244+
/**
245+
* Transaction mode in light theme showing an ERC20 token transfer.
246+
*/
247+
export const TransactionJPYCurrency: Story = {
248+
args: {
249+
connectLocale: undefined,
250+
connectOptions: undefined,
251+
onCancel: undefined,
252+
onComplete: undefined,
253+
onError: undefined,
254+
paymentLinkId: undefined,
255+
presetOptions: undefined,
256+
purchaseData: undefined,
257+
receiverAddress: undefined,
258+
theme: "light",
259+
uiOptions: {
260+
...TRANSACTION_UI_OPTIONS.erc20Transfer,
261+
currency: "JPY",
262+
},
263+
},
264+
parameters: {
265+
backgrounds: { default: "light" },
266+
docs: {
267+
description: {
268+
story:
269+
"Light theme version of transaction mode showing an ERC20 token transfer with proper token amount formatting and USD conversion.",
270+
},
271+
},
272+
},
273+
};
274+
244275
export const CustompresetOptions: Story = {
245276
args: {
246277
connectLocale: undefined,

0 commit comments

Comments
 (0)