Skip to content

Commit

Permalink
Merge pull request #41 from codingknite/burnt-fees-icons-fix
Browse files Browse the repository at this point in the history
Burnt fees icons fix
  • Loading branch information
codingknite authored Oct 29, 2024
2 parents 9efa1d0 + 69f254a commit 1b00468
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
15 changes: 8 additions & 7 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ echo 🧿 Running file linter...
npx lint-staged

# format svg
echo 🧿 Running svg formatter...
for file in `git diff --diff-filter=ACMRT --cached --name-only | grep ".svg\$"`
do
echo "Formatting $file"
./node_modules/.bin/svgo -q $file
git add $file
done
# todo: disable for now. investigate why it's failing then re-enable
# echo 🧿 Running svg formatter...
# for file in `git diff --diff-filter=ACMRT --cached --name-only | grep ".svg\$"`
# do
# echo "Formatting $file"
# ./node_modules/.bin/svgo -q $file
# git add $file
# done

echo ✅ All pre-commit jobs are done
2 changes: 1 addition & 1 deletion ui/block/BlockDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ const BlockDetails = ({ query }: Props) => {
</DetailsInfoItem.Label>
<DetailsInfoItem.Value>
<Skeleton isLoaded={ !isPlaceholderData } display="inline-block">
<TbCoins size={ 20 } color="gray.500"/>
<TbCoins size={ 20 } color="#718096"/>
</Skeleton>
<Skeleton isLoaded={ !isPlaceholderData } ml={ 2 }>
{ burntFees.dividedBy(WEI).toFixed() } { currencyUnits.ether }
Expand Down
2 changes: 1 addition & 1 deletion ui/snippets/header/Burger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Burger = ({ isMarketplaceAppPage }: Props) => {
<DrawerOverlay/>
<DrawerContent maxWidth="330px">
<DrawerBody p={ 6 } display="flex" flexDirection="column">
{ config.chain.isTestnet && <IconSvg name="testnet" h="14px" w="37px" color="red.400" alignSelf="flex-start"/> }
{ config.chain.isTestnet && <IconSvg name="testnetv2" h="14px" w="37px" color="red.400" alignSelf="flex-start"/> }
<Flex alignItems="center" justifyContent="space-between">
<NetworkLogo onClick={ handleNetworkLogoClick }/>
{ config.UI.sidebar.featuredNetworks ? (
Expand Down
14 changes: 1 addition & 13 deletions ui/tx/details/TxDetailsBurntFees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@ import { TbCoins } from 'react-icons/tb';

import type { Transaction } from 'types/api/transaction';

import config from 'configs/app';
import { ZERO } from 'lib/consts';
import { currencyUnits } from 'lib/units';
import CurrencyValue from 'ui/shared/CurrencyValue';
import * as DetailsInfoItem from 'ui/shared/DetailsInfoItem';

const rollupFeature = config.features.rollup;

interface Props {
data: Transaction;
isLoading?: boolean;
}

const TxDetailsBurntFees = ({ data, isLoading }: Props) => {

if (config.UI.views.tx.hiddenFields?.burnt_fees || (rollupFeature.isEnabled && rollupFeature.type === 'optimistic')) {
return null;
}

const value = BigNumber(data.tx_burnt_fee || 0).plus(BigNumber(data.blob_gas_used || 0).multipliedBy(BigNumber(data.blob_gas_price || 0)));

if (value.isEqualTo(ZERO)) {
return null;
}

return (
<>
<DetailsInfoItem.Label
Expand All @@ -43,7 +31,7 @@ const TxDetailsBurntFees = ({ data, isLoading }: Props) => {
</DetailsInfoItem.Label>
<DetailsInfoItem.Value>
<Skeleton isLoaded={ !isLoading } display="inline-block">
<TbCoins size={ 20 } color="gray.500"/>
<TbCoins size={ 20 } color="#718096"/>
</Skeleton>
<CurrencyValue
value={ value.toString() }
Expand Down

0 comments on commit 1b00468

Please sign in to comment.