From 59953f714a2a81ce61990d8b1886134e51f7a241 Mon Sep 17 00:00:00 2001 From: MananTank Date: Mon, 28 Oct 2024 16:35:16 +0000 Subject: [PATCH] Fix MintSupplyTab Amount form field error (#5191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Short description of the bug fixed or feature added --- ## 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}` --- .../nfts/[tokenId]/components/mint-supply-tab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/mint-supply-tab.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/mint-supply-tab.tsx index 13dd68e8658..5512aa16857 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/mint-supply-tab.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/mint-supply-tab.tsx @@ -29,7 +29,7 @@ const mintAdditionalSupplyFormSchema = z.object({ to: z.string().refine((value) => isAddress(value), { message: "Invalid Ethereum address", }), - amount: z.number().int().min(1, "Amount must be at least 1"), + amount: z.coerce.number().int().min(1, "Amount must be at least 1"), }); const MintSupplyTab: React.FC = ({ contract, tokenId }) => { @@ -96,7 +96,7 @@ const MintSupplyTab: React.FC = ({ contract, tokenId }) => { Amount - + How many would you like to mint?