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() {
4040 } ) ;
4141
4242 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+ />
6257 ) ;
6358}
6459
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export function useTransactionDetails({
5757 "transaction-details" ,
5858 transaction . to ,
5959 transaction . chain . id ,
60- transaction . erc20Value ,
60+ transaction . erc20Value ?. toString ( ) ,
6161 ] ,
6262 queryFn : async ( ) : Promise < TransactionDetails > => {
6363 // Create contract instance for metadata fetching
Original file line number Diff line number Diff line change @@ -198,17 +198,6 @@ type UIOptionsResult =
198198 * />
199199 * ```
200200 *
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- *
212201 * ### Customize the UI
213202 *
214203 * 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 =
201201 * />
202202 * ```
203203 *
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- *
221204 * ### Customize the UI
222205 *
223206 * 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