File tree Expand file tree Collapse file tree 2 files changed +9
-21
lines changed
app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components
components/contract-components/contract-deploy-form Expand file tree Collapse file tree 2 files changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -254,14 +254,9 @@ const royaltyInfoFormSchema = z.object({
254254 percentage : z
255255 . string ( )
256256 . min ( 1 , { message : "Invalid percentage" } )
257- . refine (
258- ( v ) => {
259- console . log ( "Number(v): " , Number ( v ) ) ;
260- if ( Number ( v ) === 0 ) return true ;
261- if ( Number ( v ) >= 0.01 && Number ( v ) <= 100 ) return true ;
262- } ,
263- { message : "Invalid percentage" } ,
264- ) ,
257+ . refine ( ( v ) => Number ( v ) === 0 || ( Number ( v ) >= 0.01 && Number ( v ) <= 100 ) , {
258+ message : "Invalid percentage" ,
259+ } ) ,
265260} ) ;
266261
267262export type RoyaltyInfoFormValues = z . infer < typeof royaltyInfoFormSchema > ;
@@ -371,16 +366,9 @@ const defaultRoyaltyFormSchema = z.object({
371366 percentage : z
372367 . string ( )
373368 . min ( 1 , { message : "Invalid percentage" } )
374- . refine (
375- ( v ) => {
376- console . log ( "Number(v): " , Number ( v ) ) ;
377- if ( Number ( v ) === 0 ) return true ;
378- if ( Number ( v ) >= 0.01 && Number ( v ) <= 100 ) return true ;
379- } ,
380- {
381- message : "Invalid percentage" ,
382- } ,
383- ) ,
369+ . refine ( ( v ) => Number ( v ) === 0 || ( Number ( v ) >= 0.01 && Number ( v ) <= 100 ) , {
370+ message : "Invalid percentage" ,
371+ } ) ,
384372} ) ;
385373
386374export type DefaultRoyaltyFormValues = z . infer < typeof defaultRoyaltyFormSchema > ;
Original file line number Diff line number Diff line change 1+ import { FormFieldSetup } from "@/components/blocks/FormFieldSetup" ;
12import { FormControl } from "@chakra-ui/react" ;
23import { SolidityInput } from "contract-ui/components/solidity-inputs" ;
34import type { UseFormRegisterReturn } from "react-hook-form" ;
45import { FormErrorMessage , FormHelperText , FormLabel } from "tw-components" ;
5- import { Fieldset } from "./common" ;
66
77interface SequentialTokenIdFieldsetProps {
88 isInvalid : boolean ;
@@ -14,7 +14,7 @@ export const SequentialTokenIdFieldset: React.FC<
1414 SequentialTokenIdFieldsetProps
1515> = ( props ) => {
1616 return (
17- < Fieldset legend = "Sequential Token ID" >
17+ < FormFieldSetup label = "Sequential Token ID" >
1818 < FormControl isRequired isInvalid = { props . isInvalid } >
1919 < FormLabel > Start Token ID</ FormLabel >
2020 < SolidityInput
@@ -29,6 +29,6 @@ export const SequentialTokenIdFieldset: React.FC<
2929 The starting token ID for the NFT collection.
3030 </ FormHelperText >
3131 </ FormControl >
32- </ Fieldset >
32+ </ FormFieldSetup >
3333 ) ;
3434} ;
You can’t perform that action at this time.
0 commit comments