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
3b389328
Commit
3b389328
authored
Nov 29, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stats and chart updates
parent
7a0ef608
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
39 deletions
+35
-39
LatestBlocks.tsx
ui/home/LatestBlocks.tsx
+1
-1
Stats.tsx
ui/home/Stats.tsx
+3
-3
StatsItem.tsx
ui/home/StatsItem.tsx
+15
-24
StatsItemSkeleton.tsx
ui/home/StatsItemSkeleton.tsx
+4
-4
ChainIndicatorItem.tsx
ui/home/indicators/ChainIndicatorItem.tsx
+6
-3
ChainIndicators.tsx
ui/home/indicators/ChainIndicators.tsx
+6
-4
No files found.
ui/home/LatestBlocks.tsx
View file @
3b389328
...
@@ -110,7 +110,7 @@ const LatestBlocks = () => {
...
@@ -110,7 +110,7 @@ const LatestBlocks = () => {
return
(
return
(
<>
<>
<
Heading
as=
"h4"
size=
"sm"
mb=
{
{
base
:
4
,
lg
:
7
}
}
>
Latest Blocks
</
Heading
>
<
Heading
as=
"h4"
size=
"sm"
mb=
{
4
}
>
Latest Blocks
</
Heading
>
{
content
}
{
content
}
</>
</>
);
);
...
...
ui/home/Stats.tsx
View file @
3b389328
...
@@ -79,10 +79,10 @@ const Stats = () => {
...
@@ -79,10 +79,10 @@ const Stats = () => {
return
(
return
(
<
Grid
<
Grid
gridTemplateColumns=
{
{
lg
:
`repeat(${ itemsCount }, 1fr)`
,
base
:
'
none
'
}
}
gridTemplateColumns=
{
{
lg
:
`repeat(${ itemsCount }, 1fr)`
,
base
:
'
1fr 1fr
'
}
}
gridTemplateRows=
{
{
lg
:
'
none
'
,
base
:
`repeat(${ itemsCount }, 1fr)`
}
}
gridTemplateRows=
{
{
lg
:
'
none
'
,
base
:
undefined
}
}
gridGap=
"10px"
gridGap=
"10px"
marginTop=
"
32
px"
marginTop=
"
24
px"
>
>
{
content
}
{
content
}
</
Grid
>
</
Grid
>
...
...
ui/home/StatsItem.tsx
View file @
3b389328
import
{
Flex
,
Icon
,
Center
,
Text
,
LightMod
e
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Icon
,
Text
,
useColorModeValu
e
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
type
Props
=
{
type
Props
=
{
...
@@ -9,30 +9,21 @@ type Props = {
...
@@ -9,30 +9,21 @@ type Props = {
const
StatsItem
=
({
icon
,
title
,
value
}:
Props
)
=>
{
const
StatsItem
=
({
icon
,
title
,
value
}:
Props
)
=>
{
return
(
return
(
<
LightMode
>
<
Flex
<
Flex
backgroundColor=
"blue.50"
backgroundColor=
{
useColorModeValue
(
'
blue.50
'
,
'
blue.800
'
)
}
padding=
{
5
}
padding=
{
3
}
borderRadius=
"16px
"
borderRadius=
"md
"
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
alignItems=
"center"
alignItems=
"center"
columnGap=
{
3
}
rowGap=
{
2
}
>
>
<
Center
<
Icon
as=
{
icon
}
boxSize=
{
7
}
/>
backgroundColor=
"green.100"
borderRadius=
"12px"
w=
{
10
}
h=
{
10
}
mr=
{
{
base
:
4
,
lg
:
0
,
xl
:
4
}
}
mb=
{
{
base
:
0
,
lg
:
2
,
xl
:
0
}
}
>
<
Icon
as=
{
icon
}
boxSize=
{
7
}
color=
"black"
/>
</
Center
>
<
Flex
flexDirection=
"column"
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
,
xl
:
'
start
'
}
}
>
<
Flex
flexDirection=
"column"
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
,
xl
:
'
start
'
}
}
>
<
Text
variant=
"secondary"
fontSize=
"xs"
lineHeight=
"16px"
>
{
title
}
</
Text
>
<
Text
variant=
"secondary"
fontSize=
"xs"
lineHeight=
"16px"
>
{
title
}
</
Text
>
<
Text
fontWeight=
{
500
}
fontSize=
"md"
>
{
value
}
</
Text
>
<
Text
fontWeight=
{
500
}
fontSize=
"md"
>
{
value
}
</
Text
>
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
</
LightMode
>
);
);
};
};
...
...
ui/home/StatsItemSkeleton.tsx
View file @
3b389328
...
@@ -7,16 +7,16 @@ const StatsItemSkeleton = () => {
...
@@ -7,16 +7,16 @@ const StatsItemSkeleton = () => {
return
(
return
(
<
Flex
<
Flex
backgroundColor=
{
bgColor
}
backgroundColor=
{
bgColor
}
padding=
{
5
}
padding=
{
3
}
borderRadius=
"
16px
"
borderRadius=
"
md
"
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
alignItems=
"center"
alignItems=
"center"
columnGap=
{
3
}
rowGap=
{
2
}
>
>
<
Skeleton
<
Skeleton
w=
"40px"
w=
"40px"
h=
"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
'
}
}
>
<
Flex
flexDirection=
"column"
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
,
xl
:
'
start
'
}
}
>
<
Skeleton
w=
"69px"
h=
"10px"
mt=
"4px"
mb=
"8px"
/>
<
Skeleton
w=
"69px"
h=
"10px"
mt=
"4px"
mb=
"8px"
/>
...
...
ui/home/indicators/ChainIndicatorItem.tsx
View file @
3b389328
...
@@ -18,9 +18,12 @@ interface Props {
...
@@ -18,9 +18,12 @@ interface Props {
}
}
const
ChainIndicatorItem
=
({
id
,
title
,
value
,
icon
,
isSelected
,
onClick
,
stats
}:
Props
)
=>
{
const
ChainIndicatorItem
=
({
id
,
title
,
value
,
icon
,
isSelected
,
onClick
,
stats
}:
Props
)
=>
{
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
activeBgColorDesktop
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
activeBgColorMobile
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
activeBgColor
=
isMobile
?
activeBgColorMobile
:
activeBgColorDesktop
;
const
handleClick
=
React
.
useCallback
(()
=>
{
const
handleClick
=
React
.
useCallback
(()
=>
{
onClick
(
id
);
onClick
(
id
);
},
[
id
,
onClick
]);
},
[
id
,
onClick
]);
...
@@ -58,11 +61,11 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats
...
@@ -58,11 +61,11 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats
borderRadius=
"md"
borderRadius=
"md"
cursor=
"pointer"
cursor=
"pointer"
onClick=
{
handleClick
}
onClick=
{
handleClick
}
bgColor=
{
isSelected
?
b
gColor
:
'
inherit
'
}
bgColor=
{
isSelected
?
activeB
gColor
:
'
inherit
'
}
boxShadow=
{
isSelected
?
'
lg
'
:
'
none
'
}
boxShadow=
{
isSelected
?
'
lg
'
:
'
none
'
}
zIndex=
{
isSelected
?
1
:
'
initial
'
}
zIndex=
{
isSelected
?
1
:
'
initial
'
}
_hover=
{
{
_hover=
{
{
b
gColor
,
activeB
gColor
,
zIndex
:
1
,
zIndex
:
1
,
}
}
}
}
>
>
...
...
ui/home/indicators/ChainIndicators.tsx
View file @
3b389328
...
@@ -40,8 +40,10 @@ const ChainIndicators = () => {
...
@@ -40,8 +40,10 @@ const ChainIndicators = () => {
()
=>
fetch
(
'
/node-api/stats
'
),
()
=>
fetch
(
'
/node-api/stats
'
),
);
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
bgColorDesktop
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
listBgColor
=
useColorModeValue
(
'
gray.50
'
,
'
gray.900
'
);
const
bgColorMobile
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
listBgColorDesktop
=
useColorModeValue
(
'
gray.50
'
,
'
black
'
);
const
listBgColorMobile
=
useColorModeValue
(
'
gray.50
'
,
'
gray.900
'
);
if
(
indicators
.
length
===
0
)
{
if
(
indicators
.
length
===
0
)
{
return
null
;
return
null
;
...
@@ -68,7 +70,7 @@ const ChainIndicators = () => {
...
@@ -68,7 +70,7 @@ const ChainIndicators = () => {
p=
{
{
base
:
0
,
lg
:
8
}
}
p=
{
{
base
:
0
,
lg
:
8
}
}
borderRadius=
{
{
base
:
'
none
'
,
lg
:
'
lg
'
}
}
borderRadius=
{
{
base
:
'
none
'
,
lg
:
'
lg
'
}
}
boxShadow=
{
{
base
:
'
none
'
,
lg
:
'
xl
'
}
}
boxShadow=
{
{
base
:
'
none
'
,
lg
:
'
xl
'
}
}
bgColor=
{
bgColor
}
bgColor=
{
{
base
:
bgColorMobile
,
lg
:
bgColorDesktop
}
}
columnGap=
{
12
}
columnGap=
{
12
}
rowGap=
{
0
}
rowGap=
{
0
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
...
@@ -97,7 +99,7 @@ const ChainIndicators = () => {
...
@@ -97,7 +99,7 @@ const ChainIndicators = () => {
as=
"ul"
as=
"ul"
p=
{
3
}
p=
{
3
}
borderRadius=
"lg"
borderRadius=
"lg"
bgColor=
{
listBgColor
}
bgColor=
{
{
base
:
listBgColorMobile
,
lg
:
listBgColorDesktop
}
}
rowGap=
{
3
}
rowGap=
{
3
}
order=
{
{
base
:
1
,
lg
:
2
}
}
order=
{
{
base
:
1
,
lg
:
2
}
}
>
>
...
...
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