1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Transaction cleanup and fix TransactionDetailItem key not unique bug (#18899)

* TransactionDetailItem: allow empty detailText

* TxDetailItem: fix keys; ensure unique keys
This commit is contained in:
Ariella Vu 2023-05-02 00:42:59 -03:00 committed by GitHub
parent 36092571c6
commit a5d7cf3319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 9 deletions

View File

@ -135,7 +135,7 @@ export default function ApproveContentCard({
className="approve-content-card-container__transaction-details-extra-content"
>
<TransactionDetailItem
key="total-item"
key="approve-content-card-min-tx-fee"
detailTitle={t('transactionDetailLayer2GasHeading')}
detailTotal={
<UserPreferencedCurrencyDisplay

View File

@ -53,7 +53,7 @@ const ConfirmLegacyGasDisplay = () => {
if (isMultiLayerFeeNetwork) {
return [
<TransactionDetailItem
key="total-item"
key="legacy-total-item"
detailTitle={t('transactionDetailLayer2GasHeading')}
detailTotal={
<UserPreferencedCurrencyDisplay

View File

@ -52,7 +52,7 @@ const GasDetailsItem = ({ userAcknowledgedGasMissing = false }) => {
return (
<TransactionDetailItem
key="gas-item"
key="gas-details-item"
detailTitle={<GasDetailsItemTitle />}
detailTitleColor={TextColor.textDefault}
detailText={

View File

@ -92,7 +92,7 @@ export default function MultilayerFeeMessage({
return (
<div className="multi-layer-fee-message">
<TransactionDetailItem
key="total-item-gas-fee"
key="multi-layer-fee-message-total-item-gas-fee"
detailTitle={t('layer1Fees')}
detailTotal={layer1Total}
detailText={useCurrencyRateCheck && feeTotalInFiat}
@ -100,7 +100,7 @@ export default function MultilayerFeeMessage({
flexWidthValues={plainStyle}
/>
<TransactionDetailItem
key="total-item-total"
key="multi-layer-fee-message-total-item-total"
detailTitle={t('total')}
detailTotal={totalInEth}
detailText={totalInFiat}

View File

@ -15,7 +15,7 @@ import {
export default function TransactionDetailItem({
detailTitle = '',
detailText = '',
detailText,
detailTitleColor = Color.textDefault,
detailTotal = '',
subTitle = '',

View File

@ -187,7 +187,7 @@ export default class ConfirmApproveContent extends Component {
{isMultiLayerFeeNetwork ? (
<div className="confirm-approve-content__transaction-details-extra-content">
<TransactionDetailItem
key="total-item"
key="confirm-approve-content-min-tx-fee"
detailTitle={t('transactionDetailLayer2GasHeading')}
detailTotal={
<UserPreferencedCurrencyDisplay

View File

@ -457,7 +457,7 @@ export default class ConfirmTransactionBase extends Component {
),
!isMultiLayerFeeNetwork && (
<TransactionDetailItem
key="total-item"
key="confirm-transaction-base-total-item"
detailTitle={t('total')}
detailText={useCurrencyRateCheck && renderTotalDetailText()}
detailTotal={renderTotalDetailTotal()}

View File

@ -159,7 +159,7 @@ export default function GasDisplay({ gasError }) {
<ConfirmGasDisplay key="gas-display" />,
(gasError || isInsufficientTokenError) && (
<TransactionDetailItem
key="total-item"
key="gas-display-total-item"
detailTitle={t('total')}
detailText={
showCurrencyRateCheck && (