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 (
@@ -217,25 +217,23 @@ export const ContractParamsFieldset: React.FC<ContractParamsFieldsetProps> = ({
217217
218218 { /* Inputs */ }
219219 { ! 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 >
220+ < SolidityInput
221+ className = "!bg-background !text-sm placeholder:!text-sm"
222+ client = { client }
223+ placeholder = {
224+ isMobile ||
225+ paramTemplateValues ?. [ 0 ] ?. value ===
226+ "{{trusted_forwarders}}"
227+ ? "Pre-filled value."
228+ : "This value will be pre-filled in the deploy form."
229+ }
230+ solidityType = { param . type }
231+ { ...form . register (
232+ `constructorParams.${
233+ param . name ? param . name : "*"
234+ } .defaultValue`,
235+ ) }
236+ />
239237 ) : param . type === "address" || param . type === "address[]" ? (
240238 < RefInputFieldset client = { client } param = { param } />
241239 ) : (
0 commit comments