File tree Expand file tree Collapse file tree 5 files changed +20
-48
lines changed
apps/playground-web/src/components/pay
packages/thirdweb/src/react Expand file tree Collapse file tree 5 files changed +20
-48
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Fix setting explicit amount on TransactionWidget
Original file line number Diff line number Diff line change @@ -40,25 +40,20 @@ export function PayTransactionPreview() {
40
40
} ) ;
41
41
42
42
return (
43
- < >
44
- < StyledConnectButton />
45
- < div className = "h-10" />
46
- { account && (
47
- < TransactionWidget
48
- client = { THIRDWEB_CLIENT }
49
- theme = { theme === "light" ? "light" : "dark" }
50
- transaction = { claimTo ( {
51
- contract : nftContract ,
52
- quantity : 1n ,
53
- tokenId : 2n ,
54
- to : account ?. address || "" ,
55
- } ) }
56
- title = { nft ?. metadata ?. name }
57
- description = { nft ?. metadata ?. description }
58
- image = { nft ?. metadata ?. image }
59
- />
60
- ) }
61
- </ >
43
+ < TransactionWidget
44
+ client = { THIRDWEB_CLIENT }
45
+ theme = { theme === "light" ? "light" : "dark" }
46
+ transaction = { claimTo ( {
47
+ contract : nftContract ,
48
+ quantity : 1n ,
49
+ tokenId : 2n ,
50
+ to : account ?. address || "" ,
51
+ } ) }
52
+ amount = { 100n }
53
+ title = { nft ?. metadata ?. name }
54
+ description = { nft ?. metadata ?. description }
55
+ image = { nft ?. metadata ?. image }
56
+ />
62
57
) ;
63
58
}
64
59
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export function useTransactionDetails({
57
57
"transaction-details" ,
58
58
transaction . to ,
59
59
transaction . chain . id ,
60
- transaction . erc20Value ,
60
+ transaction . erc20Value ?. toString ( ) ,
61
61
] ,
62
62
queryFn : async ( ) : Promise < TransactionDetails > => {
63
63
// Create contract instance for metadata fetching
Original file line number Diff line number Diff line change @@ -198,17 +198,6 @@ type UIOptionsResult =
198
198
* />
199
199
* ```
200
200
*
201
- * ### Enable/Disable payment methods
202
- *
203
- * You can use `disableOnramps` to prevent the use of onramps in the widget.
204
- *
205
- * ```tsx
206
- * <CheckoutWidget
207
- * client={client}
208
- * disableOnramps
209
- * />
210
- * ```
211
- *
212
201
* ### Customize the UI
213
202
*
214
203
* You can customize the UI of the `CheckoutWidget` component by passing a custom theme object to the `theme` prop.
Original file line number Diff line number Diff line change @@ -201,23 +201,6 @@ type UIOptionsResult =
201
201
* />
202
202
* ```
203
203
*
204
- * ### Enable/Disable payment methods
205
- *
206
- * You can use `disableOnramps` to prevent the use of onramps in the widget.
207
- *
208
- * ```tsx
209
- * <TransactionWidget
210
- * client={client}
211
- * transaction={prepareTransaction({
212
- * to: "0x...",
213
- * chain: ethereum,
214
- * client: client,
215
- * value: toUnits("0.001", 18),
216
- * })}
217
- * disableOnramps
218
- * />
219
- * ```
220
- *
221
204
* ### Customize the UI
222
205
*
223
206
* You can customize the UI of the `TransactionWidget` component by passing a custom theme object to the `theme` prop.
You can’t perform that action at this time.
0 commit comments