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
39b27554
Commit
39b27554
authored
Jan 16, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stats gap fix
parent
6e48647c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
Stats.tsx
ui/home/Stats.tsx
+6
-5
StatsItemSkeleton.tsx
ui/home/StatsItemSkeleton.tsx
+4
-3
No files found.
ui/home/Stats.tsx
View file @
39b27554
...
...
@@ -30,13 +30,14 @@ const Stats = () => {
let
content
;
const
lastItemTouchStyle
=
{
gridColumn
:
{
base
:
'
span 2
'
,
lg
:
'
unset
'
}
};
if
(
isLoading
)
{
content
=
Array
.
from
(
Array
(
itemsCount
)).
map
((
item
,
index
)
=>
<
StatsItemSkeleton
key=
{
index
}
/>);
content
=
Array
.
from
(
Array
(
itemsCount
)).
map
((
item
,
index
)
=>
<
StatsItemSkeleton
key=
{
index
}
_last=
{
itemsCount
%
2
?
lastItemTouchStyle
:
undefined
}
/>);
}
const
lastItemTouchStyle
=
{
gridColumn
:
{
base
:
'
span 2
'
,
lg
:
'
unset
'
}
};
if
(
data
)
{
const
isOdd
=
Boolean
(
hasGasTracker
&&
!
data
.
gas_prices
?
(
itemsCount
-
1
)
%
2
:
itemsCount
%
2
);
const
gasLabel
=
hasGasTracker
&&
data
.
gas_prices
?
<
StatsGasPrices
gasPrices=
{
data
.
gas_prices
}
/>
:
null
;
content
=
(
<>
...
...
@@ -63,14 +64,14 @@ const Stats = () => {
icon=
{
walletIcon
}
title=
"Wallet addresses"
value=
{
Number
(
data
.
total_addresses
).
toLocaleString
()
}
_last=
{
i
temsCount
%
2
?
lastItemTouchStyle
:
undefined
}
_last=
{
i
sOdd
?
lastItemTouchStyle
:
undefined
}
/>
{
hasGasTracker
&&
data
.
gas_prices
&&
(
<
StatsItem
icon=
{
gasIcon
}
title=
"Gas tracker"
value=
{
`${ Number(data.gas_prices.average).toLocaleString() } Gwei`
}
_last=
{
i
temsCount
%
2
?
lastItemTouchStyle
:
undefined
}
_last=
{
i
sOdd
?
lastItemTouchStyle
:
undefined
}
tooltipLabel=
{
gasLabel
}
/>
)
}
...
...
ui/home/StatsItemSkeleton.tsx
View file @
39b27554
import
{
Flex
,
Skeleton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Skeleton
,
useColorModeValue
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
const
StatsItemSkeleton
=
()
=>
{
const
StatsItemSkeleton
=
(
{
className
}:
{
className
?:
string
}
)
=>
{
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
return
(
...
...
@@ -13,6 +13,7 @@ const StatsItemSkeleton = () => {
alignItems=
"center"
columnGap=
{
3
}
rowGap=
{
2
}
className=
{
className
}
>
<
Skeleton
w=
"40px"
...
...
@@ -26,4 +27,4 @@ const StatsItemSkeleton = () => {
);
};
export
default
StatsItemSkeleton
;
export
default
chakra
(
StatsItemSkeleton
)
;
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