1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/components/ui/account-mismatch-warning/account-mismatch-warning.component.js
Whymarrh Whitby c1e3c229bc
Fix import/order issues (#9239)
See [`import/order`](https://eslint.org/docs/rules/import/order) for more information.

This change enables `import/order` and fixes the issues raised by the rule.
2020-08-18 16:48:25 -02:30

31 lines
971 B
JavaScript

import React from 'react'
import { useSelector } from 'react-redux'
import PropTypes from 'prop-types'
import Tooltip from '../tooltip'
import { getSelectedAccount } from '../../../selectors'
import InfoIcon from '../icon/info-icon.component'
import { useI18nContext } from '../../../hooks/useI18nContext'
export default function AccountMismatchWarning ({ address }) {
const selectedAccount = useSelector(getSelectedAccount)
const t = useI18nContext()
if (selectedAccount.address === address) {
return null
}
return (
<Tooltip
position="bottom"
html={<p>{t('notCurrentAccount')}</p>}
wrapperClassName="account-mismatch-warning__tooltip-wrapper"
containerClassName="account-mismatch-warning__tooltip-container"
>
<div className="account-mismatch-warning__tooltip-container-icon"><InfoIcon severity="warning" /></div>
</Tooltip>
)
}
AccountMismatchWarning.propTypes = {
address: PropTypes.string.isRequired,
}