Commit 62afe258 authored by tom's avatar tom

change fields layout

parent 5d40648d
...@@ -72,7 +72,7 @@ const ContractRead = () => { ...@@ -72,7 +72,7 @@ const ContractRead = () => {
<AccordionIcon/> <AccordionIcon/>
</AccordionButton> </AccordionButton>
</h2> </h2>
<AccordionPanel pb={ 4 }> <AccordionPanel pb={ 4 } px={ 0 }>
{ item.inputs.length === 0 ? ( { item.inputs.length === 0 ? (
<Flex flexDir="column" rowGap={ 1 }> <Flex flexDir="column" rowGap={ 1 }>
{ item.outputs.map((output, index) => <ContractReadItemOutput key={ index } data={ output }/>) } { item.outputs.map((output, index) => <ContractReadItemOutput key={ index } data={ output }/>) }
......
...@@ -82,6 +82,7 @@ const ContractReadItemInput = ({ data, address, methodId, methodName, outputs }: ...@@ -82,6 +82,7 @@ const ContractReadItemInput = ({ data, address, methodId, methodName, outputs }:
rowGap={ 2 } rowGap={ 2 }
alignItems={{ base: 'flex-start', lg: 'center' }} alignItems={{ base: 'flex-start', lg: 'center' }}
onSubmit={ handleSubmit(onSubmit) } onSubmit={ handleSubmit(onSubmit) }
flexWrap="wrap"
> >
{ data.map(({ type, name }, index) => { { data.map(({ type, name }, index) => {
const fieldName = getFieldName(name, index); const fieldName = getFieldName(name, index);
......
...@@ -24,16 +24,18 @@ const ContractReadItemInputField = ({ control, name, placeholder, setValue }: Pr ...@@ -24,16 +24,18 @@ const ContractReadItemInputField = ({ control, name, placeholder, setValue }: Pr
const renderInput = React.useCallback(({ field }: { field: ControllerRenderProps<MethodInputFields> }) => { const renderInput = React.useCallback(({ field }: { field: ControllerRenderProps<MethodInputFields> }) => {
return ( return (
<FormControl id={ name }> <FormControl id={ name } maxW={{ base: '100%', lg: 'calc((100% - 24px) / 3)' }}>
<InputGroup size="xs"> <InputGroup size="xs">
<Input <Input
{ ...field } { ...field }
ref={ ref } ref={ ref }
placeholder={ placeholder } placeholder={ placeholder }
/> />
<InputRightElement> { field.value && (
<InputClearButton onClick={ handleClear }/> <InputRightElement>
</InputRightElement> <InputClearButton onClick={ handleClear }/>
</InputRightElement>
) }
</InputGroup> </InputGroup>
</FormControl> </FormControl>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment