1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 03:12:42 +02:00

Fix #19764 - Move Token Options Menu (#19765)

This commit is contained in:
David Walsh 2023-07-04 07:36:58 -05:00 committed by GitHub
parent e05aec8502
commit aa95fe838a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 29 deletions

View File

@ -28,7 +28,6 @@ import {
ButtonIcon,
ButtonIconSize,
IconName,
IconSize,
PickerNetwork,
} from '../../component-library';
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
@ -360,7 +359,6 @@ export const AppHeader = ({ location }) => {
setAccountOptionsMenuOpen(true);
}}
size={ButtonIconSize.Sm}
iconProps={{ size: IconSize.Sm }}
/>
</Box>
</Box>

View File

@ -10,7 +10,6 @@
.asset-navigation {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
height: 64px;

View File

@ -23,8 +23,4 @@ AssetNavigation.propTypes = {
optionsButton: PropTypes.element,
};
AssetNavigation.defaultProps = {
optionsButton: undefined,
};
export default AssetNavigation;

View File

@ -7,13 +7,16 @@ import { I18nContext } from '../../../contexts/i18n';
import { Menu, MenuItem } from '../../../components/ui/menu';
import { getBlockExplorerLinkText } from '../../../selectors';
import { NETWORKS_ROUTE } from '../../../helpers/constants/routes';
import { ButtonIcon, IconName } from '../../../components/component-library';
import {
ButtonIcon,
ButtonIconSize,
IconName,
} from '../../../components/component-library';
import { Color } from '../../../helpers/constants/design-system';
const AssetOptions = ({
onRemove,
onClickBlockExplorer,
onViewAccountDetails,
onViewTokenDetails,
tokenSymbol,
isNativeAsset,
@ -42,22 +45,13 @@ const AssetOptions = ({
ariaLabel={t('assetOptions')}
iconName={IconName.MoreVertical}
color={Color.textDefault}
size={ButtonIconSize.Sm}
/>
{assetOptionsOpen ? (
<Menu
anchorElement={ref.current}
onHide={() => setAssetOptionsOpen(false)}
>
<MenuItem
iconName={IconName.ScanBarcode}
data-testid="asset-options__account-details"
onClick={() => {
setAssetOptionsOpen(false);
onViewAccountDetails();
}}
>
{t('accountDetails')}
</MenuItem>
<MenuItem
iconName={IconName.Export}
data-testid="asset-options__etherscan"
@ -111,7 +105,6 @@ const isNotFunc = (p) => {
AssetOptions.propTypes = {
isNativeAsset: PropTypes.bool,
onClickBlockExplorer: PropTypes.func.isRequired,
onViewAccountDetails: PropTypes.func.isRequired,
onRemove: (props) => {
if (props.isNativeAsset === false && isNotFunc(props.onRemove)) {
throw new Error(

View File

@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { useSelector, useDispatch } from 'react-redux';
import { useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import { getAccountLink } from '@metamask/etherscan-link';
import TransactionList from '../../../components/app/transaction-list';
@ -12,7 +12,6 @@ import {
getSelectedAddress,
getIsCustomNetwork,
} from '../../../selectors/selectors';
import { showModal } from '../../../store/actions';
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';
import { getURLHostName } from '../../../helpers/utils/util';
import { MetaMetricsContext } from '../../../contexts/metametrics';
@ -24,7 +23,6 @@ export default function NativeAsset({ nativeCurrency }) {
const selectedAccountName = useSelector(
(state) => getSelectedIdentity(state).name,
);
const dispatch = useDispatch();
const chainId = useSelector(getCurrentChainId);
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider);
@ -57,9 +55,6 @@ export default function NativeAsset({ nativeCurrency }) {
url: accountLink,
});
}}
onViewAccountDetails={() => {
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
}}
isCustomNetwork={isCustomNetwork}
/>
}

View File

@ -67,9 +67,6 @@ export default function TokenAsset({ token }) {
});
global.platform.openTab({ url: tokenTrackerLink });
}}
onViewAccountDetails={() => {
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
}}
onViewTokenDetails={() => {
history.push(`${TOKEN_DETAILS}/${token.address}`);
}}