Commit fcfc5256 authored by tom's avatar tom

fix after merge

parent 75193642
...@@ -7,6 +7,7 @@ import { block } from 'data/block'; ...@@ -7,6 +7,7 @@ import { block } from 'data/block';
import clockIcon from 'icons/clock.svg'; import clockIcon from 'icons/clock.svg';
import flameIcon from 'icons/flame.svg'; import flameIcon from 'icons/flame.svg';
import dayjs from 'lib/date/dayjs'; import dayjs from 'lib/date/dayjs';
import useNetwork from 'lib/hooks/useNetwork';
import { space } from 'lib/html-entities'; import { space } from 'lib/html-entities';
import useLink from 'lib/link/useLink'; import useLink from 'lib/link/useLink';
import AddressLink from 'ui/shared/address/AddressLink'; import AddressLink from 'ui/shared/address/AddressLink';
...@@ -21,6 +22,7 @@ const BlockDetails = () => { ...@@ -21,6 +22,7 @@ const BlockDetails = () => {
const [ isExpanded, setIsExpanded ] = React.useState(false); const [ isExpanded, setIsExpanded ] = React.useState(false);
const link = useLink(); const link = useLink();
const router = useRouter(); const router = useRouter();
const network = useNetwork();
const handleCutClick = React.useCallback(() => { const handleCutClick = React.useCallback(() => {
setIsExpanded((flag) => !flag); setIsExpanded((flag) => !flag);
...@@ -77,7 +79,10 @@ const BlockDetails = () => { ...@@ -77,7 +79,10 @@ const BlockDetails = () => {
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Block reward" title="Block reward"
hint="For each block, the miner is rewarded with a finite amount of Ether on top of the fees paid for all transactions in the block." hint={
`For each block, the miner is rewarded with a finite amount of ${ network?.currency || 'native token' }
on top of the fees paid for all transactions in the block.`
}
columnGap={ 1 } columnGap={ 1 }
> >
<Text>{ block.reward.static + block.reward.tx_fee - block.burnt_fees }</Text> <Text>{ block.reward.static + block.reward.tx_fee - block.burnt_fees }</Text>
...@@ -119,15 +124,15 @@ const BlockDetails = () => { ...@@ -119,15 +124,15 @@ const BlockDetails = () => {
title="Base fee per gas" title="Base fee per gas"
hint="Minimum fee required per unit of gas. Fee adjusts based on network congestion." hint="Minimum fee required per unit of gas. Fee adjusts based on network congestion."
> >
<Text>{ (block.base_fee_per_gas / 10 ** 9).toLocaleString('en', { minimumFractionDigits: 18 }) } Ether </Text> <Text>{ (block.base_fee_per_gas / 10 ** 9).toLocaleString('en', { minimumFractionDigits: 18 }) } { network?.currency } </Text>
<Text variant="secondary" whiteSpace="pre">{ space }({ block.base_fee_per_gas.toLocaleString('en', { minimumFractionDigits: 9 }) } Gwei)</Text> <Text variant="secondary" whiteSpace="pre">{ space }({ block.base_fee_per_gas.toLocaleString('en', { minimumFractionDigits: 9 }) } Gwei)</Text>
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Burnt fees" title="Burnt fees"
hint="Amount of ETH burned from transactions included in the block. Equals Block Base Fee per Gas * Gas Used." hint={ `Amount of ${ network?.currency || 'native token' } burned from transactions included in the block. Equals Block Base Fee per Gas * Gas Used.` }
> >
<Icon as={ flameIcon } boxSize={ 5 } color="gray.500"/> <Icon as={ flameIcon } boxSize={ 5 } color="gray.500"/>
<Text ml={ 1 }>{ block.burnt_fees.toLocaleString('en', { minimumFractionDigits: 18 }) } Ether</Text> <Text ml={ 1 }>{ block.burnt_fees.toLocaleString('en', { minimumFractionDigits: 18 }) } { network?.currency }</Text>
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Extra data" title="Extra data"
......
...@@ -5,8 +5,8 @@ import type { RoutedTab } from 'ui/shared/RoutedTabs/types'; ...@@ -5,8 +5,8 @@ import type { RoutedTab } from 'ui/shared/RoutedTabs/types';
import BlockDetails from 'ui/block/BlockDetails'; import BlockDetails from 'ui/block/BlockDetails';
import BlockTxs from 'ui/block/BlockTxs'; import BlockTxs from 'ui/block/BlockTxs';
import Page from 'ui/shared/Page'; import Page from 'ui/shared/Page/Page';
import PageHeader from 'ui/shared/PageHeader'; import PageTitle from 'ui/shared/Page/PageTitle';
import RoutedTabs from 'ui/shared/RoutedTabs/RoutedTabs'; import RoutedTabs from 'ui/shared/RoutedTabs/RoutedTabs';
const TABS: Array<RoutedTab> = [ const TABS: Array<RoutedTab> = [
...@@ -23,7 +23,7 @@ const BlockPageContent = ({ tab }: Props) => { ...@@ -23,7 +23,7 @@ const BlockPageContent = ({ tab }: Props) => {
return ( return (
<Page> <Page>
<PageHeader text={ `Block #${ router.query.id || '' }` }/> <PageTitle text={ `Block #${ router.query.id || '' }` }/>
<RoutedTabs <RoutedTabs
tabs={ TABS } tabs={ TABS }
defaultActiveTab={ tab } defaultActiveTab={ tab }
......
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