Skip to content

Commit

Permalink
do not show account mismatch alert on details
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-decker committed May 28, 2020
1 parent f8137b7 commit 41e3c63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function SenderAddress ({
senderName,
onSenderClick,
senderAddress,
warnUserOnAccountMismatch,
}) {
const t = useI18nContext()
const [addressCopied, setAddressCopied] = useState(false)
Expand Down Expand Up @@ -70,7 +71,7 @@ function SenderAddress ({
}
</div>
</Tooltip>
<AccountMismatchWarning address={senderAddress} />
{warnUserOnAccountMismatch && <AccountMismatchWarning address={senderAddress} />}
</div>
)
}
Expand All @@ -81,6 +82,7 @@ SenderAddress.propTypes = {
addressOnly: PropTypes.bool,
senderAddress: PropTypes.string,
onSenderClick: PropTypes.func,
warnUserOnAccountMismatch: PropTypes.bool,
}

function RecipientWithAddress ({
Expand Down Expand Up @@ -197,7 +199,8 @@ export default function SenderToRecipient ({
onRecipientClick,
onSenderClick,
recipientAddress,
variant = DEFAULT_VARIANT,
variant,
warnUserOnAccountMismatch,
}) {
const t = useI18nContext()
const checksummedSenderAddress = checksumAddress(senderAddress)
Expand All @@ -211,6 +214,7 @@ export default function SenderToRecipient ({
senderName={senderName}
onSenderClick={onSenderClick}
senderAddress={senderAddress}
warnUserOnAccountMismatch={warnUserOnAccountMismatch}
/>
<Arrow variant={variant} />
{recipientAddress
Expand Down Expand Up @@ -238,6 +242,11 @@ export default function SenderToRecipient ({
)
}

SenderToRecipient.defaultProps = {
variant: DEFAULT_VARIANT,
warnUserOnAccountMismatch: true,
}

SenderToRecipient.propTypes = {
senderName: PropTypes.string,
senderAddress: PropTypes.string,
Expand All @@ -250,4 +259,5 @@ SenderToRecipient.propTypes = {
assetImage: PropTypes.string,
onRecipientClick: PropTypes.func,
onSenderClick: PropTypes.func,
warnUserOnAccountMismatch: PropTypes.bool,
}

0 comments on commit 41e3c63

Please sign in to comment.