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
2099d37d
Commit
2099d37d
authored
Jan 08, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display USD value
parent
6e68889c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
Stats.tsx
ui/home/Stats.tsx
+13
-4
GasInfoRow.tsx
ui/shared/GasInfoTooltipContent/GasInfoRow.tsx
+1
-1
TopBarStats.tsx
ui/snippets/topBar/TopBarStats.tsx
+1
-1
No files found.
ui/home/Stats.tsx
View file @
2099d37d
...
@@ -53,6 +53,18 @@ const Stats = () => {
...
@@ -53,6 +53,18 @@ const Stats = () => {
const
isOdd
=
Boolean
(
itemsCount
%
2
);
const
isOdd
=
Boolean
(
itemsCount
%
2
);
const
gasLabel
=
hasGasTracker
&&
data
.
gas_prices
?
<
GasInfoTooltipContent
data=
{
data
}
/>
:
null
;
const
gasLabel
=
hasGasTracker
&&
data
.
gas_prices
?
<
GasInfoTooltipContent
data=
{
data
}
/>
:
null
;
const
gasPriceText
=
(()
=>
{
if
(
data
.
gas_prices
?.
average
?.
fiat_price
)
{
return
`$
${
data
.
gas_prices
.
average
.
fiat_price
}
`
;
}
if
(
data
.
gas_prices
?.
average
?.
price
)
{
return
`
${
data
.
gas_prices
.
average
.
price
.
toLocaleString
()
}
Gwei`
;
}
return
'
N/A
'
;
})();
content
=
(
content
=
(
<>
<>
{
config
.
features
.
zkEvmRollup
.
isEnabled
?
(
{
config
.
features
.
zkEvmRollup
.
isEnabled
?
(
...
@@ -98,10 +110,7 @@ const Stats = () => {
...
@@ -98,10 +110,7 @@ const Stats = () => {
<
StatsItem
<
StatsItem
icon=
"gas"
icon=
"gas"
title=
"Gas tracker"
title=
"Gas tracker"
value=
{
data
.
gas_prices
.
average
&&
data
.
gas_prices
.
average
.
price
!==
null
?
value=
{
gasPriceText
}
`${ Number(data.gas_prices.average.price).toLocaleString() } Gwei`
:
'
N/A
'
}
_last=
{
isOdd
?
lastItemTouchStyle
:
undefined
}
_last=
{
isOdd
?
lastItemTouchStyle
:
undefined
}
tooltipLabel=
{
gasLabel
}
tooltipLabel=
{
gasLabel
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
...
...
ui/shared/GasInfoTooltipContent/GasInfoRow.tsx
View file @
2099d37d
...
@@ -20,7 +20,7 @@ const GasInfoRow = ({ name, info }: Props) => {
...
@@ -20,7 +20,7 @@ const GasInfoRow = ({ name, info }: Props) => {
return
(
return
(
<>
<>
<
span
>
{
info
.
price
}
Gwei
</
span
>
<
span
>
{
info
.
fiat_price
?
`$${ info.fiat_price }`
:
`${ info.price } Gwei`
}
</
span
>
{
info
.
time
&&
(
{
info
.
time
&&
(
<
chakra
.
span
color=
"text_secondary"
>
<
chakra
.
span
color=
"text_secondary"
>
{
space
}
per tx
{
asymp
}
{
(
info
.
time
/
1000
).
toLocaleString
(
undefined
,
{
maximumFractionDigits
:
1
})
}
s
{
space
}
per tx
{
asymp
}
{
(
info
.
time
/
1000
).
toLocaleString
(
undefined
,
{
maximumFractionDigits
:
1
})
}
s
...
...
ui/snippets/topBar/TopBarStats.tsx
View file @
2099d37d
...
@@ -96,7 +96,7 @@ const TopBarStats = () => {
...
@@ -96,7 +96,7 @@ const TopBarStats = () => {
onMouseEnter=
{
onOpen
}
onMouseEnter=
{
onOpen
}
onMouseLeave=
{
onClose
}
onMouseLeave=
{
onClose
}
>
>
{
data
.
gas_prices
.
average
.
price
}
Gwei
{
data
.
gas_prices
.
average
.
fiat_price
?
`$${ data.gas_prices.average.fiat_price }`
:
`${ data.gas_prices.average.price } Gwei`
}
</
Link
>
</
Link
>
</
Tooltip
>
</
Tooltip
>
</
LightMode
>
</
LightMode
>
...
...
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