1- import { FormControl , useBreakpointValue } from "@chakra-ui/react" ;
21import type { AbiParameter } from "abitype" ;
32import { useId , useState } from "react" ;
43import { useFormContext } from "react-hook-form" ;
@@ -12,6 +11,7 @@ import { Input } from "@/components/ui/input";
1211import { Separator } from "@/components/ui/separator" ;
1312import { Switch } from "@/components/ui/switch" ;
1413import { Textarea } from "@/components/ui/textarea" ;
14+ import { useIsMobile } from "@/hooks/use-mobile" ;
1515import { getTemplateValuesForType } from "@/lib/deployment/template-values" ;
1616import { DecodedInputArrayFieldset } from "./decoded-bytes-input/decoded-input-array-fieldset" ;
1717import { RefInputFieldset } from "./ref-contract-input/ref-input-fieldset" ;
@@ -25,7 +25,7 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
2525 client,
2626} ) => {
2727 const form = useFormContext ( ) ;
28- const isMobile = useBreakpointValue ( { base : true , md : false } ) ;
28+ const isMobile = useIsMobile ( ) ;
2929 const displayNameId = useId ( ) ;
3030 const descriptionId = useId ( ) ;
3131 const [ isCustomInputEnabledArray , setIsCustomInputEnabledArray ] = useState (
@@ -70,22 +70,20 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
7070
7171 return (
7272 < fieldset >
73- < h2 className = "font-semibold text-3xl tracking-tight" >
73+ < h2 className = "text-2xl font-semibold tracking-tight mb-1 " >
7474 Contract Parameters
7575 </ h2 >
76- < p className = "text-muted-foreground" >
76+ < p className = "text-muted-foreground text-sm mb-6 " >
7777 These are the parameters users will need to fill in when deploying this
7878 contract.
7979 </ p >
8080
81- < div className = "h-6" />
82-
8381 < div className = "flex flex-col gap-8" >
8482 { deployParams . map ( ( param , idx ) => {
8583 const paramTemplateValues = getTemplateValuesForType ( param . type ) ;
8684 return (
8785 < div
88- className = "rounded-lg border border-border bg-card p-6 "
86+ className = "rounded-lg border border-border bg-card p-4 "
8987 key = { `implementation_${ param . name } ` }
9088 >
9189 { /* Title + Type */ }
@@ -100,12 +98,12 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
10098 ) }
10199 </ h3 >
102100 < InlineCode
103- className = "px-2 text-base text- muted-foreground"
101+ className = "px-2 text-muted-foreground text-sm "
104102 code = { param . type }
105103 />
106104 </ div >
107105
108- < div className = "h-5 " />
106+ < div className = "h-4 " />
109107
110108 { /* Display Name */ }
111109 < FormFieldSetup
@@ -140,7 +138,7 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
140138 />
141139 </ FormFieldSetup >
142140
143- < div className = "h-5 " />
141+ < div className = "h-4 " />
144142
145143 { /* Description */ }
146144 < FormFieldSetup
@@ -217,25 +215,23 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
217215
218216 { /* Inputs */ }
219217 { ! isCustomInputEnabledArray [ idx ] ? (
220- < FormControl >
221- < SolidityInput
222- className = "!bg-background !text-sm placeholder:!text-sm"
223- client = { client }
224- placeholder = {
225- isMobile ||
226- paramTemplateValues ?. [ 0 ] ?. value ===
227- "{{trusted_forwarders}}"
228- ? "Pre-filled value."
229- : "This value will be pre-filled in the deploy form."
230- }
231- solidityType = { param . type }
232- { ...form . register (
233- `constructorParams.${
234- param . name ? param . name : "*"
235- } .defaultValue`,
236- ) }
237- />
238- </ FormControl >
218+ < SolidityInput
219+ className = "!bg-background !text-sm placeholder:!text-sm"
220+ client = { client }
221+ placeholder = {
222+ isMobile ||
223+ paramTemplateValues ?. [ 0 ] ?. value ===
224+ "{{trusted_forwarders}}"
225+ ? "Pre-filled value."
226+ : "This value will be pre-filled in the deploy form."
227+ }
228+ solidityType = { param . type }
229+ { ...form . register (
230+ `constructorParams.${
231+ param . name ? param . name : "*"
232+ } .defaultValue`,
233+ ) }
234+ />
239235 ) : param . type === "address" || param . type === "address[]" ? (
240236 < RefInputFieldset client = { client } param = { param } />
241237 ) : (
0 commit comments