11import { motion } from "motion/react"
22import { useEffect , useMemo , useRef , useState } from "react"
3- import { formatUnits } from "viem"
3+ import { formatGwei } from "viem"
44import { useGasPrice } from "wagmi"
55
66import { 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 ( formatUnits ( scrollGasPrice , 6 ) . toString ( ) , 2 )
38+ return commafy ( formatGwei ( scrollGasPrice ) . toString ( ) , 3 )
3939 }
4040 return "-"
4141 } , [ scrollGasPrice ] )
4242
4343 const displayedEthereumGasPrice = useMemo ( ( ) => {
4444 if ( ethereumGasPrice ) {
45- return commafy ( formatUnits ( ethereumGasPrice , 6 ) . toString ( ) , 2 )
45+ return commafy ( formatGwei ( ethereumGasPrice ) . toString ( ) , 3 )
4646 }
4747 return "-"
4848 } , [ ethereumGasPrice ] )
@@ -143,7 +143,7 @@ const MobileGasPriceViewer = props => {
143143 { displayedScrollGasPrice }
144144 </ Typography >
145145 < Typography component = "span" sx = { { color : "inherit" , fontSize : "1.6rem" , lineHeight : "2.4rem" } } >
146- Mwei
146+ Gwei
147147 </ Typography >
148148 </ Stack >
149149 < Collapse in = { gasPricePanelVisible } sx = { { width : "100%" } } timeout = "auto" unmountOnExit >
@@ -174,7 +174,7 @@ const MobileGasPriceViewer = props => {
174174 >
175175 { displayedScrollGasPrice }
176176 </ Typography >
177- < span > Mwei </ span >
177+ < span > Gwei </ span >
178178 < span className = "font-[600]" > Ethereum</ span >
179179 < Typography
180180 sx = { {
@@ -187,7 +187,7 @@ const MobileGasPriceViewer = props => {
187187 >
188188 { displayedEthereumGasPrice }
189189 </ Typography >
190- < span > Mwei </ span >
190+ < span > Gwei </ span >
191191 < Button
192192 sx = { {
193193 fontSize : "1.6rem" ,
0 commit comments