88} from "@/components/ui/accordion" ;
99import { Alert , AlertTitle } from "@/components/ui/alert" ;
1010import { Button } from "@/components/ui/button" ;
11+ import { Checkbox , CheckboxWithLabel } from "@/components/ui/checkbox" ;
1112import {
1213 Form ,
1314 FormControl ,
@@ -47,6 +48,7 @@ export type UpdateFormValues = {
4748// TODO - add form validation with zod schema for mint form
4849
4950export type MintFormValues = NFTMetadataInputLimited & {
51+ useNextTokenId : boolean ;
5052 recipient : string ;
5153 amount : number ;
5254 supply : number ;
@@ -292,6 +294,7 @@ function MintNFTSection(props: {
292294} ) {
293295 const form = useForm < MintFormValues > ( {
294296 values : {
297+ useNextTokenId : false ,
295298 supply : 1 ,
296299 customImage : "" ,
297300 customAnimationUrl : "" ,
@@ -313,6 +316,8 @@ function MintNFTSection(props: {
313316 } ) ;
314317 } ;
315318
319+ const useNextTokenId = form . watch ( "useNextTokenId" ) ;
320+
316321 return (
317322 < Form { ...form } >
318323 < form onSubmit = { form . handleSubmit ( onSubmit ) } >
@@ -426,19 +431,39 @@ function MintNFTSection(props: {
426431 />
427432 ) }
428433
429- { ! props . isErc721 && ! props . isSequentialTokenIdInstalled && (
430- < FormField
431- control = { form . control }
432- name = "tokenId"
433- render = { ( { field } ) => (
434- < FormItem className = "flex-1" >
435- < FormLabel > Token ID</ FormLabel >
436- < FormControl >
437- < Input { ...field } />
438- </ FormControl >
439- </ FormItem >
440- ) }
441- />
434+ { ! props . isErc721 && (
435+ < div className = "relative flex-1" >
436+ < FormField
437+ control = { form . control }
438+ name = "tokenId"
439+ render = { ( { field } ) => (
440+ < FormItem className = "flex-1" >
441+ < FormLabel > Token ID</ FormLabel >
442+ < FormControl >
443+ < Input { ...field } disabled = { useNextTokenId } />
444+ </ FormControl >
445+ </ FormItem >
446+ ) }
447+ />
448+
449+ < FormField
450+ control = { form . control }
451+ name = "useNextTokenId"
452+ render = { ( { field } ) => (
453+ < FormItem className = "absolute top-0 right-0 flex items-center gap-2" >
454+ < CheckboxWithLabel >
455+ < Checkbox
456+ className = "mt-0"
457+ checked = { field . value }
458+ onCheckedChange = { field . onChange }
459+ />
460+ Use next token ID
461+ </ CheckboxWithLabel >
462+ < FormMessage />
463+ </ FormItem >
464+ ) }
465+ />
466+ </ div >
442467 ) }
443468 </ div >
444469
0 commit comments