Skip to content

add hamburger menu to eth page#10938

Merged
adonesky1 merged 2 commits intoMetaMask:developfrom
adonesky1:add-native-asset-menu
Apr 27, 2021
Merged

add hamburger menu to eth page#10938
adonesky1 merged 2 commits intoMetaMask:developfrom
adonesky1:add-native-asset-menu

Conversation

@adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Apr 27, 2021

(Completes) Fixes: #10148

Explanation: Adds the hamburger menu that currently exists for non-native asset token pages to the native asset (eth) page fork navigating to account details and Etherscan.

Manual testing steps:

  • Navigate to native asset (eth) page
  • Confirm that there is a hamburger menu available in top right hand corner
  • Confirm that links in menu work as expected.

@adonesky1 adonesky1 requested a review from brad-decker April 27, 2021 15:21
@adonesky1 adonesky1 requested a review from a team as a code owner April 27, 2021 15:21
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion! Great work


const chainId = useSelector(getCurrentChainId);
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider);
const selectedIdentity = useSelector(getSelectedIdentity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also getSelectedAddress selector which just returns the address. The getSelectedIdentity selector first calls getSelectedAddress then gets the full identity object by address. Might be worthwhile to use getSelectedAddress here if we don't expect to use any of the identity fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will do!

import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';

import AssetNavigation from './asset-navigation';
import TokenOptions from './token-options';
Copy link
Member

@Gudahtt Gudahtt Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a good time to rename this to something other than "token options", since it's now being used for native assets as well.

Maybe "Asset options"? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me. I'll make this change!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gudahtt so I may have gone beyond what you were thinking with renaming classnames and such. There is a issue with the verify-locales process no longer seeing tokenOptions present in the UI, but I'm not sure how or if the translations should change in the locales files if we do wish to change these classnames to match the new more generic verbiage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like E2E tests are failing from these classname changes, thought I'm not totally clear why yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the E2E errors are the same as the locales issues. @brad-decker @Gudahtt Should I fully revert the name changes because of the translation blocker for now? Or just revert the classnames?

@adonesky1 adonesky1 force-pushed the add-native-asset-menu branch from b42042e to c763c77 Compare April 27, 2021 20:03
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You changed this translation key which is trying to find a key in app/_locales/en/messages.json named 'AssetOptions' which doesn't exist. If you do want to change this you'll need to change the key to 'assetOptions' and update 'tokenOptions' to match, as long as that's wanted.

Copy link
Contributor Author

@adonesky1 adonesky1 Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brad-decker ah yes that makes more sense. I had originally changed the key in the locale files but wasn't sure that was the right thing to do given that the translations won't really match the key name anymore. Not sure what the right move is here, but feel like it could make sense to revert this key you've highlighted but leave the other name changes as is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these cases we'd change en/messages.json tokenOptions: "Token options" -> assetOptions: "Asset options", then we'd make sure the code is t('assetOptions') and finally run yarn lint:fix which will remove the unused translations in the other files. At some point in the future the translation service will add the new 'assetOptions' translations to other files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of translation here is unfortunate but not the end of the world and aligns more with our other terminology anyways. The tab is the 'assets' tab which includes the tokens that would have previously had the 'Token Options'

@adonesky1 adonesky1 force-pushed the add-native-asset-menu branch from c763c77 to d7c6021 Compare April 27, 2021 22:19
Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adonesky1 adonesky1 merged commit 13a0389 into MetaMask:develop Apr 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "account details" to hamburger menu in asset view

3 participants