diff --git a/ui/components/app/confirm-page-container/confirm-page-container.component.js b/ui/components/app/confirm-page-container/confirm-page-container.component.js index 852cfeee9..cb32c41fd 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.component.js @@ -71,25 +71,6 @@ export default class ConfirmPageContainer extends Component { contact: PropTypes.object, }; - maybeRenderAddContact() { - const { t } = this.context; - const { showAddToAddressBookModal, toAddress, contact = {} } = this.props; - - if (contact.name || toAddress === undefined) { - return null; - } - - return ( - showAddToAddressBookModal()} - > - {t('newAccountDetectedDialogMessage')} - - ); - } - render() { const { showEdit, @@ -136,9 +117,14 @@ export default class ConfirmPageContainer extends Component { editingGas, handleCloseEditGas, currentTransaction, + showAddToAddressBookModal, + contact = {}, } = this.props; const renderAssetImage = contentComponent || !identiconAddress; + const showAddToAddressDialog = + contact.name === undefined && toAddress !== undefined; + return (
)} -
{this.maybeRenderAddContact()}
+
+ {showAddToAddressDialog && ( + showAddToAddressBookModal()} + > + {this.context.t('newAccountDetectedDialogMessage')} + + )} +
{contentComponent || (