Skip to content

Commit 2c180e3

Browse files
committed
Update
1 parent b5bbecd commit 2c180e3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/ContractNFTPage.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ThirdwebContract } from "thirdweb";
22
import * as ERC721Ext from "thirdweb/extensions/erc721";
33
import * as ERC1155Ext from "thirdweb/extensions/erc1155";
44
import { BatchLazyMintButton } from "./components/batch-lazy-mint-button";
5+
import { BatchUpdateMetadataButton } from "./components/batch-update-metadata-button";
56
import { NFTClaimButton } from "./components/claim-button";
67
import { NFTLazyMintButton } from "./components/lazy-mint-button";
78
import { NFTMintButton } from "./components/mint-button";
@@ -51,6 +52,9 @@ export const ContractNFTPage: React.FC<NftOverviewPageProps> = ({
5152
const canCreateDelayedRevealBatch =
5253
ERC721Ext.isCreateDelayedRevealBatchSupported(functionSelectors);
5354

55+
const canBatchUpdateMetadata =
56+
ERC721Ext.isUpdateMetadataSupported(functionSelectors);
57+
5458
return (
5559
<div className="flex flex-col gap-6">
5660
<div className="flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between">
@@ -80,6 +84,13 @@ export const ContractNFTPage: React.FC<NftOverviewPageProps> = ({
8084
contract={contract}
8185
/>
8286
)}
87+
{canBatchUpdateMetadata && (
88+
<BatchUpdateMetadataButton
89+
contract={contract}
90+
canBatchUpdateMetadata={canBatchUpdateMetadata}
91+
isErc721={isErc721}
92+
/>
93+
)}
8394
</div>
8495
</div>
8596
{canShowSupplyCards && <SupplyCards contract={contract} />}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { ThirdwebContract } from "thirdweb";
2+
3+
type Props = {
4+
contract: ThirdwebContract;
5+
isErc721: boolean;
6+
canBatchUpdateMetadata: boolean;
7+
};
8+
/**
9+
* For DropERC721 contracts only
10+
*/
11+
export function BatchUpdateMetadataButton(props: Props) {
12+
if (!props.contract || !props.canBatchUpdateMetadata || !props.isErc721) {
13+
return null;
14+
}
15+
return <></>;
16+
}

0 commit comments

Comments
 (0)