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
420cea06
Commit
420cea06
authored
Sep 05, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
two snippets for skeleton
parent
6fc260ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
13 deletions
+38
-13
PrivateAddressTags.tsx
ui/privateTags/PrivateAddressTags.tsx
+7
-13
SkeletonAccountMobile.tsx
ui/shared/SkeletonAccountMobile.tsx
+31
-0
No files found.
ui/privateTags/PrivateAddressTags.tsx
View file @
420cea06
import
{
Box
,
Button
,
Flex
,
Skeleton
,
SkeletonCircle
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
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
'
;
...
@@ -9,6 +9,7 @@ import delay from 'lib/delay';
...
@@ -9,6 +9,7 @@ import delay from 'lib/delay';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
SkeletonAccountMobile
from
'
ui/shared/SkeletonAccountMobile
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
AddressModal
from
'
./AddressModal/AddressModal
'
;
import
AddressModal
from
'
./AddressModal/AddressModal
'
;
...
@@ -21,7 +22,7 @@ const PrivateAddressTags = () => {
...
@@ -21,7 +22,7 @@ const PrivateAddressTags = () => {
useQuery
<
unknown
,
unknown
,
AddressTags
>
([
'
address-tags
'
],
async
()
=>
{
useQuery
<
unknown
,
unknown
,
AddressTags
>
([
'
address-tags
'
],
async
()
=>
{
const
[
result
]
=
await
Promise
.
all
([
const
[
result
]
=
await
Promise
.
all
([
fetch
(
'
/api/account/private-tags/address
'
),
fetch
(
'
/api/account/private-tags/address
'
),
delay
(
5
_000
),
delay
(
5
_000
_000
),
]);
]);
return
result
;
return
result
;
},
{
refetchOnMount
:
false
});
},
{
refetchOnMount
:
false
});
...
@@ -62,17 +63,10 @@ const PrivateAddressTags = () => {
...
@@ -62,17 +63,10 @@ const PrivateAddressTags = () => {
if
(
isLoading
&&
!
addressTagsData
)
{
if
(
isLoading
&&
!
addressTagsData
)
{
const
loader
=
isMobile
?
(
const
loader
=
isMobile
?
(
<
Flex
rowGap=
{
3
}
flexDirection=
"column"
>
<
Box
>
<
Flex
columnGap=
{
2
}
w=
"100%"
alignItems=
"center"
>
<
SkeletonAccountMobile
/>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
SkeletonAccountMobile
/>
<
Skeleton
h=
{
4
}
w=
"100%"
/>
</
Box
>
</
Flex
>
<
Skeleton
h=
{
4
}
w=
"164px"
/>
<
Flex
columnGap=
{
3
}
alignSelf=
"flex-end"
mt=
{
7
}
>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
</
Flex
>
</
Flex
>
)
:
(
)
:
(
<>
<>
<
SkeletonTable
columns=
{
[
'
60%
'
,
'
40%
'
,
'
108px
'
]
}
/>
<
SkeletonTable
columns=
{
[
'
60%
'
,
'
40%
'
,
'
108px
'
]
}
/>
...
...
ui/shared/SkeletonAccountMobile.tsx
0 → 100644
View file @
420cea06
import
{
Flex
,
Skeleton
,
SkeletonCircle
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
const
SkeletonAccountMobile
=
()
=>
{
return
(
<
Flex
rowGap=
{
3
}
flexDirection=
"column"
paddingY=
{
6
}
borderTopWidth=
"1px"
borderColor=
{
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
}
_first=
{
{
borderTopWidth
:
'
0
'
,
pt
:
'
0
'
,
}
}
>
<
Flex
columnGap=
{
2
}
w=
"100%"
alignItems=
"center"
>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
Skeleton
h=
{
4
}
w=
"100%"
/>
</
Flex
>
<
Skeleton
h=
{
4
}
w=
"164px"
/>
<
Skeleton
h=
{
4
}
w=
"164px"
/>
<
Flex
columnGap=
{
3
}
alignSelf=
"flex-end"
mt=
{
7
}
>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
</
Flex
>
</
Flex
>
);
};
export
default
SkeletonAccountMobile
;
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