mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
add view account-details menu item to token-options menu (#10932)
* add view account-details menu item to token-options menu * add onViewAccountDetails propType
This commit is contained in:
parent
eaec68da3a
commit
5bde528cbd
@ -43,6 +43,9 @@ export default function TokenAsset({ token }) {
|
||||
);
|
||||
global.platform.openTab({ url });
|
||||
}}
|
||||
onViewAccountDetails={() => {
|
||||
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
|
||||
}}
|
||||
tokenSymbol={token.symbol}
|
||||
/>
|
||||
}
|
||||
|
@ -4,7 +4,12 @@ import PropTypes from 'prop-types';
|
||||
import { I18nContext } from '../../../contexts/i18n';
|
||||
import { Menu, MenuItem } from '../../../components/ui/menu';
|
||||
|
||||
const TokenOptions = ({ onRemove, onViewEtherscan, tokenSymbol }) => {
|
||||
const TokenOptions = ({
|
||||
onRemove,
|
||||
onViewEtherscan,
|
||||
onViewAccountDetails,
|
||||
tokenSymbol,
|
||||
}) => {
|
||||
const t = useContext(I18nContext);
|
||||
const [tokenOptionsButtonElement, setTokenOptionsButtonElement] = useState(
|
||||
null,
|
||||
@ -25,6 +30,16 @@ const TokenOptions = ({ onRemove, onViewEtherscan, tokenSymbol }) => {
|
||||
anchorElement={tokenOptionsButtonElement}
|
||||
onHide={() => setTokenOptionsOpen(false)}
|
||||
>
|
||||
<MenuItem
|
||||
iconClassName="fas fa-qrcode"
|
||||
data-testid="token-options__account-details"
|
||||
onClick={() => {
|
||||
setTokenOptionsOpen(false);
|
||||
onViewAccountDetails();
|
||||
}}
|
||||
>
|
||||
{t('accountDetails')}
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
iconClassName="fas fa-external-link-alt token-options__icon"
|
||||
data-testid="token-options__etherscan"
|
||||
@ -54,6 +69,7 @@ const TokenOptions = ({ onRemove, onViewEtherscan, tokenSymbol }) => {
|
||||
TokenOptions.propTypes = {
|
||||
onRemove: PropTypes.func.isRequired,
|
||||
onViewEtherscan: PropTypes.func.isRequired,
|
||||
onViewAccountDetails: PropTypes.func.isRequired,
|
||||
tokenSymbol: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user