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
77de4413
Commit
77de4413
authored
Apr 12, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add callbacks to success screen
parent
0c3e28e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
10 deletions
+39
-10
AddressVerificationModal.tsx
ui/addressVerification/AddressVerificationModal.tsx
+20
-4
AddressVerificationStepSuccess.tsx
...ressVerification/steps/AddressVerificationStepSuccess.tsx
+3
-3
VerifiedAddresses.tsx
ui/pages/VerifiedAddresses.tsx
+16
-3
No files found.
ui/addressVerification/AddressVerificationModal.tsx
View file @
77de4413
...
@@ -15,9 +15,10 @@ interface Props {
...
@@ -15,9 +15,10 @@ interface Props {
isOpen
:
boolean
;
isOpen
:
boolean
;
onClose
:
()
=>
void
;
onClose
:
()
=>
void
;
onSubmit
:
(
address
:
VerifiedAddress
)
=>
void
;
onSubmit
:
(
address
:
VerifiedAddress
)
=>
void
;
onAddTokenInfoClick
:
(
address
:
string
)
=>
void
;
}
}
const
AddressVerificationModal
=
({
isOpen
,
onClose
,
onSubmit
}:
Props
)
=>
{
const
AddressVerificationModal
=
({
isOpen
,
onClose
,
onSubmit
,
onAddTokenInfoClick
}:
Props
)
=>
{
const
[
stepIndex
,
setStepIndex
]
=
React
.
useState
(
0
);
const
[
stepIndex
,
setStepIndex
]
=
React
.
useState
(
0
);
const
[
data
,
setData
]
=
React
.
useState
<
AddressVerificationFormFirstStepFields
&
AddressCheckStatusSuccess
>
({
address
:
''
,
signingMessage
:
''
});
const
[
data
,
setData
]
=
React
.
useState
<
AddressVerificationFormFirstStepFields
&
AddressCheckStatusSuccess
>
({
address
:
''
,
signingMessage
:
''
});
...
@@ -38,12 +39,27 @@ const AddressVerificationModal = ({ isOpen, onClose, onSubmit }: Props) => {
...
@@ -38,12 +39,27 @@ const AddressVerificationModal = ({ isOpen, onClose, onSubmit }: Props) => {
const
handleClose
=
React
.
useCallback
(()
=>
{
const
handleClose
=
React
.
useCallback
(()
=>
{
onClose
();
onClose
();
setStepIndex
(
0
);
setStepIndex
(
0
);
setData
({
address
:
''
,
signingMessage
:
''
});
},
[
onClose
]);
},
[
onClose
]);
const
handleAddTokenInfoClick
=
React
.
useCallback
(()
=>
{
onAddTokenInfoClick
(
data
.
address
);
handleClose
();
},
[
handleClose
,
data
.
address
,
onAddTokenInfoClick
]);
const
steps
=
[
const
steps
=
[
{
title
:
'
Verify new address ownership
'
,
content
:
<
AddressVerificationStepAddress
onContinue=
{
handleGoToSecondStep
}
/>
},
{
{
title
:
'
Copy and sign message
'
,
content
:
<
AddressVerificationStepSignature
{
...
data
}
onContinue=
{
handleGoToThirdStep
}
/>
},
title
:
'
Verify new address ownership
'
,
{
title
:
'
Congrats! Address is verified.
'
,
content
:
<
AddressVerificationStepSuccess
onShowListClick=
{
handleClose
}
onAddTokenClick=
{
handleClose
}
/>
},
content
:
<
AddressVerificationStepAddress
onContinue=
{
handleGoToSecondStep
}
/>,
},
{
title
:
'
Copy and sign message
'
,
content
:
<
AddressVerificationStepSignature
{
...
data
}
onContinue=
{
handleGoToThirdStep
}
/>,
},
{
title
:
'
Congrats! Address is verified.
'
,
content
:
<
AddressVerificationStepSuccess
onShowListClick=
{
handleClose
}
onAddTokenInfoClick=
{
handleAddTokenInfoClick
}
/>,
},
];
];
const
step
=
steps
[
stepIndex
];
const
step
=
steps
[
stepIndex
];
...
...
ui/addressVerification/steps/AddressVerificationStepSuccess.tsx
View file @
77de4413
...
@@ -3,10 +3,10 @@ import React from 'react';
...
@@ -3,10 +3,10 @@ import React from 'react';
interface
Props
{
interface
Props
{
onShowListClick
:
()
=>
void
;
onShowListClick
:
()
=>
void
;
onAddTokenClick
:
()
=>
void
;
onAddToken
Info
Click
:
()
=>
void
;
}
}
const
AddressVerificationStepSuccess
=
({
onAddTokenClick
,
onShowListClick
}:
Props
)
=>
{
const
AddressVerificationStepSuccess
=
({
onAddToken
Info
Click
,
onShowListClick
}:
Props
)
=>
{
return
(
return
(
<
Box
>
<
Box
>
<
Alert
status=
"success"
flexWrap=
"wrap"
whiteSpace=
"pre-wrap"
wordBreak=
"break-word"
mb=
{
3
}
display=
"inline-block"
>
<
Alert
status=
"success"
flexWrap=
"wrap"
whiteSpace=
"pre-wrap"
wordBreak=
"break-word"
mb=
{
3
}
display=
"inline-block"
>
...
@@ -19,7 +19,7 @@ const AddressVerificationStepSuccess = ({ onAddTokenClick, onShowListClick }: Pr
...
@@ -19,7 +19,7 @@ const AddressVerificationStepSuccess = ({ onAddTokenClick, onShowListClick }: Pr
<
Button
size=
"lg"
variant=
"outline"
onClick=
{
onShowListClick
}
>
<
Button
size=
"lg"
variant=
"outline"
onClick=
{
onShowListClick
}
>
View my verified addresses
View my verified addresses
</
Button
>
</
Button
>
<
Button
size=
"lg"
onClick=
{
onAddTokenClick
}
>
<
Button
size=
"lg"
onClick=
{
onAddToken
Info
Click
}
>
Add token information
Add token information
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
...
ui/pages/VerifiedAddresses.tsx
View file @
77de4413
...
@@ -29,6 +29,14 @@ const VerifiedAddresses = () => {
...
@@ -29,6 +29,14 @@ const VerifiedAddresses = () => {
});
});
const
applicationsQuery
=
useApiQuery
(
'
token_info_applications
'
,
{
const
applicationsQuery
=
useApiQuery
(
'
token_info_applications
'
,
{
pathParams
:
{
chainId
:
appConfig
.
network
.
id
,
id
:
undefined
},
pathParams
:
{
chainId
:
appConfig
.
network
.
id
,
id
:
undefined
},
queryOptions
:
{
select
:
(
data
)
=>
{
return
{
...
data
,
submissions
:
data
.
submissions
.
sort
((
a
,
b
)
=>
b
.
updatedAt
.
localeCompare
(
a
.
updatedAt
)),
};
},
},
});
});
const
queryClient
=
useQueryClient
();
const
queryClient
=
useQueryClient
();
...
@@ -155,8 +163,8 @@ const VerifiedAddresses = () => {
...
@@ -155,8 +163,8 @@ const VerifiedAddresses = () => {
<
chakra
.
p
fontWeight=
{
600
}
mt=
{
5
}
>
<
chakra
.
p
fontWeight=
{
600
}
mt=
{
5
}
>
Before starting, make sure that:
Before starting, make sure that:
</
chakra
.
p
>
</
chakra
.
p
>
<
OrderedList
>
<
OrderedList
ml=
{
6
}
>
<
ListItem
>
The source code for the smart contract is deployed on “
Network Name
”.
</
ListItem
>
<
ListItem
>
The source code for the smart contract is deployed on “
{
appConfig
.
network
.
name
}
”.
</
ListItem
>
<
ListItem
>
The source code is verified (if not yet verified, you can use this tool).
</
ListItem
>
<
ListItem
>
The source code is verified (if not yet verified, you can use this tool).
</
ListItem
>
</
OrderedList
>
</
OrderedList
>
<
chakra
.
div
mt=
{
5
}
>
<
chakra
.
div
mt=
{
5
}
>
...
@@ -172,7 +180,12 @@ const VerifiedAddresses = () => {
...
@@ -172,7 +180,12 @@ const VerifiedAddresses = () => {
skeletonProps=
{
{
customSkeleton
:
skeleton
}
}
skeletonProps=
{
{
customSkeleton
:
skeleton
}
}
/>
/>
{
addButton
}
{
addButton
}
<
AddressVerificationModal
isOpen=
{
modalProps
.
isOpen
}
onClose=
{
modalProps
.
onClose
}
onSubmit=
{
handleAddressSubmit
}
/>
<
AddressVerificationModal
isOpen=
{
modalProps
.
isOpen
}
onClose=
{
modalProps
.
onClose
}
onSubmit=
{
handleAddressSubmit
}
onAddTokenInfoClick=
{
handleItemAdd
}
/>
</
Page
>
</
Page
>
);
);
};
};
...
...
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