Skip to content

Commit 59953f7

Browse files
committed
Fix MintSupplyTab Amount form field error (#5191)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the validation and input handling for the minting amount in the `MintSupplyTab` component. It ensures that the amount is coerced to a number type and specifies the input type for better user experience. ### Detailed summary - Changed `amount` validation from `z.number()` to `z.coerce.number()` to ensure the input is coerced to a number. - Updated the `Input` component to include `type="number"` for the amount field, enhancing user input handling. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 7aab5ca commit 59953f7

File tree

1 file changed

+2
-2
lines changed
  • apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components

1 file changed

+2
-2
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/mint-supply-tab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const mintAdditionalSupplyFormSchema = z.object({
2929
to: z.string().refine((value) => isAddress(value), {
3030
message: "Invalid Ethereum address",
3131
}),
32-
amount: z.number().int().min(1, "Amount must be at least 1"),
32+
amount: z.coerce.number().int().min(1, "Amount must be at least 1"),
3333
});
3434

3535
const MintSupplyTab: React.FC<MintSupplyTabProps> = ({ contract, tokenId }) => {
@@ -96,7 +96,7 @@ const MintSupplyTab: React.FC<MintSupplyTabProps> = ({ contract, tokenId }) => {
9696
<FormItem>
9797
<FormLabel>Amount</FormLabel>
9898
<FormControl>
99-
<Input {...field} />
99+
<Input {...field} type="number" />
100100
</FormControl>
101101
<FormDescription>
102102
How many would you like to mint?

0 commit comments

Comments
 (0)