* Make nft drop contracts use custom contract page * Fix claim conditions detection of token drop * Hide tab until we fix erc20 cc * Fix hooks * Fix lgtm * Add MinterOnly checks * Only show burn/transfer/airdrop if balance > 0 * Fix token balance * Fix lgtm * Redirect old urls * Delete console.logs * Fix import * Add claim conditions banner * Use old code tab for prebuilts * Disable add button when conditions are saving * Only show banner to admins * Remove eslint disable * Use activeChainId * Don't render Drawer if not minter * Clean stuff * Stop breaking react * Improvypvyvpy * Show button but disable it * Save omg Co-authored-by: Jonas Daniels <[email protected]>
19 lines
461 B
TypeScript
19 lines
461 B
TypeScript
import { useIsMinter } from "@3rdweb-sdk/react";
|
|
import { ValidContractInstance } from "@thirdweb-dev/sdk";
|
|
import { ComponentWithChildren } from "types/component-with-children";
|
|
|
|
interface IMinterOnlyProps {
|
|
contract?: ValidContractInstance;
|
|
}
|
|
|
|
export const MinterOnly: ComponentWithChildren<IMinterOnlyProps> = ({
|
|
children,
|
|
contract,
|
|
}) => {
|
|
const isMinter = useIsMinter(contract);
|
|
if (!isMinter) {
|
|
return null;
|
|
}
|
|
return <>{children}</>;
|
|
};
|