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
9225e72c
Commit
9225e72c
authored
Aug 18, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use skeleton and not content loader
parent
24a96aea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
private-tags.tsx
pages/[network_type]/[network_sub_type]/private-tags.tsx
+2
-9
ApiKeys.tsx
ui/pages/ApiKeys.tsx
+7
-8
No files found.
pages/[network_type]/[network_sub_type]/private-tags.tsx
View file @
9225e72c
...
@@ -3,7 +3,6 @@ import type { NextPage } from 'next';
...
@@ -3,7 +3,6 @@ import type { NextPage } from 'next';
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
delay
from
'
lib/delay
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
];
const
TABS
=
[
'
address
'
,
'
transaction
'
];
...
@@ -20,10 +19,7 @@ const PrivateTagsPage: NextPage = () => {
...
@@ -20,10 +19,7 @@ const PrivateTagsPage: NextPage = () => {
// FIXME: request data only for active tab and only once
// FIXME: request data only for active tab and only once
// don't refetch after tab change
// don't refetch after tab change
useQuery
([
'
address
'
],
async
()
=>
{
useQuery
([
'
address
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
const
response
=
await
fetch
(
'
/api/account/private-tags/address
'
);
fetch
(
'
/api/account/private-tags/address
'
),
delay
(
5000
),
]);
if
(
!
response
.
ok
)
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
throw
new
Error
(
'
Network response was not ok
'
);
}
}
...
@@ -31,10 +27,7 @@ const PrivateTagsPage: NextPage = () => {
...
@@ -31,10 +27,7 @@ const PrivateTagsPage: NextPage = () => {
});
});
useQuery
([
'
transaction
'
],
async
()
=>
{
useQuery
([
'
transaction
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
const
response
=
await
fetch
(
'
/api/account/private-tags/transaction
'
);
fetch
(
'
/api/account/private-tags/transaction
'
),
delay
(
5000
),
]);
if
(
!
response
.
ok
)
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
throw
new
Error
(
'
Network response was not ok
'
);
}
}
...
...
ui/pages/ApiKeys.tsx
View file @
9225e72c
import
{
Box
,
Button
,
HStack
,
Link
,
Text
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
HStack
,
Link
,
Text
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
ApiKey
,
ApiKeys
}
from
'
types/api/account
'
;
import
type
{
ApiKey
,
ApiKeys
}
from
'
types/api/account
'
;
import
delay
from
'
lib/delay
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
ApiKeyModal
from
'
ui/apiKey/ApiKeyModal/ApiKeyModal
'
;
import
ApiKeyModal
from
'
ui/apiKey/ApiKeyModal/ApiKeyModal
'
;
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
import
DeleteApiKeyModal
from
'
ui/apiKey/DeleteApiKeyModal
'
;
import
DeleteApiKeyModal
from
'
ui/apiKey/DeleteApiKeyModal
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
const
DATA_LIMIT
=
3
;
const
DATA_LIMIT
=
3
;
...
@@ -23,10 +22,7 @@ const ApiKeysPage: React.FC = () => {
...
@@ -23,10 +22,7 @@ const ApiKeysPage: React.FC = () => {
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
ApiKey
>
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
ApiKey
>
();
const
{
data
,
isLoading
,
isError
}
=
useQuery
<
unknown
,
unknown
,
ApiKeys
>
([
'
api-keys
'
],
async
()
=>
{
const
{
data
,
isLoading
,
isError
}
=
useQuery
<
unknown
,
unknown
,
ApiKeys
>
([
'
api-keys
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
const
response
=
await
fetch
(
'
/api/account/api-keys
'
);
fetch
(
'
/api/account/api-keys
'
),
delay
(
5000
),
]);
if
(
!
response
.
ok
)
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
throw
new
Error
(
'
Network response was not ok
'
);
}
}
...
@@ -56,7 +52,10 @@ const ApiKeysPage: React.FC = () => {
...
@@ -56,7 +52,10 @@ const ApiKeysPage: React.FC = () => {
const
content
=
(()
=>
{
const
content
=
(()
=>
{
if
(
isLoading
||
isError
)
{
if
(
isLoading
||
isError
)
{
return
(
return
(
<
ContentLoader
/>
<>
<
SkeletonTable
columns=
{
[
'
100%
'
,
'
108px
'
]
}
/>
<
Skeleton
height=
"44px"
width=
"156px"
marginTop=
{
8
}
/>
</>
);
);
}
}
...
...
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