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
c96fd3da
Commit
c96fd3da
authored
Nov 15, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blocks fixes
parent
230f7e37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
22 deletions
+48
-22
LatestBlocks.tsx
ui/home/LatestBlocks.tsx
+7
-22
LatestBlocksItemSkeleton.tsx
ui/home/LatestBlocksItemSkeleton.tsx
+41
-0
No files found.
ui/home/LatestBlocks.tsx
View file @
c96fd3da
import
{
Box
,
Heading
,
Flex
,
Link
,
Text
,
VStack
,
Skeleton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Heading
,
Flex
,
Link
,
Text
,
VStack
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
,
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
{
AnimatePresence
}
from
'
framer-motion
'
;
import
React
from
'
react
'
;
...
...
@@ -10,10 +10,12 @@ import { QueryKeys } from 'types/client/queries';
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
nbsp
}
from
'
lib/html-entities
'
;
import
link
from
'
lib/link/link
'
;
import
useSocketChannel
from
'
lib/socket/useSocketChannel
'
;
import
useSocketMessage
from
'
lib/socket/useSocketMessage
'
;
import
LatestBlocksItem
from
'
./LatestBlocksItem
'
;
import
LatestBlocksItemSkeleton
from
'
./LatestBlocksItemSkeleton
'
;
const
BLOCK_HEIGHT
=
166
;
const
BLOCK_MARGIN
=
24
;
...
...
@@ -50,30 +52,11 @@ const LatestBlocks = () => {
let
content
;
const
borderColor
=
useColorModeValue
(
'
gray.200
'
,
'
whiteAlpha.200
'
);
if
(
isLoading
)
{
content
=
(
<>
<
Skeleton
w=
"100%"
h=
{
6
}
mb=
{
9
}
/>
{
Array
.
from
(
Array
(
blocksCount
)).
map
((
item
,
index
)
=>
{
return
(
<
Box
key=
{
index
}
width=
"100%"
borderRadius=
"12px"
border=
"1px solid"
borderColor=
{
borderColor
}
p=
{
6
}
mb=
{
6
}
>
<
Skeleton
w=
"100%"
h=
"30px"
mb=
{
3
}
/>
<
Skeleton
w=
"100%"
h=
"21px"
mb=
{
2
}
/>
<
Skeleton
w=
"100%"
h=
"21px"
mb=
{
2
}
/>
<
Skeleton
w=
"100%"
h=
"21px"
/>
</
Box
>
);
})
}
{
Array
.
from
(
Array
(
blocksCount
)).
map
((
item
,
index
)
=>
<
LatestBlocksItemSkeleton
key=
{
index
}
/>)
}
</>
);
}
...
...
@@ -107,7 +90,9 @@ const LatestBlocks = () => {
<>
<
Heading
as=
"h4"
fontSize=
"18px"
mb=
{
{
base
:
3
,
lg
:
8
}
}
>
Latest Blocks
</
Heading
>
{
content
}
<
Flex
justifyContent=
{
{
base
:
'
center
'
,
lg
:
'
start
'
}
}
><
Link
fontSize=
"sm"
>
View all blocks
</
Link
></
Flex
>
<
Flex
justifyContent=
"center"
>
<
Link
fontSize=
"sm"
href=
{
link
(
'
blocks
'
)
}
>
View all blocks
</
Link
>
</
Flex
>
</>
);
};
...
...
ui/home/LatestBlocksItemSkeleton.tsx
0 → 100644
View file @
c96fd3da
import
{
Box
,
Flex
,
Grid
,
GridItem
,
HStack
,
Skeleton
,
useColorModeValue
,
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
const
LatestBlocksItemSkeleton
=
()
=>
{
return
(
<
Box
width=
"100%"
borderRadius=
"12px"
border=
"1px solid"
borderColor=
{
useColorModeValue
(
'
gray.200
'
,
'
whiteAlpha.200
'
)
}
p=
{
6
}
>
<
Flex
justifyContent=
"space-between"
alignItems=
"center"
mb=
{
3
}
>
<
HStack
spacing=
{
2
}
>
<
Skeleton
w=
"30px"
h=
"30px"
/>
<
Skeleton
w=
"93px"
h=
"15px"
/>
</
HStack
>
{
/* <Text fontSize="sm" variant="secondary">{ block.timestamp }</Text> */
}
<
Skeleton
w=
"44px"
h=
"15px"
/>
</
Flex
>
<
Grid
gridGap=
{
2
}
templateColumns=
"auto minmax(0, 1fr)"
fontSize=
"sm"
>
<
GridItem
><
Skeleton
w=
"30px"
h=
"15px"
/></
GridItem
>
<
GridItem
><
Skeleton
w=
"93px"
h=
"15px"
/></
GridItem
>
<
GridItem
><
Skeleton
w=
"30px"
h=
"15px"
/></
GridItem
>
<
GridItem
><
Skeleton
w=
"93px"
h=
"15px"
/></
GridItem
>
<
GridItem
><
Skeleton
w=
"30px"
h=
"15px"
/></
GridItem
>
<
GridItem
><
Skeleton
w=
"93px"
h=
"15px"
/></
GridItem
>
</
Grid
>
</
Box
>
);
};
export
default
LatestBlocksItemSkeleton
;
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