Commit 91b8e7bf authored by isstuev's avatar isstuev

hide fee if hidden in config

parent 37cbe817
...@@ -104,18 +104,19 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -104,18 +104,19 @@ const UserOpDetails = ({ query }: Props) => {
<DetailsTimestamp timestamp={ Number(data.timestamp) * 1000 } isLoading={ isPlaceholderData }/> <DetailsTimestamp timestamp={ Number(data.timestamp) * 1000 } isLoading={ isPlaceholderData }/>
</DetailsInfoItem> </DetailsInfoItem>
) } ) }
{ /* condition? */ } { !config.UI.views.tx.hiddenFields?.tx_fee && (
<DetailsInfoItem <DetailsInfoItem
title="Fee" title="Fee"
hint="Total User operation fee" hint="Total User operation fee"
isLoading={ isPlaceholderData }
>
<CurrencyValue
value={ data.fee }
currency={ config.chain.currency.symbol }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> >
</DetailsInfoItem> <CurrencyValue
value={ data.fee }
currency={ config.chain.currency.symbol }
isLoading={ isPlaceholderData }
/>
</DetailsInfoItem>
) }
<DetailsInfoItem <DetailsInfoItem
title="Gas limit" title="Gas limit"
hint="Gas limit for the User operation" hint="Gas limit for the User operation"
...@@ -183,24 +184,27 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -183,24 +184,27 @@ const UserOpDetails = ({ query }: Props) => {
> >
{ BigNumber(data.pre_verification_gas).toFormat() } { BigNumber(data.pre_verification_gas).toFormat() }
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem { !config.UI.views.tx.hiddenFields?.gas_fees && (
title="Max fee per gas" <>
hint="Maximum fee per gas " <DetailsInfoItem
> title="Max fee per gas"
<Text>{ BigNumber(data.max_fee_per_gas).dividedBy(WEI).toFixed() } { config.chain.currency.symbol } </Text> hint="Maximum fee per gas "
<Text variant="secondary" whiteSpace="pre"> >
{ space }({ BigNumber(data.max_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei) <Text>{ BigNumber(data.max_fee_per_gas).dividedBy(WEI).toFixed() } { config.chain.currency.symbol } </Text>
</Text> <Text variant="secondary" whiteSpace="pre">
</DetailsInfoItem> { space }({ BigNumber(data.max_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei)
<DetailsInfoItem </Text>
title="Max priority fee per gas" </DetailsInfoItem><DetailsInfoItem
hint="Maximum priority fee per gas" title="Max priority fee per gas"
> hint="Maximum priority fee per gas"
<Text>{ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI).toFixed() } { config.chain.currency.symbol } </Text> >
<Text variant="secondary" whiteSpace="pre"> <Text>{ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI).toFixed() } { config.chain.currency.symbol } </Text>
{ space }({ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei) <Text variant="secondary" whiteSpace="pre">
</Text> { space }({ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei)
</DetailsInfoItem> </Text>
</DetailsInfoItem>
</>
) }
<DetailsInfoItemDivider/> <DetailsInfoItemDivider/>
......
...@@ -68,12 +68,16 @@ const UserOpsListItem = ({ item, isLoading }: Props) => { ...@@ -68,12 +68,16 @@ const UserOpsListItem = ({ item, isLoading }: Props) => {
/> />
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
<ListItemMobileGrid.Label isLoading={ isLoading }>Fee</ListItemMobileGrid.Label> { !config.UI.views.tx.hiddenFields?.tx_fee && (
<ListItemMobileGrid.Value> <>
<Skeleton isLoaded={ !isLoading }> <ListItemMobileGrid.Label isLoading={ isLoading }>Fee</ListItemMobileGrid.Label>
<CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 } currency={ config.chain.currency.symbol }/> <ListItemMobileGrid.Value>
</Skeleton> <Skeleton isLoaded={ !isLoading }>
</ListItemMobileGrid.Value> <CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 } currency={ config.chain.currency.symbol }/>
</Skeleton>
</ListItemMobileGrid.Value>
</>
) }
</ListItemMobileGrid.Container> </ListItemMobileGrid.Container>
); );
......
...@@ -25,8 +25,7 @@ const UserOpsTable = ({ items, isLoading, top }: Props) => { ...@@ -25,8 +25,7 @@ const UserOpsTable = ({ items, isLoading, top }: Props) => {
<Th w="160px">Sender</Th> <Th w="160px">Sender</Th>
<Th w="160px">Tx hash</Th> <Th w="160px">Tx hash</Th>
<Th w="40%">Block</Th> <Th w="40%">Block</Th>
{ /* add condition like in tx table */ } { !config.UI.views.tx.hiddenFields?.tx_fee && <Th w="120px" isNumeric>{ `Fee ${ config.chain.currency.symbol }` }</Th> }
<Th w="120px" isNumeric>{ `Fee ${ config.chain.currency.symbol }` }</Th>
</Tr> </Tr>
</Thead> </Thead>
<Tbody> <Tbody>
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { UserOpsItem } from 'types/api/userOps'; import type { UserOpsItem } from 'types/api/userOps';
import config from 'configs/app';
import dayjs from 'lib/date/dayjs'; import dayjs from 'lib/date/dayjs';
import CurrencyValue from 'ui/shared/CurrencyValue'; import CurrencyValue from 'ui/shared/CurrencyValue';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
...@@ -55,9 +56,11 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => { ...@@ -55,9 +56,11 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
noIcon noIcon
/> />
</Td> </Td>
<Td verticalAlign="middle" isNumeric> { !config.UI.views.tx.hiddenFields?.tx_fee && (
<CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 }/> <Td verticalAlign="middle" isNumeric>
</Td> <CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 }/>
</Td>
) }
</Tr> </Tr>
); );
}; };
......
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