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
1aa287e9
Commit
1aa287e9
authored
Aug 30, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable submit if not valid
parent
bfca599a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
12 deletions
+14
-12
ApiKeyForm.tsx
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
+2
-2
CustomAbiForm.tsx
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
+2
-2
AddressForm.tsx
ui/privateTags/AddressModal/AddressForm.tsx
+2
-2
TransactionForm.tsx
ui/privateTags/TransactionModal/TransactionForm.tsx
+2
-2
PublicTagsForm.tsx
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
+2
-2
AddressForm.tsx
ui/watchlist/AddressModal/AddressForm.tsx
+4
-2
No files found.
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
View file @
1aa287e9
...
...
@@ -32,7 +32,7 @@ type Inputs = {
const
NAME_MAX_LENGTH
=
255
;
const
ApiKeyForm
:
React
.
FC
<
Props
>
=
({
data
,
onClose
,
setAlertVisible
})
=>
{
const
{
control
,
handleSubmit
,
formState
:
{
errors
},
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
mode
:
'
all
'
,
defaultValues
:
{
token
:
data
?.
api_key
||
''
,
...
...
@@ -143,7 +143,7 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
>
{
data
?
'
Save
'
:
'
Generate API key
'
}
...
...
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
View file @
1aa287e9
...
...
@@ -36,7 +36,7 @@ type Inputs = {
const
NAME_MAX_LENGTH
=
255
;
const
CustomAbiForm
:
React
.
FC
<
Props
>
=
({
data
,
onClose
,
setAlertVisible
})
=>
{
const
{
control
,
formState
:
{
errors
},
handleSubmit
,
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
formState
:
{
errors
,
isValid
},
handleSubmit
,
setError
}
=
useForm
<
Inputs
>
({
defaultValues
:
{
contract_address_hash
:
data
?.
contract_address_hash
||
''
,
name
:
data
?.
name
||
''
,
...
...
@@ -164,7 +164,7 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
>
{
data
?
'
Save
'
:
'
Create custom ABI
'
}
...
...
ui/privateTags/AddressModal/AddressForm.tsx
View file @
1aa287e9
...
...
@@ -32,7 +32,7 @@ type Inputs = {
const
AddressForm
:
React
.
FC
<
Props
>
=
({
data
,
onClose
,
setAlertVisible
})
=>
{
const
[
pending
,
setPending
]
=
useState
(
false
);
const
{
control
,
handleSubmit
,
formState
:
{
errors
},
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
mode
:
'
all
'
,
defaultValues
:
{
address
:
data
?.
address_hash
||
''
,
...
...
@@ -117,7 +117,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
isLoading=
{
pending
}
>
{
data
?
'
Save changes
'
:
'
Add tag
'
}
...
...
ui/privateTags/TransactionModal/TransactionForm.tsx
View file @
1aa287e9
...
...
@@ -34,7 +34,7 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
const
[
pending
,
setPending
]
=
useState
(
false
);
const
formBackgroundColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
{
control
,
handleSubmit
,
formState
:
{
errors
},
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
mode
:
'
all
'
,
defaultValues
:
{
transaction
:
data
?.
transaction_hash
||
''
,
...
...
@@ -116,7 +116,7 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
isLoading=
{
pending
}
>
{
data
?
'
Save changes
'
:
'
Add tag
'
}
...
...
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
View file @
1aa287e9
...
...
@@ -57,7 +57,7 @@ const ADDRESS_INPUT_BUTTONS_WIDTH = 170;
const
PublicTagsForm
=
({
changeToDataScreen
,
data
}:
Props
)
=>
{
const
queryClient
=
useQueryClient
();
const
{
control
,
handleSubmit
,
formState
:
{
errors
},
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
defaultValues
:
{
fullName
:
data
?.
full_name
||
''
,
email
:
data
?.
email
||
''
,
...
...
@@ -223,7 +223,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
>
Send request
...
...
ui/watchlist/AddressModal/AddressForm.tsx
View file @
1aa287e9
...
...
@@ -72,7 +72,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
notificationsDefault
=
data
.
notification_settings
;
}
const
{
control
,
handleSubmit
,
formState
:
{
errors
},
setError
}
=
useForm
<
Inputs
>
({
const
{
control
,
handleSubmit
,
formState
:
{
errors
,
isValid
},
setError
}
=
useForm
<
Inputs
>
({
defaultValues
:
{
address
:
data
?.
address_hash
||
''
,
tag
:
data
?.
name
||
''
,
...
...
@@ -156,6 +156,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
control=
{
control
}
rules=
{
{
pattern
:
ADDRESS_REGEXP
,
required
:
true
,
}
}
render=
{
renderAddressInput
}
/>
...
...
@@ -166,6 +167,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
control=
{
control
}
rules=
{
{
maxLength
:
TAG_MAX_LENGTH
,
required
:
true
,
}
}
render=
{
renderTagInput
}
/>
...
...
@@ -188,7 +190,7 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
isLoading=
{
pending
}
disabled=
{
Object
.
keys
(
errors
).
length
>
0
}
disabled=
{
!
isValid
}
>
{
data
?
'
Save changes
'
:
'
Add address
'
}
</
Button
>
...
...
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