diff --git a/ui/components/app/multilayer-fee-message/multi-layer-fee-message.js b/ui/components/app/multilayer-fee-message/multi-layer-fee-message.js index 6dc671c89..22368d146 100644 --- a/ui/components/app/multilayer-fee-message/multi-layer-fee-message.js +++ b/ui/components/app/multilayer-fee-message/multi-layer-fee-message.js @@ -14,6 +14,7 @@ export default function MultilayerFeeMessage({ transaction, layer2fee, nativeCurrency, + plainStyle, }) { const t = useContext(I18nContext); @@ -57,12 +58,16 @@ export default function MultilayerFeeMessage({ key="total-item" detailTitle={t('layer1Fees')} detailTotal={layer1Total} + noBold={plainStyle} + flexWidthValues={plainStyle} /> ); @@ -72,4 +77,5 @@ MultilayerFeeMessage.propTypes = { transaction: PropTypes.object, layer2fee: PropTypes.string, nativeCurrency: PropTypes.string, + plainStyle: PropTypes.bool, }; diff --git a/ui/components/app/transaction-detail-item/index.scss b/ui/components/app/transaction-detail-item/index.scss index 8d6c1bcd7..5fecb94e0 100644 --- a/ui/components/app/transaction-detail-item/index.scss +++ b/ui/components/app/transaction-detail-item/index.scss @@ -13,6 +13,17 @@ word-break: break-word; } + &__detail-values { + display: flex; + flex-wrap: wrap; + justify-content: end; + width: 55%; + + &--flex-width { + width: auto; + } + } + .info-tooltip { display: inline-block; margin-inline-start: 4px; diff --git a/ui/components/app/transaction-detail-item/transaction-detail-item.component.js b/ui/components/app/transaction-detail-item/transaction-detail-item.component.js index 80a3e2fef..84689bc95 100644 --- a/ui/components/app/transaction-detail-item/transaction-detail-item.component.js +++ b/ui/components/app/transaction-detail-item/transaction-detail-item.component.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classnames from 'classnames'; import Typography from '../../ui/typography/typography'; import { @@ -15,26 +16,35 @@ export default function TransactionDetailItem({ detailTotal = '', subTitle = '', subText = '', + boldHeadings = true, + flexWidthValues = false, }) { return (
{detailTitle} {detailText && ( - - {detailText} - + + {detailText} + +
)} -
- {t('feeAssociatedRequest')} -
-
-
- {formatCurrency(fiatTransactionTotal, currentCurrency)} + {isMultiLayerFeeNetwork ? ( +
+
+ {t('transactionDetailLayer2GasHeading')} + {`${ethTransactionTotal} ${nativeCurrency}`} +
+
-
- {`${ethTransactionTotal} ${nativeCurrency}`} -
-
+ ) : ( + <> +
+ {t('feeAssociatedRequest')} +
+
+
+ {formatCurrency(fiatTransactionTotal, currentCurrency)} +
+
+ {`${ethTransactionTotal} ${nativeCurrency}`} +
+
+ + )}
); } diff --git a/ui/pages/confirm-approve/confirm-approve-content/index.scss b/ui/pages/confirm-approve/confirm-approve-content/index.scss index 6422693e7..31bbd8458 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/index.scss +++ b/ui/pages/confirm-approve/confirm-approve-content/index.scss @@ -254,12 +254,28 @@ color: #000; } - &__secondary-fee { + &__secondary-fee, + &__labelled-fee { @include H6; font-weight: normal; color: #8c8e94; } + + &__labelled-fee { + display: flex; + justify-content: space-between; + + h6.typography--h6 { + font-weight: normal; + } + } + } + + &__transaction-details-extra-content { + display: flex; + flex-flow: column; + width: 100%; } &__view-full-tx-button-wrapper { diff --git a/ui/pages/confirm-approve/confirm-approve.js b/ui/pages/confirm-approve/confirm-approve.js index a95f1ddf5..4d4aa1614 100644 --- a/ui/pages/confirm-approve/confirm-approve.js +++ b/ui/pages/confirm-approve/confirm-approve.js @@ -31,6 +31,7 @@ import { getNextSuggestedNonce, getCurrentChainId, getRpcPrefsForCurrentProvider, + getIsMultiLayerFeeNetwork, } from '../../selectors'; import { useApproveTransaction } from '../../hooks/useApproveTransaction'; @@ -64,6 +65,7 @@ export default function ConfirmApprove() { const customNonceValue = useSelector(getCustomNonceValue); const chainId = useSelector(getCurrentChainId); const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider); + const isMultiLayerFeeNetwork = useSelector(getIsMultiLayerFeeNetwork); const fromAddressIsLedger = useSelector(isAddressLedgerByFromAddress(from)); @@ -71,9 +73,11 @@ export default function ConfirmApprove() { currentNetworkTxList.find( ({ id }) => id === (Number(paramsTransactionId) || transactionId), ) || {}; - const { ethTransactionTotal, fiatTransactionTotal } = useSelector((state) => - transactionFeeSelector(state, transaction), - ); + const { + ethTransactionTotal, + fiatTransactionTotal, + hexTransactionTotal, + } = useSelector((state) => transactionFeeSelector(state, transaction)); const currentToken = (tokens && tokens.find(({ address }) => @@ -207,6 +211,7 @@ export default function ConfirmApprove() { nativeCurrency={nativeCurrency} ethTransactionTotal={ethTransactionTotal} fiatTransactionTotal={fiatTransactionTotal} + hexTransactionTotal={hexTransactionTotal} useNonceField={useNonceField} nextNonce={nextNonce} customNonceValue={customNonceValue} @@ -240,6 +245,7 @@ export default function ConfirmApprove() { chainId={chainId} rpcPrefs={rpcPrefs} isContract={isContract} + isMultiLayerFeeNetwork={isMultiLayerFeeNetwork} /> {showCustomizeGasPopover && (