Skip to content

Commit 7a42ff5

Browse files
committed
Revert "fix: use Gwei"
This reverts commit cc6983a.
1 parent 813d046 commit 7a42ff5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/components/Header/GasPriceViewer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useState } from "react"
2-
import { formatGwei } from "viem"
2+
import { formatUnits } from "viem"
33
import { useGasPrice } from "wagmi"
44

55
import { Box, Button, Fade, Paper, Popper, Stack, Typography } from "@mui/material"
@@ -25,14 +25,14 @@ const GasPriceViewer = () => {
2525

2626
const displayedScrollGasPrice = useMemo(() => {
2727
if (scrollGasPrice) {
28-
return Number(formatGwei(scrollGasPrice)).toFixed(3)
28+
return Number(formatUnits(scrollGasPrice, 6)).toFixed(2)
2929
}
3030
return "-"
3131
}, [scrollGasPrice])
3232

3333
const displayedEthereumGasPrice = useMemo(() => {
3434
if (ethereumGasPrice) {
35-
return Number(formatGwei(ethereumGasPrice)).toFixed(3)
35+
return Number(formatUnits(ethereumGasPrice, 6)).toFixed(2)
3636
}
3737
return "-"
3838
}, [ethereumGasPrice])
@@ -98,7 +98,7 @@ const GasPriceViewer = () => {
9898
{displayedScrollGasPrice}
9999
</Typography>
100100
<Typography component="span" sx={{ fontSize: "1.6rem", lineHeight: "2.4rem" }}>
101-
Gwei
101+
Mwei
102102
</Typography>
103103
<Popper
104104
open={Boolean(anchorEl)}
@@ -138,12 +138,12 @@ const GasPriceViewer = () => {
138138
<Typography sx={{ fontSize: "inherit", lineHeight: "inherit", textAlign: "right", fontFamily: "var(--font-developer)" }}>
139139
{displayedScrollGasPrice}
140140
</Typography>
141-
<span>Gwei</span>
141+
<span>Mwei</span>
142142
<span className="font-[600]">Ethereum</span>
143143
<Typography sx={{ fontSize: "inherit", lineHeight: "inherit", textAlign: "right", fontFamily: "var(--font-developer)" }}>
144144
{displayedEthereumGasPrice}
145145
</Typography>
146-
<span>Gwei</span>
146+
<span>Mwei</span>
147147
<Button
148148
sx={{
149149
fontSize: "1.6rem",

src/components/Header/MobileGasPriceViewer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { motion } from "motion/react"
22
import { useEffect, useMemo, useRef, useState } from "react"
3-
import { formatGwei } from "viem"
3+
import { formatUnits } from "viem"
44
import { useGasPrice } from "wagmi"
55

66
import { Box, Button, Collapse, Stack, Typography } from "@mui/material"
@@ -35,14 +35,14 @@ const MobileGasPriceViewer = props => {
3535

3636
const displayedScrollGasPrice = useMemo(() => {
3737
if (scrollGasPrice) {
38-
return commafy(formatGwei(scrollGasPrice).toString(), 3)
38+
return commafy(formatUnits(scrollGasPrice, 6).toString(), 2)
3939
}
4040
return "-"
4141
}, [scrollGasPrice])
4242

4343
const displayedEthereumGasPrice = useMemo(() => {
4444
if (ethereumGasPrice) {
45-
return commafy(formatGwei(ethereumGasPrice).toString(), 3)
45+
return commafy(formatUnits(ethereumGasPrice, 6).toString(), 2)
4646
}
4747
return "-"
4848
}, [ethereumGasPrice])
@@ -138,7 +138,7 @@ const MobileGasPriceViewer = props => {
138138
{displayedScrollGasPrice}
139139
</Typography>
140140
<Typography component="span" sx={{ color: "inherit", fontSize: "1.6rem", lineHeight: "2.4rem" }}>
141-
Gwei
141+
Mwei
142142
</Typography>
143143
</Stack>
144144
<Collapse in={gasPricePanelVisible} sx={{ width: "100%" }} timeout="auto" unmountOnExit>
@@ -169,7 +169,7 @@ const MobileGasPriceViewer = props => {
169169
>
170170
{displayedScrollGasPrice}
171171
</Typography>
172-
<span>Gwei</span>
172+
<span>Mwei</span>
173173
<span className="font-[600]">Ethereum</span>
174174
<Typography
175175
sx={{
@@ -182,7 +182,7 @@ const MobileGasPriceViewer = props => {
182182
>
183183
{displayedEthereumGasPrice}
184184
</Typography>
185-
<span>Gwei</span>
185+
<span>Mwei</span>
186186
<Button
187187
sx={{
188188
fontSize: "1.6rem",

0 commit comments

Comments
 (0)