import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CurrencyDisplay from '../../ui/currency-display'; import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'; import HexToDecimal from '../../ui/hex-to-decimal'; import { GWEI, PRIMARY, SECONDARY, ETH, } from '../../../helpers/constants/common'; import TransactionBreakdownRow from './transaction-breakdown-row'; export default class TransactionBreakdown extends PureComponent { static contextTypes = { t: PropTypes.func, }; static propTypes = { className: PropTypes.string, nativeCurrency: PropTypes.string, showFiat: PropTypes.bool, nonce: PropTypes.string, primaryCurrency: PropTypes.string, isTokenApprove: PropTypes.bool, gas: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), gasPrice: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), gasUsed: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), totalInHex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), baseFee: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), priorityFee: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), hexGasTotal: PropTypes.string, supportsEIP1559: PropTypes.bool, }; static defaultProps = { showFiat: true, }; render() { const { t } = this.context; const { gas, gasPrice, primaryCurrency, className, nonce, nativeCurrency, showFiat, totalInHex, gasUsed, isTokenApprove, baseFee, priorityFee, hexGasTotal, supportsEIP1559, } = this.props; return (