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
9327fb53
Commit
9327fb53
authored
Apr 13, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide add token in modal for non-token addresses
parent
c4991442
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
AddressVerificationModal.tsx
ui/addressVerification/AddressVerificationModal.tsx
+12
-2
AddressVerificationStepSuccess.tsx
...ressVerification/steps/AddressVerificationStepSuccess.tsx
+10
-6
No files found.
ui/addressVerification/AddressVerificationModal.tsx
View file @
9327fb53
...
...
@@ -11,6 +11,8 @@ import AddressVerificationStepAddress from './steps/AddressVerificationStepAddre
import
AddressVerificationStepSignature
from
'
./steps/AddressVerificationStepSignature
'
;
import
AddressVerificationStepSuccess
from
'
./steps/AddressVerificationStepSuccess
'
;
type
StateData
=
AddressVerificationFormFirstStepFields
&
AddressCheckStatusSuccess
&
{
isToken
?:
boolean
};
interface
Props
{
isOpen
:
boolean
;
onClose
:
()
=>
void
;
...
...
@@ -20,7 +22,7 @@ interface Props {
const
AddressVerificationModal
=
({
isOpen
,
onClose
,
onSubmit
,
onAddTokenInfoClick
}:
Props
)
=>
{
const
[
stepIndex
,
setStepIndex
]
=
React
.
useState
(
0
);
const
[
data
,
setData
]
=
React
.
useState
<
AddressVerificationFormFirstStepFields
&
AddressCheckStatusSuccess
>
({
address
:
''
,
signingMessage
:
''
});
const
[
data
,
setData
]
=
React
.
useState
<
StateData
>
({
address
:
''
,
signingMessage
:
''
});
const
handleGoToSecondStep
=
React
.
useCallback
((
firstStepResult
:
typeof
data
)
=>
{
setData
(
firstStepResult
);
...
...
@@ -30,6 +32,7 @@ const AddressVerificationModal = ({ isOpen, onClose, onSubmit, onAddTokenInfoCli
const
handleGoToThirdStep
=
React
.
useCallback
((
address
:
VerifiedAddress
)
=>
{
onSubmit
(
address
);
setStepIndex
((
prev
)
=>
prev
+
1
);
setData
((
prev
)
=>
({
...
prev
,
isToken
:
Boolean
(
address
.
metadata
.
tokenName
)
}));
},
[
onSubmit
]);
const
handleGoToPrevStep
=
React
.
useCallback
(()
=>
{
...
...
@@ -58,7 +61,14 @@ const AddressVerificationModal = ({ isOpen, onClose, onSubmit, onAddTokenInfoCli
},
{
title
:
'
Congrats! Address is verified.
'
,
content
:
<
AddressVerificationStepSuccess
onShowListClick=
{
handleClose
}
onAddTokenInfoClick=
{
handleAddTokenInfoClick
}
/>,
content
:
(
<
AddressVerificationStepSuccess
onShowListClick=
{
handleClose
}
onAddTokenInfoClick=
{
handleAddTokenInfoClick
}
isToken=
{
data
.
isToken
}
address=
{
data
.
address
}
/>
),
},
];
const
step
=
steps
[
stepIndex
];
...
...
ui/addressVerification/steps/AddressVerificationStepSuccess.tsx
View file @
9327fb53
...
...
@@ -4,24 +4,28 @@ import React from 'react';
interface
Props
{
onShowListClick
:
()
=>
void
;
onAddTokenInfoClick
:
()
=>
void
;
isToken
?:
boolean
;
address
:
string
;
}
const
AddressVerificationStepSuccess
=
({
onAddTokenInfoClick
,
onShowListClick
}:
Props
)
=>
{
const
AddressVerificationStepSuccess
=
({
onAddTokenInfoClick
,
onShowListClick
,
isToken
,
address
}:
Props
)
=>
{
return
(
<
Box
>
<
Alert
status=
"success"
flexWrap=
"wrap"
whiteSpace=
"pre-wrap"
wordBreak=
"break-word"
mb=
{
3
}
display=
"inline-block"
>
<
span
>
The address ownership for
</
span
>
<
chakra
.
span
fontWeight=
{
700
}
>
0xaba7161a7fb69c88e16ed9f455ce62b791ee4d03
</
chakra
.
span
>
<
chakra
.
span
fontWeight=
{
700
}
>
{
address
}
</
chakra
.
span
>
<
span
>
is verified.
</
span
>
</
Alert
>
<
p
>
You may now submit the “Add token information” request
</
p
>
<
Flex
alignItems=
"center"
mt=
{
8
}
columnGap=
{
5
}
flexWrap=
"wrap"
rowGap=
{
5
}
>
<
Button
size=
"lg"
variant=
"outline"
onClick=
{
onShowListClick
}
>
<
Button
size=
"lg"
variant=
{
isToken
?
'
outline
'
:
'
solid
'
}
onClick=
{
onShowListClick
}
>
View my verified addresses
</
Button
>
<
Button
size=
"lg"
onClick=
{
onAddTokenInfoClick
}
>
Add token information
</
Button
>
{
isToken
&&
(
<
Button
size=
"lg"
onClick=
{
onAddTokenInfoClick
}
>
Add token information
</
Button
>
)
}
</
Flex
>
</
Box
>
);
...
...
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