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
b220d03c
Commit
b220d03c
authored
May 09, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add icons to menu
parent
4681f509
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
+24
-13
Menu.tsx
ui/shared/AddressActions/Menu.tsx
+1
-1
PrivateTagMenuItem.tsx
ui/shared/AddressActions/PrivateTagMenuItem.tsx
+5
-3
PublicTagMenuItem.tsx
ui/shared/AddressActions/PublicTagMenuItem.tsx
+4
-2
TokenInfoMenuItem.tsx
ui/shared/AddressActions/TokenInfoMenuItem.tsx
+14
-7
No files found.
ui/shared/AddressActions/Menu.tsx
View file @
b220d03c
...
@@ -31,8 +31,8 @@ const AddressActions = () => {
...
@@ -31,8 +31,8 @@ const AddressActions = () => {
</
MenuButton
>
</
MenuButton
>
<
MenuList
minWidth=
"180px"
zIndex=
"popover"
>
<
MenuList
minWidth=
"180px"
zIndex=
"popover"
>
{
isTokenPage
&&
appConfig
.
contractInfoApi
.
endpoint
&&
appConfig
.
adminServiceApi
.
endpoint
&&
<
TokenInfoMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
}
{
isTokenPage
&&
appConfig
.
contractInfoApi
.
endpoint
&&
appConfig
.
adminServiceApi
.
endpoint
&&
<
TokenInfoMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
}
<
PublicTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
<
PrivateTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
<
PrivateTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
<
PublicTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
</
MenuList
>
</
MenuList
>
</
Menu
>
</
Menu
>
);
);
...
...
ui/shared/AddressActions/PrivateTagMenuItem.tsx
View file @
b220d03c
import
{
MenuItem
,
chakra
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
MenuItem
,
Icon
,
chakra
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Address
}
from
'
types/api/address
'
;
import
type
{
Address
}
from
'
types/api/address
'
;
import
iconPrivateTags
from
'
icons/privattags.svg
'
;
import
{
getResourceKey
}
from
'
lib/api/useApiQuery
'
;
import
{
getResourceKey
}
from
'
lib/api/useApiQuery
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
import
PrivateTagModal
from
'
ui/privateTags/AddressModal/AddressModal
'
;
import
PrivateTagModal
from
'
ui/privateTags/AddressModal/AddressModal
'
;
...
@@ -46,8 +47,9 @@ const PrivateTagMenuItem = ({ className, hash }: Props) => {
...
@@ -46,8 +47,9 @@ const PrivateTagMenuItem = ({ className, hash }: Props) => {
return
(
return
(
<>
<>
<
MenuItem
className=
{
className
}
onClick=
{
handleClick
}
>
<
MenuItem
className=
{
className
}
onClick=
{
handleClick
}
>
Add private tag
<
Icon
as=
{
iconPrivateTags
}
boxSize=
{
6
}
mr=
{
2
}
/>
<
span
>
Add private tag
</
span
>
</
MenuItem
>
</
MenuItem
>
<
PrivateTagModal
isOpen=
{
modal
.
isOpen
}
onClose=
{
modal
.
onClose
}
onSuccess=
{
handleAddPrivateTag
}
data=
{
formData
}
/>
<
PrivateTagModal
isOpen=
{
modal
.
isOpen
}
onClose=
{
modal
.
onClose
}
onSuccess=
{
handleAddPrivateTag
}
data=
{
formData
}
/>
</>
</>
...
...
ui/shared/AddressActions/PublicTagMenuItem.tsx
View file @
b220d03c
import
{
MenuItem
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
MenuItem
,
Icon
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
iconPublicTags
from
'
icons/publictags.svg
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
interface
Props
{
interface
Props
{
...
@@ -23,7 +24,8 @@ const PublicTagMenuItem = ({ className, hash }: Props) => {
...
@@ -23,7 +24,8 @@ const PublicTagMenuItem = ({ className, hash }: Props) => {
return
(
return
(
<
MenuItem
className=
{
className
}
onClick=
{
handleClick
}
>
<
MenuItem
className=
{
className
}
onClick=
{
handleClick
}
>
Add public tag
<
Icon
as=
{
iconPublicTags
}
boxSize=
{
6
}
mr=
{
2
}
/>
<
span
>
Add public tag
</
span
>
</
MenuItem
>
</
MenuItem
>
);
);
};
};
...
...
ui/shared/AddressActions/TokenInfoMenuItem.tsx
View file @
b220d03c
import
{
MenuItem
,
chakra
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
MenuItem
,
Icon
,
chakra
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
appConfig
from
'
configs/app/config
'
;
import
iconEdit
from
'
icons/edit.svg
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
import
useRedirectIfNotAuth
from
'
lib/hooks/useRedirectIfNotAuth
'
;
import
AddressVerificationModal
from
'
ui/addressVerification/AddressVerificationModal
'
;
import
AddressVerificationModal
from
'
ui/addressVerification/AddressVerificationModal
'
;
...
@@ -44,22 +45,28 @@ const TokenInfoMenuItem = ({ className, hash }: Props) => {
...
@@ -44,22 +45,28 @@ const TokenInfoMenuItem = ({ className, hash }: Props) => {
router
.
push
({
pathname
:
'
/account/verified_addresses
'
});
router
.
push
({
pathname
:
'
/account/verified_addresses
'
});
},
[
router
]);
},
[
router
]);
const
icon
=
<
Icon
as=
{
iconEdit
}
boxSize=
{
6
}
mr=
{
2
}
p=
{
1
}
/>;
const
content
=
(()
=>
{
const
content
=
(()
=>
{
if
(
!
verifiedAddressesQuery
.
data
?.
verifiedAddresses
.
find
(({
contractAddress
})
=>
contractAddress
.
toLowerCase
()
===
hash
.
toLowerCase
()))
{
if
(
!
verifiedAddressesQuery
.
data
?.
verifiedAddresses
.
find
(({
contractAddress
})
=>
contractAddress
.
toLowerCase
()
===
hash
.
toLowerCase
()))
{
return
(
return
(
<
MenuItem
className=
{
className
}
onClick=
{
handleAddAddressClick
}
>
<
MenuItem
className=
{
className
}
onClick=
{
handleAddAddressClick
}
>
Add token info
{
icon
}
<
span
>
Add token info
</
span
>
</
MenuItem
>
</
MenuItem
>
);
);
}
}
return
(
return
(
<
MenuItem
className=
{
className
}
onClick=
{
handleAddApplicationClick
}
>
<
MenuItem
className=
{
className
}
onClick=
{
handleAddApplicationClick
}
>
{
{
icon
}
applicationsQuery
.
data
?.
submissions
.
some
(({
tokenAddress
})
=>
tokenAddress
.
toLowerCase
()
===
hash
.
toLowerCase
())
?
<
span
>
'
Update token info
'
:
{
'
Add token info
'
applicationsQuery
.
data
?.
submissions
.
some
(({
tokenAddress
})
=>
tokenAddress
.
toLowerCase
()
===
hash
.
toLowerCase
())
?
}
'
Update token info
'
:
'
Add token info
'
}
</
span
>
</
MenuItem
>
</
MenuItem
>
);
);
})();
})();
...
...
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