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
5a258ab0
Commit
5a258ab0
authored
May 09, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loading state to account menu
parent
18fe01d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
15 deletions
+20
-15
Token.tsx
ui/pages/Token.tsx
+1
-1
Menu.tsx
ui/shared/AddressActions/Menu.tsx
+18
-13
AddressHeadingInfo.tsx
ui/shared/AddressHeadingInfo.tsx
+1
-1
No files found.
ui/pages/Token.tsx
View file @
5a258ab0
...
@@ -234,7 +234,7 @@ const TokenPageContent = () => {
...
@@ -234,7 +234,7 @@ const TokenPageContent = () => {
...(contractQuery.data?.watchlist_names || []),
...(contractQuery.data?.watchlist_names || []),
]
]
.filter(Boolean)
.filter(Boolean)
.map((tag) => <Tag key={ tag.label }>{ tag.display_name }</Tag>);
.map((tag) => <Tag key={ tag.label }
isLoading={ tokenQuery.isPlaceholderData }
>{ tag.display_name }</Tag>);
const tagsNode = tags.length > 0 ? <Flex columnGap={ 2 }>{ tags }</Flex> : null;
const tagsNode = tags.length > 0 ? <Flex columnGap={ 2 }>{ tags }</Flex> : null;
return (
return (
...
...
ui/shared/AddressActions/Menu.tsx
View file @
5a258ab0
import
{
Button
,
Menu
,
MenuButton
,
MenuList
,
Icon
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Button
,
Menu
,
MenuButton
,
MenuList
,
Icon
,
Flex
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -10,7 +10,11 @@ import PrivateTagMenuItem from './PrivateTagMenuItem';
...
@@ -10,7 +10,11 @@ import PrivateTagMenuItem from './PrivateTagMenuItem';
import
PublicTagMenuItem
from
'
./PublicTagMenuItem
'
;
import
PublicTagMenuItem
from
'
./PublicTagMenuItem
'
;
import
TokenInfoMenuItem
from
'
./TokenInfoMenuItem
'
;
import
TokenInfoMenuItem
from
'
./TokenInfoMenuItem
'
;
const
AddressActions
=
()
=>
{
interface
Props
{
isLoading
?:
boolean
;
}
const
AddressActions
=
({
isLoading
}:
Props
)
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
...
@@ -18,17 +22,18 @@ const AddressActions = () => {
...
@@ -18,17 +22,18 @@ const AddressActions = () => {
return
(
return
(
<
Menu
>
<
Menu
>
<
MenuButton
<
Skeleton
isLoaded=
{
!
isLoading
}
ml=
{
2
}
>
as=
{
Button
}
<
MenuButton
size=
"sm"
as=
{
Button
}
variant=
"outline"
size=
"sm"
ml=
{
2
}
variant=
"outline"
>
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
<
span
>
More
</
span
>
<
span
>
More
</
span
>
<
Icon
as=
{
iconArrow
}
transform=
"rotate(-90deg)"
boxSize=
{
5
}
ml=
{
1
}
/>
<
Icon
as=
{
iconArrow
}
transform=
"rotate(-90deg)"
boxSize=
{
5
}
ml=
{
1
}
/>
</
Flex
>
</
Flex
>
</
MenuButton
>
</
MenuButton
>
</
Skeleton
>
<
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
}
/>
}
<
PrivateTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
<
PrivateTagMenuItem
py=
{
2
}
px=
{
4
}
hash=
{
hash
}
/>
...
...
ui/shared/AddressHeadingInfo.tsx
View file @
5a258ab0
...
@@ -43,7 +43,7 @@ const AddressHeadingInfo = ({ address, token, isLinkDisabled, isLoading }: Props
...
@@ -43,7 +43,7 @@ const AddressHeadingInfo = ({ address, token, isLinkDisabled, isLoading }: Props
<
AddressFavoriteButton
hash=
{
address
.
hash
}
watchListId=
{
address
.
watchlist_address_id
}
ml=
{
3
}
/>
<
AddressFavoriteButton
hash=
{
address
.
hash
}
watchListId=
{
address
.
watchlist_address_id
}
ml=
{
3
}
/>
)
}
)
}
<
AddressQrCode
hash=
{
address
.
hash
}
ml=
{
2
}
isLoading=
{
isLoading
}
/>
<
AddressQrCode
hash=
{
address
.
hash
}
ml=
{
2
}
isLoading=
{
isLoading
}
/>
{
appConfig
.
isAccountSupported
&&
<
AddressActionsMenu
/>
}
{
appConfig
.
isAccountSupported
&&
<
AddressActionsMenu
isLoading=
{
isLoading
}
/>
}
</
Flex
>
</
Flex
>
);
);
};
};
...
...
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