diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 7ddaba250..2973b24ae 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1030,6 +1030,9 @@ "noThanks": { "message": "No Thanks" }, + "notCurrentAccount": { + "message": "Is this the correct account? It's different from the currently selected account in your wallet" + }, "notEnoughGas": { "message": "Not Enough Gas" }, diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js index 620e54897..f1f10a797 100644 --- a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React from 'react' import PropTypes from 'prop-types' import { ENVIRONMENT_TYPE_POPUP, @@ -8,31 +8,27 @@ import { getEnvironmentType } from '../../../../../../app/scripts/lib/util' import NetworkDisplay from '../../network-display' import Identicon from '../../../ui/identicon' import { shortenAddress } from '../../../../helpers/utils/util' +import AccountMismatchWarning from '../../../ui/account-mismatch-warning/account-mismatch-warning.component' +import { useI18nContext } from '../../../../hooks/useI18nContext' -export default class ConfirmPageContainerHeader extends Component { - static contextTypes = { - t: PropTypes.func, - } - - static propTypes = { - accountAddress: PropTypes.string, - showAccountInHeader: PropTypes.bool, - showEdit: PropTypes.bool, - onEdit: PropTypes.func, - children: PropTypes.node, - } - renderTop () { - const { onEdit, showEdit, accountAddress, showAccountInHeader } = this.props - const windowType = getEnvironmentType() - const isFullScreen = windowType !== ENVIRONMENT_TYPE_NOTIFICATION && - windowType !== ENVIRONMENT_TYPE_POPUP +export default function ConfirmPageContainerHeader ({ + onEdit, + showEdit, + accountAddress, + showAccountInHeader, + children, +}) { + const t = useI18nContext() + const windowType = getEnvironmentType() + const isFullScreen = windowType !== ENVIRONMENT_TYPE_NOTIFICATION && + windowType !== ENVIRONMENT_TYPE_POPUP - if (!showEdit && isFullScreen) { - return null - } - - return ( + if (!showEdit && isFullScreen) { + return null + } + return ( +
{t('copiedExclamation')}
+ if (!addressCopied) { + tooltipHtml = addressOnly + ?{t('copyAddress')}
+ : ( +
+ {shortenAddress(checksummedSenderAddress)}
+ {t('copyAddress')}
+
{t('copyAddress')}
- : ( -
- {shortenAddress(checksummedSenderAddress)}
- {t('copyAddress')}
-
{t('copiedExclamation')}
+ if (!addressCopied) { + if (addressOnly && !recipientNickname && !recipientEns) { + tooltipHtml ={t('copyAddress')}
+ } else { + tooltipHtml = ( +
+ {shortenAddress(checksummedRecipientAddress)}
+ {t('copyAddress')}
+
{t('copyAddress')}
- : ( -
- {shortenAddress(checksummedRecipientAddress)}
- {t('copyAddress')}
-