Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/components/Header/GasPriceViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useState } from "react"
import { formatUnits } from "viem"
import { formatGwei } from "viem"
import { useGasPrice } from "wagmi"

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

const displayedScrollGasPrice = useMemo(() => {
if (scrollGasPrice) {
return Number(formatUnits(scrollGasPrice, 6)).toFixed(2)
return Number(formatGwei(scrollGasPrice)).toFixed(5)
}
return "-"
}, [scrollGasPrice])

const displayedEthereumGasPrice = useMemo(() => {
if (ethereumGasPrice) {
return Number(formatUnits(ethereumGasPrice, 6)).toFixed(2)
return Number(formatGwei(ethereumGasPrice)).toFixed(3)
}
return "-"
}, [ethereumGasPrice])
Expand Down Expand Up @@ -98,7 +98,7 @@ const GasPriceViewer = () => {
{displayedScrollGasPrice}
</Typography>
<Typography component="span" sx={{ fontSize: "1.6rem", lineHeight: "2.4rem" }}>
Mwei
Gwei
</Typography>
<Popper
open={Boolean(anchorEl)}
Expand Down Expand Up @@ -138,12 +138,12 @@ const GasPriceViewer = () => {
<Typography sx={{ fontSize: "inherit", lineHeight: "inherit", textAlign: "right", fontFamily: "var(--font-developer)" }}>
{displayedScrollGasPrice}
</Typography>
<span>Mwei</span>
<span>Gwei</span>
<span className="font-[600]">Ethereum</span>
<Typography sx={{ fontSize: "inherit", lineHeight: "inherit", textAlign: "right", fontFamily: "var(--font-developer)" }}>
{displayedEthereumGasPrice}
</Typography>
<span>Mwei</span>
<span>Gwei</span>
<Button
sx={{
fontSize: "1.6rem",
Expand Down
12 changes: 6 additions & 6 deletions src/components/Header/MobileGasPriceViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { motion } from "motion/react"
import { useEffect, useMemo, useRef, useState } from "react"
import { formatUnits } from "viem"
import { formatGwei } from "viem"
import { useGasPrice } from "wagmi"

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

const displayedScrollGasPrice = useMemo(() => {
if (scrollGasPrice) {
return commafy(formatUnits(scrollGasPrice, 6).toString(), 2)
return commafy(formatGwei(scrollGasPrice).toString(), 5)
}
return "-"
}, [scrollGasPrice])

const displayedEthereumGasPrice = useMemo(() => {
if (ethereumGasPrice) {
return commafy(formatUnits(ethereumGasPrice, 6).toString(), 2)
return commafy(formatGwei(ethereumGasPrice).toString(), 3)
}
return "-"
}, [ethereumGasPrice])
Expand Down Expand Up @@ -138,7 +138,7 @@ const MobileGasPriceViewer = props => {
{displayedScrollGasPrice}
</Typography>
<Typography component="span" sx={{ color: "inherit", fontSize: "1.6rem", lineHeight: "2.4rem" }}>
Mwei
Gwei
</Typography>
</Stack>
<Collapse in={gasPricePanelVisible} sx={{ width: "100%" }} timeout="auto" unmountOnExit>
Expand Down Expand Up @@ -169,7 +169,7 @@ const MobileGasPriceViewer = props => {
>
{displayedScrollGasPrice}
</Typography>
<span>Mwei</span>
<span>Gwei</span>
<span className="font-[600]">Ethereum</span>
<Typography
sx={{
Expand All @@ -182,7 +182,7 @@ const MobileGasPriceViewer = props => {
>
{displayedEthereumGasPrice}
</Typography>
<span>Mwei</span>
<span>Gwei</span>
<Button
sx={{
fontSize: "1.6rem",
Expand Down