Commit 91b8e7bf authored by isstuev's avatar isstuev

hide fee if hidden in config

parent 37cbe817
...@@ -104,7 +104,7 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -104,7 +104,7 @@ 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"
...@@ -116,6 +116,7 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -116,6 +116,7 @@ const UserOpDetails = ({ query }: Props) => {
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> />
</DetailsInfoItem> </DetailsInfoItem>
) }
<DetailsInfoItem <DetailsInfoItem
title="Gas limit" title="Gas limit"
hint="Gas limit for the User operation" hint="Gas limit for the User operation"
...@@ -183,6 +184,8 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -183,6 +184,8 @@ const UserOpDetails = ({ query }: Props) => {
> >
{ BigNumber(data.pre_verification_gas).toFormat() } { BigNumber(data.pre_verification_gas).toFormat() }
</DetailsInfoItem> </DetailsInfoItem>
{ !config.UI.views.tx.hiddenFields?.gas_fees && (
<>
<DetailsInfoItem <DetailsInfoItem
title="Max fee per gas" title="Max fee per gas"
hint="Maximum fee per gas " hint="Maximum fee per gas "
...@@ -191,8 +194,7 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -191,8 +194,7 @@ const UserOpDetails = ({ query }: Props) => {
<Text variant="secondary" whiteSpace="pre"> <Text variant="secondary" whiteSpace="pre">
{ space }({ BigNumber(data.max_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei) { space }({ BigNumber(data.max_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei)
</Text> </Text>
</DetailsInfoItem> </DetailsInfoItem><DetailsInfoItem
<DetailsInfoItem
title="Max priority fee per gas" title="Max priority fee per gas"
hint="Maximum priority fee per gas" hint="Maximum priority fee per gas"
> >
...@@ -201,6 +203,8 @@ const UserOpDetails = ({ query }: Props) => { ...@@ -201,6 +203,8 @@ const UserOpDetails = ({ query }: Props) => {
{ space }({ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei) { space }({ BigNumber(data.max_priority_fee_per_gas).dividedBy(WEI_IN_GWEI).toFixed() } Gwei)
</Text> </Text>
</DetailsInfoItem> </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>
{ !config.UI.views.tx.hiddenFields?.tx_fee && (
<>
<ListItemMobileGrid.Label isLoading={ isLoading }>Fee</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Fee</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<Skeleton isLoaded={ !isLoading }> <Skeleton isLoaded={ !isLoading }>
<CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 } currency={ config.chain.currency.symbol }/> <CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 } currency={ config.chain.currency.symbol }/>
</Skeleton> </Skeleton>
</ListItemMobileGrid.Value> </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>
{ !config.UI.views.tx.hiddenFields?.tx_fee && (
<Td verticalAlign="middle" isNumeric> <Td verticalAlign="middle" isNumeric>
<CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 }/> <CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 }/>
</Td> </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