Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
e4c382c8
Commit
e4c382c8
authored
Dec 06, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update form layout and button styling
parent
70cfab2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
ContractMethodCallable.tsx
ui/address/contract/ContractMethodCallable.tsx
+7
-7
ContractMethodField.tsx
ui/address/contract/ContractMethodField.tsx
+19
-9
No files found.
ui/address/contract/ContractMethodCallable.tsx
View file @
e4c382c8
...
@@ -119,13 +119,11 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
...
@@ -119,13 +119,11 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
<
Box
>
<
Box
>
<
chakra
.
form
<
chakra
.
form
noValidate
noValidate
display=
"
flex
"
display=
"
grid
"
columnGap=
{
3
}
columnGap=
{
3
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
rowGap=
{
{
base
:
2
,
lg
:
3
}
}
rowGap=
{
2
}
gridTemplateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
minmax(min-content, 180px) minmax(0, 1fr)
'
}
}
alignItems=
{
{
base
:
'
flex-start
'
,
lg
:
'
center
'
}
}
onSubmit=
{
handleSubmit
(
onFormSubmit
)
}
onSubmit=
{
handleSubmit
(
onFormSubmit
)
}
flexWrap=
"wrap"
onChange=
{
handleFormChange
}
onChange=
{
handleFormChange
}
>
>
{
inputs
.
map
(({
type
,
name
},
index
)
=>
{
{
inputs
.
map
(({
type
,
name
},
index
)
=>
{
...
@@ -146,13 +144,15 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
...
@@ -146,13 +144,15 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
})
}
})
}
<
Button
<
Button
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
loadingText=
{
isWrite
?
'
Write
'
:
'
Query
'
}
loadingText=
{
isWrite
?
'
Write
'
:
'
Read
'
}
variant=
"outline"
variant=
"outline"
size=
"sm"
size=
"sm"
flexShrink=
{
0
}
flexShrink=
{
0
}
width=
"min-content"
px=
{
4
}
type=
"submit"
type=
"submit"
>
>
{
isWrite
?
'
Write
'
:
'
Query
'
}
{
isWrite
?
'
Write
'
:
'
Read
'
}
</
Button
>
</
Button
>
</
chakra
.
form
>
</
chakra
.
form
>
{
'
outputs
'
in
data
&&
!
isWrite
&&
data
.
outputs
.
length
>
0
&&
(
{
'
outputs
'
in
data
&&
!
isWrite
&&
data
.
outputs
.
length
>
0
&&
(
...
...
ui/address/contract/ContractMethodField.tsx
View file @
e4c382c8
import
{
import
{
Box
,
FormControl
,
FormControl
,
Input
,
Input
,
InputGroup
,
InputGroup
,
...
@@ -50,9 +51,8 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
...
@@ -50,9 +51,8 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
return
(
return
(
<
FormControl
<
FormControl
id=
{
name
}
id=
{
name
}
flexBasis=
{
{
base
:
'
100%
'
,
lg
:
'
calc((100% - 24px) / 3 - 65px)
'
}
}
w=
"100%"
w=
{
{
base
:
'
100%
'
,
lg
:
'
auto
'
}
}
mb=
{
{
base
:
1
,
lg
:
0
}
}
flexGrow=
{
1
}
isDisabled=
{
isDisabled
}
isDisabled=
{
isDisabled
}
>
>
<
InputGroup
size=
"xs"
>
<
InputGroup
size=
"xs"
>
...
@@ -61,6 +61,7 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
...
@@ -61,6 +61,7 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
ref=
{
ref
}
ref=
{
ref
}
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
paddingRight=
{
hasZerosControl
?
'
120px
'
:
'
40px
'
}
paddingRight=
{
hasZerosControl
?
'
120px
'
:
'
40px
'
}
autoComplete=
"off"
/>
/>
<
InputRightElement
w=
"auto"
right=
{
1
}
>
<
InputRightElement
w=
"auto"
right=
{
1
}
>
{
field
.
value
&&
<
ClearButton
onClick=
{
handleClear
}
isDisabled=
{
isDisabled
}
/>
}
{
field
.
value
&&
<
ClearButton
onClick=
{
handleClear
}
isDisabled=
{
isDisabled
}
/>
}
...
@@ -72,12 +73,21 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
...
@@ -72,12 +73,21 @@ const ContractMethodField = ({ control, name, valueType, placeholder, setValue,
},
[
name
,
isDisabled
,
placeholder
,
hasZerosControl
,
handleClear
,
handleAddZeroesClick
]);
},
[
name
,
isDisabled
,
placeholder
,
hasZerosControl
,
handleClear
,
handleAddZeroesClick
]);
return
(
return
(
<
Controller
<>
name=
{
name
}
<
Box
control=
{
control
}
fontWeight=
{
500
}
render=
{
renderInput
}
lineHeight=
"20px"
/>
py=
{
{
lg
:
'
6px
'
}
}
fontSize=
"sm"
>
{
name
}
(
{
valueType
}
)
</
Box
>
<
Controller
name=
{
name
}
control=
{
control
}
render=
{
renderInput
}
/>
</>
);
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment