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
017935a8
Commit
017935a8
authored
Nov 16, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes2
parent
11192a24
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
28 deletions
+51
-28
LatestBlocks.tsx
ui/home/LatestBlocks.tsx
+6
-4
LatestTxs.tsx
ui/home/LatestTxs.tsx
+13
-12
StatsItemSkeleton.tsx
ui/home/StatsItemSkeleton.tsx
+18
-7
ChainIndicatorItem.tsx
ui/home/indicators/ChainIndicatorItem.tsx
+9
-1
Home.tsx
ui/pages/Home.tsx
+1
-1
Page.tsx
ui/shared/Page/Page.tsx
+1
-1
PageContent.tsx
ui/shared/Page/PageContent.tsx
+3
-2
No files found.
ui/home/LatestBlocks.tsx
View file @
017935a8
...
@@ -56,7 +56,9 @@ const LatestBlocks = () => {
...
@@ -56,7 +56,9 @@ const LatestBlocks = () => {
content
=
(
content
=
(
<>
<>
<
Skeleton
w=
"100%"
h=
{
6
}
mb=
{
9
}
/>
<
Skeleton
w=
"100%"
h=
{
6
}
mb=
{
9
}
/>
<
VStack
spacing=
{
`${ BLOCK_MARGIN }px`
}
mb=
{
6
}
height=
{
`${ BLOCK_HEIGHT * blocksCount + BLOCK_MARGIN * (blocksCount - 1) }px`
}
overflow=
"hidden"
>
{
Array
.
from
(
Array
(
blocksCount
)).
map
((
item
,
index
)
=>
<
LatestBlocksItemSkeleton
key=
{
index
}
/>)
}
{
Array
.
from
(
Array
(
blocksCount
)).
map
((
item
,
index
)
=>
<
LatestBlocksItemSkeleton
key=
{
index
}
/>)
}
</
VStack
>
</>
</>
);
);
}
}
...
@@ -82,6 +84,9 @@ const LatestBlocks = () => {
...
@@ -82,6 +84,9 @@ const LatestBlocks = () => {
{
data
.
slice
(
0
,
blocksCount
).
map
((
block
=>
<
LatestBlocksItem
key=
{
block
.
height
}
block=
{
block
}
h=
{
BLOCK_HEIGHT
}
/>))
}
{
data
.
slice
(
0
,
blocksCount
).
map
((
block
=>
<
LatestBlocksItem
key=
{
block
.
height
}
block=
{
block
}
h=
{
BLOCK_HEIGHT
}
/>))
}
</
AnimatePresence
>
</
AnimatePresence
>
</
VStack
>
</
VStack
>
<
Flex
justifyContent=
"center"
>
<
Link
fontSize=
"sm"
href=
{
link
(
'
blocks
'
)
}
>
View all blocks
</
Link
>
</
Flex
>
</>
</>
);
);
}
}
...
@@ -90,9 +95,6 @@ const LatestBlocks = () => {
...
@@ -90,9 +95,6 @@ const LatestBlocks = () => {
<>
<>
<
Heading
as=
"h4"
fontSize=
"18px"
mb=
{
{
base
:
3
,
lg
:
8
}
}
>
Latest Blocks
</
Heading
>
<
Heading
as=
"h4"
fontSize=
"18px"
mb=
{
{
base
:
3
,
lg
:
8
}
}
>
Latest Blocks
</
Heading
>
{
content
}
{
content
}
<
Flex
justifyContent=
"center"
>
<
Link
fontSize=
"sm"
href=
{
link
(
'
blocks
'
)
}
>
View all blocks
</
Link
>
</
Flex
>
</>
</>
);
);
};
};
...
...
ui/home/LatestTxs.tsx
View file @
017935a8
import
{
Box
,
Heading
,
Flex
,
Link
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Heading
,
Flex
,
Link
,
Text
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -27,34 +27,35 @@ const LatestTransactions = () => {
...
@@ -27,34 +27,35 @@ const LatestTransactions = () => {
if
(
isLoading
)
{
if
(
isLoading
)
{
content
=
(
content
=
(
<>
<>
<
Skeleton
h=
"56px"
w=
"100%"
/>
{
Array
.
from
(
Array
(
txsCount
)).
map
((
item
,
index
)
=>
<
LatestTxsItemSkeleton
key=
{
index
}
/>)
}
{
Array
.
from
(
Array
(
txsCount
)).
map
((
item
,
index
)
=>
<
LatestTxsItemSkeleton
key=
{
index
}
/>)
}
</>
</>
);
);
}
}
if
(
isError
)
{
if
(
isError
)
{
content
=
<
Text
>
There are no transactions. Please reload page.
</
Text
>;
content
=
<
Text
mt=
{
4
}
>
There are no transactions. Please reload page.
</
Text
>;
}
}
if
(
data
)
{
if
(
data
)
{
const
txsUrl
=
link
(
'
txs
'
);
content
=
(
content
=
(
<>
<
LatestTxsNotice
/>
<
Box
mb=
{
{
base
:
3
,
lg
:
6
}
}
>
<
Box
mb=
{
{
base
:
3
,
lg
:
6
}
}
>
{
data
.
slice
(
0
,
txsCount
).
map
((
tx
=>
<
LatestTxsItem
key=
{
tx
.
hash
}
tx=
{
tx
}
/>))
}
{
data
.
slice
(
0
,
txsCount
).
map
((
tx
=>
<
LatestTxsItem
key=
{
tx
.
hash
}
tx=
{
tx
}
/>))
}
</
Box
>
</
Box
>
<
Flex
justifyContent=
"center"
>
<
Link
fontSize=
"sm"
href=
{
txsUrl
}
>
View all transactions
</
Link
>
</
Flex
>
</>
);
);
}
}
const
txsUrl
=
link
(
'
txs
'
);
return
(
return
(
<>
<>
<
Heading
as=
"h4"
fontSize=
"18px"
mb=
{
{
base
:
3
,
lg
:
8
}
}
>
Latest transactions
</
Heading
>
<
Heading
as=
"h4"
fontSize=
"18px"
mb=
{
{
base
:
3
,
lg
:
8
}
}
>
Latest transactions
</
Heading
>
{
/* <TxsNewItemNotice mb={{ base: 3, lg: 8 }} url={ txsUrl }>{ ({ content }) => <Box>{ content }</Box> }</TxsNewItemNotice> */
}
<
LatestTxsNotice
/>
{
content
}
{
content
}
<
Flex
justifyContent=
"center"
>
<
Link
fontSize=
"sm"
href=
{
txsUrl
}
>
View all transactions
</
Link
>
</
Flex
>
</>
</>
);
);
};
};
...
...
ui/home/StatsItemSkeleton.tsx
View file @
017935a8
import
{
Box
,
Flex
,
Skeleton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Skeleton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
const
StatsItemSkeleton
=
()
=>
{
const
StatsItemSkeleton
=
()
=>
{
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
return
(
return
(
<
Flex
background=
{
bgColor
}
padding=
{
5
}
borderRadius=
"16px"
>
<
Flex
<
Skeleton
w=
"40px"
h=
"40px"
/>
backgroundColor=
{
bgColor
}
<
Box
ml=
{
4
}
>
padding=
{
5
}
<
Skeleton
w=
"69px"
h=
"10px"
mb=
"10px"
/>
borderRadius=
"16px"
<
Skeleton
w=
"93px"
h=
"10px"
/>
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
</
Box
>
alignItems=
"center"
>
<
Skeleton
w=
"40px"
h=
"40px"
mr=
{
{
base
:
4
,
lg
:
0
,
xl
:
4
}
}
mb=
{
{
base
:
0
,
lg
:
2
,
xl
:
0
}
}
/>
<
Flex
flexDirection=
"column"
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
,
xl
:
'
start
'
}
}
>
<
Skeleton
w=
"69px"
h=
"10px"
mt=
"4px"
mb=
"8px"
/>
<
Skeleton
w=
"93px"
h=
"14px"
mb=
"4px"
/>
</
Flex
>
</
Flex
>
</
Flex
>
);
);
};
};
...
...
ui/home/indicators/ChainIndicatorItem.tsx
View file @
017935a8
...
@@ -31,7 +31,15 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats
...
@@ -31,7 +31,15 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats
}
}
if
(
stats
.
isLoading
)
{
if
(
stats
.
isLoading
)
{
return
<
Skeleton
h=
{
3
}
w=
"70px"
my=
{
1.5
}
/>;
return
(
<
Skeleton
h=
{
3
}
w=
"70px"
my=
{
1.5
}
// ssr: isMobile = undefined, isLoading = true
display=
{
{
base
:
'
none
'
,
lg
:
'
block
'
}
}
/>
);
}
}
if
(
stats
.
isError
)
{
if
(
stats
.
isError
)
{
...
...
ui/pages/Home.tsx
View file @
017935a8
...
@@ -16,7 +16,7 @@ const Home = () => {
...
@@ -16,7 +16,7 @@ const Home = () => {
backgroundImage=
"radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
backgroundImage=
"radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
borderRadius=
"24px"
borderRadius=
"24px"
padding=
{
{
base
:
'
24px 40px
'
,
lg
:
'
48px
'
}
}
padding=
{
{
base
:
'
24px 40px
'
,
lg
:
'
48px
'
}
}
minW=
"850px"
minW=
{
{
base
:
'
unset
'
,
lg
:
'
900px
'
}
}
>
>
<
Heading
<
Heading
as=
"h1"
as=
"h1"
...
...
ui/shared/Page/Page.tsx
View file @
017935a8
...
@@ -44,7 +44,7 @@ const Page = ({
...
@@ -44,7 +44,7 @@ const Page = ({
},
[
wrapChildren
]);
},
[
wrapChildren
]);
const
renderedChildren
=
wrapChildren
?
(
const
renderedChildren
=
wrapChildren
?
(
<
PageContent
>
{
children
}
</
PageContent
>
<
PageContent
hasSearch=
{
hasSearch
}
>
{
children
}
</
PageContent
>
)
:
children
;
)
:
children
;
return
(
return
(
...
...
ui/shared/Page/PageContent.tsx
View file @
017935a8
...
@@ -3,16 +3,17 @@ import React from 'react';
...
@@ -3,16 +3,17 @@ import React from 'react';
interface
Props
{
interface
Props
{
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
hasSearch
:
boolean
;
}
}
const
PageContent
=
({
children
}:
Props
)
=>
{
const
PageContent
=
({
children
,
hasSearch
}:
Props
)
=>
{
return
(
return
(
<
Box
<
Box
as=
"main"
as=
"main"
w=
"100%"
w=
"100%"
paddingX=
{
{
base
:
4
,
lg
:
12
}
}
paddingX=
{
{
base
:
4
,
lg
:
12
}
}
paddingBottom=
{
10
}
paddingBottom=
{
10
}
paddingTop=
{
{
base
:
'
13
8px
'
,
lg
:
0
}
}
paddingTop=
{
{
base
:
hasSearch
?
'
138px
'
:
'
8
8px
'
,
lg
:
0
}
}
>
>
{
children
}
{
children
}
</
Box
>
</
Box
>
...
...
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