Skip to content

Commit 21e1769

Browse files
committed
Update mint-supply-tab.tsx
1 parent a98b725 commit 21e1769

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

apps/dashboard/src/contract-ui/tabs/nfts/components/mint-supply-tab.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TransactionButton } from "components/buttons/TransactionButton";
55
import { useTrack } from "hooks/analytics/useTrack";
66
import { useForm } from "react-hook-form";
77
import { toast } from "sonner";
8-
import type { ThirdwebContract } from "thirdweb";
8+
import { type ThirdwebContract, isAddress } from "thirdweb";
99
import { mintAdditionalSupplyTo } from "thirdweb/extensions/erc1155";
1010
import { useActiveAccount, useSendAndConfirmTransaction } from "thirdweb/react";
1111
import { FormErrorMessage, FormHelperText, FormLabel } from "tw-components";
@@ -34,10 +34,8 @@ const MintSupplyTab: React.FC<MintSupplyTabProps> = ({ contract, tokenId }) => {
3434
<form
3535
className="flex w-full flex-col gap-2"
3636
onSubmit={handleSubmit((data) => {
37-
if (!data.to) {
38-
return toast.error(
39-
"Please enter the wallet address of the recipient.",
40-
);
37+
if (!isAddress(data.to)) {
38+
return toast.error("Address is invalid.");
4139
}
4240
trackEvent({
4341
category: "nft",
@@ -86,10 +84,8 @@ const MintSupplyTab: React.FC<MintSupplyTabProps> = ({ contract, tokenId }) => {
8684
placeholder="0x..."
8785
defaultValue={address || ""}
8886
{...register("to")}
87+
isRequired
8988
/>
90-
<FormHelperText>
91-
Address to receive the NFT(s) - Defaults to your own wallet
92-
</FormHelperText>
9389
<FormErrorMessage>{errors.to?.message}</FormErrorMessage>
9490
</FormControl>
9591
</div>

0 commit comments

Comments
 (0)