mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
UX: Ensure block explorer link is for desired account (#20144)
This commit is contained in:
parent
25247d0300
commit
9310a95499
@ -138,6 +138,7 @@ export const AccountListItemMenu = ({
|
||||
metricsLocation={METRICS_LOCATION}
|
||||
closeMenu={closeMenu}
|
||||
textProps={{ variant: TextVariant.bodySm }}
|
||||
address={identity.address}
|
||||
/>
|
||||
{isRemovable ? (
|
||||
<MenuItem
|
||||
|
@ -101,6 +101,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
|
||||
<ViewExplorerMenuItem
|
||||
metricsLocation={METRICS_LOCATION}
|
||||
closeMenu={closeMenu}
|
||||
address={address}
|
||||
/>
|
||||
<MenuItem
|
||||
iconName={IconName.Connect}
|
||||
|
@ -18,7 +18,6 @@ import {
|
||||
getBlockExplorerLinkText,
|
||||
getCurrentChainId,
|
||||
getRpcPrefsForCurrentProvider,
|
||||
getSelectedAddress,
|
||||
} from '../../../selectors';
|
||||
import { getURLHostName } from '../../../helpers/utils/util';
|
||||
import { NETWORKS_ROUTE } from '../../../helpers/constants/routes';
|
||||
@ -27,15 +26,15 @@ export const ViewExplorerMenuItem = ({
|
||||
metricsLocation,
|
||||
closeMenu,
|
||||
textProps,
|
||||
address,
|
||||
}) => {
|
||||
const t = useI18nContext();
|
||||
const trackEvent = useContext(MetaMetricsContext);
|
||||
const history = useHistory();
|
||||
|
||||
const currentAddress = useSelector(getSelectedAddress);
|
||||
const chainId = useSelector(getCurrentChainId);
|
||||
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider);
|
||||
const addressLink = getAccountLink(currentAddress, chainId, rpcPrefs);
|
||||
const addressLink = getAccountLink(address, chainId, rpcPrefs);
|
||||
|
||||
const { blockExplorerUrl } = rpcPrefs;
|
||||
const blockExplorerUrlSubTitle = getURLHostName(blockExplorerUrl);
|
||||
@ -94,4 +93,5 @@ ViewExplorerMenuItem.propTypes = {
|
||||
metricsLocation: PropTypes.string.isRequired,
|
||||
closeMenu: PropTypes.func,
|
||||
textProps: PropTypes.object,
|
||||
address: PropTypes.string.isRequired,
|
||||
};
|
||||
|
@ -10,6 +10,7 @@ const render = () => {
|
||||
<ViewExplorerMenuItem
|
||||
metricsLocation="Global Menu"
|
||||
closeMenu={jest.fn()}
|
||||
address="0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
|
||||
/>,
|
||||
store,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user