1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

do not show account mismatch alert on details (#8678)

This commit is contained in:
Brad Decker 2020-05-28 14:20:56 -05:00 committed by GitHub
parent 22699cb1d9
commit 00834f5de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -218,6 +218,7 @@ export default class TransactionListItemDetails extends PureComponent {
<div className="transaction-list-item-details__body">
<div className="transaction-list-item-details__sender-to-recipient-container">
<SenderToRecipient
warnUserOnAccountMismatch={false}
variant={FLAT_VARIANT}
addressOnly
recipientEns={recipientEns}

View File

@ -22,6 +22,7 @@ function SenderAddress ({
senderName,
onSenderClick,
senderAddress,
warnUserOnAccountMismatch,
}) {
const t = useI18nContext()
const [addressCopied, setAddressCopied] = useState(false)
@ -70,7 +71,7 @@ function SenderAddress ({
}
</div>
</Tooltip>
<AccountMismatchWarning address={senderAddress} />
{warnUserOnAccountMismatch && <AccountMismatchWarning address={senderAddress} />}
</div>
)
}
@ -81,6 +82,7 @@ SenderAddress.propTypes = {
addressOnly: PropTypes.bool,
senderAddress: PropTypes.string,
onSenderClick: PropTypes.func,
warnUserOnAccountMismatch: PropTypes.bool,
}
function RecipientWithAddress ({
@ -197,7 +199,8 @@ export default function SenderToRecipient ({
onRecipientClick,
onSenderClick,
recipientAddress,
variant = DEFAULT_VARIANT,
variant,
warnUserOnAccountMismatch,
}) {
const t = useI18nContext()
const checksummedSenderAddress = checksumAddress(senderAddress)
@ -211,6 +214,7 @@ export default function SenderToRecipient ({
senderName={senderName}
onSenderClick={onSenderClick}
senderAddress={senderAddress}
warnUserOnAccountMismatch={warnUserOnAccountMismatch}
/>
<Arrow variant={variant} />
{recipientAddress
@ -238,6 +242,11 @@ export default function SenderToRecipient ({
)
}
SenderToRecipient.defaultProps = {
variant: DEFAULT_VARIANT,
warnUserOnAccountMismatch: true,
}
SenderToRecipient.propTypes = {
senderName: PropTypes.string,
senderAddress: PropTypes.string,
@ -250,4 +259,5 @@ SenderToRecipient.propTypes = {
assetImage: PropTypes.string,
onRecipientClick: PropTypes.func,
onSenderClick: PropTypes.func,
warnUserOnAccountMismatch: PropTypes.bool,
}