11"use client" ;
2- import { Flex , FormControl } from "@chakra-ui/react" ;
32import { useMutation , useQuery } from "@tanstack/react-query" ;
43import { verifyContract } from "app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/sources/ContractSourcesPage" ;
5- import { FormHelperText , FormLabel } from "chakra/form" ;
6- import { Text } from "chakra/text" ;
74import {
85 ArrowUpFromLineIcon ,
96 CircleAlertIcon ,
@@ -27,6 +24,7 @@ import {
2724 reportContractDeployed ,
2825 reportContractDeployFailed ,
2926} from "@/analytics/report" ;
27+ import { FormFieldSetup } from "@/components/blocks/FormFieldSetup" ;
3028import { NetworkSelectorButton } from "@/components/misc/NetworkSelectorButton" ;
3129import { SolidityInput } from "@/components/solidity-inputs" ;
3230import {
@@ -932,14 +930,17 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
932930 < Fieldset legend = "Deploy Options" >
933931 < div className = "flex flex-col gap-6" >
934932 { /* Chain */ }
935- < FormControl isRequired >
936- < FormLabel > Chain</ FormLabel >
937-
938- < p className = "mb-3 text-muted-foreground text-sm" >
939- Select a network to deploy this contract on. We recommend
940- starting with a testnet
941- </ p >
942-
933+ < FormFieldSetup
934+ isRequired
935+ label = "Chain"
936+ errorMessage = { undefined }
937+ helperText = {
938+ < span >
939+ Select a network to deploy this contract on. We recommend
940+ starting with a testnet
941+ </ span >
942+ }
943+ >
943944 < div className = "flex flex-col gap-3" >
944945 < div className = "flex flex-col gap-4 md:flex-row" >
945946 < NetworkSelectorButton
@@ -953,7 +954,6 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
953954 : metadata ?. networksForDeployment ?. networksEnabled
954955 }
955956 />
956-
957957 < Button asChild variant = "outline" >
958958 < Link
959959 className = "gap-3"
@@ -967,12 +967,11 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
967967 </ Button >
968968 </ div >
969969 </ div >
970- </ FormControl >
970+ </ FormFieldSetup >
971971
972972 { metadata ?. deployType === "standard" && (
973973 < >
974974 { /* Deterministic deploy */ }
975-
976975 < div className = "flex flex-col gap-3" >
977976 < CheckboxWithLabel >
978977 < Checkbox
@@ -1006,16 +1005,21 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
10061005
10071006 { /* Optional Salt Input */ }
10081007 { isCreate2Deployment && (
1009- < FormControl >
1010- < Flex alignItems = "center" my = { 1 } >
1011- < FormLabel display = "flex" flex = "1" mb = { 0 } >
1012- < Flex alignItems = "baseline" gap = { 1 } >
1013- Optional Salt Input
1014- < Text size = "label.sm" > (saltForCreate2)</ Text >
1015- </ Flex >
1016- </ FormLabel >
1017- < FormHelperText mt = { 0 } > string</ FormHelperText >
1018- </ Flex >
1008+ < FormFieldSetup
1009+ isRequired = { false }
1010+ label = {
1011+ < span className = "flex items-center gap-1" >
1012+ Optional Salt Input
1013+ < span className = "font-normal text-muted-foreground text-xs" >
1014+ (saltForCreate2)
1015+ </ span >
1016+ </ span >
1017+ }
1018+ errorMessage = {
1019+ form . getFieldState ( "saltForCreate2" , form . formState )
1020+ . error ?. message
1021+ }
1022+ >
10191023 < SolidityInput
10201024 solidityType = "string"
10211025 { ...form . register ( "saltForCreate2" ) }
@@ -1034,7 +1038,7 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
10341038 Include deployer wallet address in salt (recommended)
10351039 </ span >
10361040 </ CheckboxWithLabel >
1037- </ FormControl >
1041+ </ FormFieldSetup >
10381042 ) }
10391043 </ >
10401044 ) }
0 commit comments