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
78473d22
Commit
78473d22
authored
Apr 06, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass correct address
parent
d285e058
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
VerifiedAddresses.tsx
ui/pages/VerifiedAddresses.tsx
+8
-8
TokenInfoForm.tsx
ui/tokenInfo/TokenInfoForm.tsx
+5
-5
No files found.
ui/pages/VerifiedAddresses.tsx
View file @
78473d22
...
...
@@ -17,7 +17,7 @@ import VerifiedAddressesTable from 'ui/verifiedAddresses/VerifiedAddressesTable'
const
VerifiedAddresses
=
()
=>
{
useRedirectForInvalidAuthToken
();
const
[
s
ubmissionId
,
setSubmissionId
]
=
React
.
useState
<
number
>
();
const
[
s
electedAddress
,
setSelectedAddress
]
=
React
.
useState
<
string
>
();
const
modalProps
=
useDisclosure
();
const
{
data
,
isLoading
,
isError
}
=
useApiQuery
(
'
verified_addresses
'
,
{
...
...
@@ -25,11 +25,11 @@ const VerifiedAddresses = () => {
});
const
handleGoBack
=
React
.
useCallback
(()
=>
{
setS
ubmissionId
(
undefined
);
setS
electedAddress
(
undefined
);
},
[]);
const
handleItemAdd
=
React
.
useCallback
(()
=>
{
setS
ubmissionId
(
NaN
);
const
handleItemAdd
=
React
.
useCallback
((
address
:
string
)
=>
{
setS
electedAddress
(
address
);
},
[]);
const
handleItemEdit
=
React
.
useCallback
(()
=>
{},
[]);
...
...
@@ -53,7 +53,7 @@ const VerifiedAddresses = () => {
);
const
backLink
=
React
.
useMemo
(()
=>
{
if
(
submissionId
===
undefined
)
{
if
(
!
selectedAddress
)
{
return
;
}
...
...
@@ -61,13 +61,13 @@ const VerifiedAddresses = () => {
label
:
'
Back to my verified addresses
'
,
onClick
:
handleGoBack
,
};
},
[
handleGoBack
,
s
ubmissionId
]);
},
[
handleGoBack
,
s
electedAddress
]);
if
(
s
ubmissionId
!==
undefined
)
{
if
(
s
electedAddress
)
{
return
(
<
Page
>
<
PageTitle
text=
"Token info application form"
backLink=
{
backLink
}
/>
<
TokenInfoForm
id=
{
submissionId
}
/>
<
TokenInfoForm
address=
{
selectedAddress
}
/>
</
Page
>
);
}
...
...
ui/tokenInfo/TokenInfoForm.tsx
View file @
78473d22
...
...
@@ -26,10 +26,10 @@ import TokenInfoFieldSupport from './fields/TokenInfoFieldSupport';
import
TokenInfoFormSectionHeader
from
'
./TokenInfoFormSectionHeader
'
;
interface
Props
{
id
:
number
;
address
:
string
;
}
const
TokenInfoForm
=
({
id
}:
Props
)
=>
{
const
TokenInfoForm
=
({
address
}:
Props
)
=>
{
const
configQuery
=
useApiQuery
(
'
token_info_application_config
'
,
{
pathParams
:
{
chainId
:
appConfig
.
network
.
id
},
...
...
@@ -38,15 +38,15 @@ const TokenInfoForm = ({ id }: Props) => {
const
formApi
=
useForm
<
Fields
>
({
mode
:
'
onBlur
'
,
defaultValues
:
{
address
:
'
0x9d2a7b2b09b1d4786e36699d9f56b8c04e92cbb9
'
,
address
,
},
});
const
{
handleSubmit
,
formState
,
control
,
trigger
}
=
formApi
;
const
onFormSubmit
:
SubmitHandler
<
Fields
>
=
React
.
useCallback
(
async
(
data
)
=>
{
// eslint-disable-next-line no-console
console
.
log
(
'
__>__
'
,
id
,
data
);
},
[
id
]);
console
.
log
(
'
__>__
'
,
data
);
},
[
]);
const
onSubmit
=
handleSubmit
(
onFormSubmit
);
...
...
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