mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
hide eth amount (#12435)
fix review updates moved logic to upper component
This commit is contained in:
parent
524725b24b
commit
6d786a7bbf
@ -35,6 +35,7 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
unapprovedTxCount: PropTypes.number,
|
unapprovedTxCount: PropTypes.number,
|
||||||
rejectNText: PropTypes.string,
|
rejectNText: PropTypes.string,
|
||||||
|
hideTitle: PropTypes.boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
@ -89,6 +90,7 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
rejectNText,
|
rejectNText,
|
||||||
origin,
|
origin,
|
||||||
ethGasPriceWarning,
|
ethGasPriceWarning,
|
||||||
|
hideTitle,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -110,6 +112,7 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
identiconAddress={identiconAddress}
|
identiconAddress={identiconAddress}
|
||||||
nonce={nonce}
|
nonce={nonce}
|
||||||
origin={origin}
|
origin={origin}
|
||||||
|
hideTitle={hideTitle}
|
||||||
/>
|
/>
|
||||||
{this.renderContent()}
|
{this.renderContent()}
|
||||||
{(errorKey || errorMessage) && (
|
{(errorKey || errorMessage) && (
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-negated-condition */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
@ -14,6 +15,7 @@ const ConfirmPageContainerSummary = (props) => {
|
|||||||
identiconAddress,
|
identiconAddress,
|
||||||
nonce,
|
nonce,
|
||||||
origin,
|
origin,
|
||||||
|
hideTitle,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -37,9 +39,11 @@ const ConfirmPageContainerSummary = (props) => {
|
|||||||
address={identiconAddress}
|
address={identiconAddress}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{!hideTitle ? (
|
||||||
<div className="confirm-page-container-summary__title-text">
|
<div className="confirm-page-container-summary__title-text">
|
||||||
{titleComponent || title}
|
{titleComponent || title}
|
||||||
</div>
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{hideSubtitle || (
|
{hideSubtitle || (
|
||||||
<div className="confirm-page-container-summary__subtitle">
|
<div className="confirm-page-container-summary__subtitle">
|
||||||
@ -60,6 +64,7 @@ ConfirmPageContainerSummary.propTypes = {
|
|||||||
identiconAddress: PropTypes.string,
|
identiconAddress: PropTypes.string,
|
||||||
nonce: PropTypes.string,
|
nonce: PropTypes.string,
|
||||||
origin: PropTypes.string.isRequired,
|
origin: PropTypes.string.isRequired,
|
||||||
|
hideTitle: PropTypes.boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ConfirmPageContainerSummary;
|
export default ConfirmPageContainerSummary;
|
||||||
|
@ -5,6 +5,7 @@ import { PageContainerFooter } from '../../ui/page-container';
|
|||||||
import EditGasPopover from '../edit-gas-popover';
|
import EditGasPopover from '../edit-gas-popover';
|
||||||
import { EDIT_GAS_MODES } from '../../../../shared/constants/gas';
|
import { EDIT_GAS_MODES } from '../../../../shared/constants/gas';
|
||||||
import ErrorMessage from '../../ui/error-message';
|
import ErrorMessage from '../../ui/error-message';
|
||||||
|
import { TRANSACTION_TYPES } from '../../../../shared/constants/transaction';
|
||||||
import Dialog from '../../ui/dialog';
|
import Dialog from '../../ui/dialog';
|
||||||
import {
|
import {
|
||||||
ConfirmPageContainerHeader,
|
ConfirmPageContainerHeader,
|
||||||
@ -128,6 +129,11 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
const shouldDisplayWarning =
|
const shouldDisplayWarning =
|
||||||
contentComponent && disabled && (errorKey || errorMessage);
|
contentComponent && disabled && (errorKey || errorMessage);
|
||||||
|
|
||||||
|
const hideTitle =
|
||||||
|
(currentTransaction.type === TRANSACTION_TYPES.CONTRACT_INTERACTION ||
|
||||||
|
currentTransaction.type === TRANSACTION_TYPES.DEPLOY_CONTRACT) &&
|
||||||
|
currentTransaction.txParams?.value === '0x0';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page-container">
|
<div className="page-container">
|
||||||
<ConfirmPageContainerNavigation
|
<ConfirmPageContainerNavigation
|
||||||
@ -194,6 +200,7 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
rejectNText={this.context.t('rejectTxsN', [unapprovedTxCount])}
|
rejectNText={this.context.t('rejectTxsN', [unapprovedTxCount])}
|
||||||
origin={origin}
|
origin={origin}
|
||||||
ethGasPriceWarning={ethGasPriceWarning}
|
ethGasPriceWarning={ethGasPriceWarning}
|
||||||
|
hideTitle={hideTitle}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{shouldDisplayWarning && (
|
{shouldDisplayWarning && (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user