Commit bd68f62f authored by isstuev's avatar isstuev

null gas prices

parent a078553c
...@@ -16,9 +16,9 @@ export type HomeStats = { ...@@ -16,9 +16,9 @@ export type HomeStats = {
} }
export type GasPrices = { export type GasPrices = {
average: number; average: number | null;
fast: number; fast: number | null;
slow: number; slow: number | null;
} }
export type Counters = { export type Counters = {
......
...@@ -92,7 +92,7 @@ const Stats = () => { ...@@ -92,7 +92,7 @@ const Stats = () => {
<StatsItem <StatsItem
icon="gas" icon="gas"
title="Gas tracker" title="Gas tracker"
value={ `${ Number(data.gas_prices.average).toLocaleString() } Gwei` } value={ data.gas_prices.average !== null ? `${ Number(data.gas_prices.average).toLocaleString() } Gwei` : 'N/A' }
_last={ isOdd ? lastItemTouchStyle : undefined } _last={ isOdd ? lastItemTouchStyle : undefined }
tooltipLabel={ gasLabel } tooltipLabel={ gasLabel }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
......
...@@ -11,11 +11,11 @@ const GasInfoTooltipContent = ({ gasPrices }: {gasPrices: GasPrices}) => { ...@@ -11,11 +11,11 @@ const GasInfoTooltipContent = ({ gasPrices }: {gasPrices: GasPrices}) => {
return ( return (
<Grid templateColumns="repeat(2, max-content)" rowGap={ 2 } columnGap={ 4 } padding={ 4 } fontSize="xs"> <Grid templateColumns="repeat(2, max-content)" rowGap={ 2 } columnGap={ 4 } padding={ 4 } fontSize="xs">
<GridItem { ...nameStyleProps }>Slow</GridItem> <GridItem { ...nameStyleProps }>Slow</GridItem>
<GridItem>{ `${ gasPrices.slow } Gwei` }</GridItem> <GridItem>{ gasPrices.slow !== null ? `${ gasPrices.slow } Gwei` : 'N/A' }</GridItem>
<GridItem { ...nameStyleProps }>Average</GridItem> <GridItem { ...nameStyleProps }>Average</GridItem>
<GridItem>{ `${ gasPrices.average } Gwei` }</GridItem> <GridItem>{ gasPrices.average !== null ? `${ gasPrices.average } Gwei` : 'N/A' }</GridItem>
<GridItem { ...nameStyleProps }>Fast</GridItem> <GridItem { ...nameStyleProps }>Fast</GridItem>
<GridItem>{ `${ gasPrices.fast } Gwei` }</GridItem> <GridItem>{ gasPrices.fast !== null ? `${ gasPrices.fast } Gwei` : 'N/A' }</GridItem>
</Grid> </Grid>
); );
}; };
......
...@@ -40,7 +40,7 @@ const TopBarStats = () => { ...@@ -40,7 +40,7 @@ const TopBarStats = () => {
</Skeleton> </Skeleton>
) } ) }
{ data?.coin_price && config.UI.homepage.showGasTracker && <TextSeparator color="divider"/> } { data?.coin_price && config.UI.homepage.showGasTracker && <TextSeparator color="divider"/> }
{ data?.gas_prices && config.UI.homepage.showGasTracker && ( { data?.gas_prices && data.gas_prices.average !== null && config.UI.homepage.showGasTracker && (
<Skeleton isLoaded={ !isPlaceholderData }> <Skeleton isLoaded={ !isPlaceholderData }>
<chakra.span color="text_secondary">Gas </chakra.span> <chakra.span color="text_secondary">Gas </chakra.span>
<LightMode> <LightMode>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment