mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* basic components and address page refactoring * second part of refactoring * third part of refactoring * NativeCoinValue component * more refactoring * rename TruncatedValue into TruncatedText * minor fixes * refactor block details * fix layout of value and fee in tx table * update screenshots * different units for tooltip and stats widget small value fix * update screenshots * update tx table screenshot * fix copy button vertical alignment
37 lines
965 B
TypeScript
37 lines
965 B
TypeScript
import BigNumber from 'bignumber.js';
|
|
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import * as DetailedInfo from 'ui/shared/DetailedInfo/DetailedInfo';
|
|
import DetailedInfoNativeCoinValue from 'ui/shared/DetailedInfo/DetailedInfoNativeCoinValue';
|
|
|
|
interface Props {
|
|
txFee: string | null;
|
|
gasUsed: string | null;
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
const TxDetailsFeePerGas = ({ txFee, gasUsed, isLoading }: Props) => {
|
|
if (!config.UI.views.tx.additionalFields?.fee_per_gas || !gasUsed || txFee === null) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<DetailedInfo.ItemLabel
|
|
hint="Fee per gas"
|
|
isLoading={ isLoading }
|
|
>
|
|
Fee per gas
|
|
</DetailedInfo.ItemLabel>
|
|
<DetailedInfoNativeCoinValue
|
|
amount={ BigNumber(txFee).dividedBy(gasUsed).toFixed() }
|
|
noSymbol={ config.UI.views.tx.hiddenFields?.fee_currency }
|
|
loading={ isLoading }
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TxDetailsFeePerGas;
|