Skip to content

Commit

Permalink
Remove hardcoded ETH from stats page and use config instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolmin committed Apr 25, 2024
1 parent 78b47df commit 4b0e993
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions mocks/stats/lines.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { currencyUnits } from '../../lib/units';

export const base = {
sections: [
{
Expand Down Expand Up @@ -31,8 +33,8 @@ export const base = {
{
id: 'averageTxnFee',
title: 'Average transaction fee',
description: 'The average amount in ETH spent per transaction',
units: 'ETH',
description: `The average amount in ${ currencyUnits.ether } spent per transaction`,
units: currencyUnits.ether,
},
{
id: 'newTxns',
Expand All @@ -44,7 +46,7 @@ export const base = {
id: 'txnsFee',
title: 'Transactions fees',
description: 'Amount of tokens paid as fees',
units: 'ETH',
units: currencyUnits.ether,
},
{
id: 'txnsGrowth',
Expand All @@ -68,7 +70,7 @@ export const base = {
id: 'averageBlockRewards',
title: 'Average block rewards',
description: 'Average amount of distributed reward in tokens per day',
units: 'ETH',
units: currencyUnits.ether,
},
{
id: 'averageBlockSize',
Expand All @@ -90,7 +92,7 @@ export const base = {
charts: [
{
id: 'newNativeCoinTransfers',
title: 'New ETH transfers',
title: `New ${ currencyUnits.ether } transfers`,
description: 'New token transfers number for the period',
units: null,
},
Expand Down
8 changes: 5 additions & 3 deletions stubs/stats.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Counter, HomeStats, StatsChartsSection } from 'types/api/stats';

import { currencyUnits } from '../lib/units';

export const HOMEPAGE_STATS: HomeStats = {
average_block_time: 14346,
coin_price: '1807.68',
Expand Down Expand Up @@ -48,14 +50,14 @@ export const STATS_CHARTS_SECTION: StatsChartsSection = {
{
id: 'chart_0',
title: 'Average transaction fee',
description: 'The average amount in ETH spent per transaction',
units: 'ETH',
description: `The average amount in ${ currencyUnits.ether } spent per transaction`,
units: currencyUnits.ether,
},
{
id: 'chart_1',
title: 'Transactions fees',
description: 'Amount of tokens paid as fees',
units: 'ETH',
units: currencyUnits.ether,
},
{
id: 'chart_2',
Expand Down

0 comments on commit 4b0e993

Please sign in to comment.