diff --git a/.changeset/calm-llamas-pretend.md b/.changeset/calm-llamas-pretend.md new file mode 100644 index 00000000000..78696a28ae9 --- /dev/null +++ b/.changeset/calm-llamas-pretend.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Add NFT extension: updateTokenURI diff --git a/apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx b/apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx index 579db60422d..28e40289f20 100644 --- a/apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx +++ b/apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx @@ -58,7 +58,7 @@ interface ListForm quantity: string; } -type NFTMintForm = { +type CreateListingsFormProps = { contract: ThirdwebContract; formId: string; type?: "direct-listings" | "english-auctions"; @@ -80,7 +80,7 @@ const auctionTimes = [ { label: "1 year", value: 60 * 60 * 24 * 365 }, ]; -export const CreateListingsForm: React.FC = ({ +export const CreateListingsForm: React.FC = ({ contract, formId, type, diff --git a/apps/dashboard/src/contract-ui/tabs/nfts/components/lazy-mint-button.tsx b/apps/dashboard/src/contract-ui/tabs/nfts/components/lazy-mint-button.tsx index 36d2ae6d4ea..048f43ff8b0 100644 --- a/apps/dashboard/src/contract-ui/tabs/nfts/components/lazy-mint-button.tsx +++ b/apps/dashboard/src/contract-ui/tabs/nfts/components/lazy-mint-button.tsx @@ -1,36 +1,21 @@ import { MinterOnly } from "@3rdweb-sdk/react/components/roles/minter-only"; import { Icon, useDisclosure } from "@chakra-ui/react"; -import { type useContract, useLazyMint } from "@thirdweb-dev/react"; -import { thirdwebClient } from "lib/thirdweb-client"; -import { useV5DashboardChain } from "lib/v5-adapter"; import { FiPlus } from "react-icons/fi"; -import { getContract } from "thirdweb"; +import type { ThirdwebContract } from "thirdweb"; import { Button, Drawer } from "tw-components"; -import { NFTMintForm } from "./mint-form"; +import { LazyMintNftForm } from "./lazy-mint-form"; interface NFTLazyMintButtonProps { - contractQuery: ReturnType; + contract: ThirdwebContract; + isErc721: boolean; } export const NFTLazyMintButton: React.FC = ({ - contractQuery, + contract, + isErc721, ...restButtonProps }) => { - const contractV4 = contractQuery.contract; - const chain = useV5DashboardChain(contractV4?.chainId); - const contract = - contractV4 && chain - ? getContract({ - address: contractV4.getAddress(), - chain: chain, - client: thirdwebClient, - }) - : null; const { isOpen, onOpen, onClose } = useDisclosure(); - const mutation = useLazyMint(contractV4); - if (!contract) { - return null; - } return ( = ({ onClose={onClose} isOpen={isOpen} > - +