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__body">
<div className="transaction-list-item-details__sender-to-recipient-container"> <div className="transaction-list-item-details__sender-to-recipient-container">
<SenderToRecipient <SenderToRecipient
warnUserOnAccountMismatch={false}
variant={FLAT_VARIANT} variant={FLAT_VARIANT}
addressOnly addressOnly
recipientEns={recipientEns} recipientEns={recipientEns}

View File

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