-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address book send plus contact list #6914
Conversation
2e24129
to
fbb2fa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes. I'll take another look once a few of them have been implemented.
|
||
if (query) { | ||
if (!this.contactFuse) { | ||
this.contactFuse = new Fuse(contacts, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better off attached to the class itself as a property so that we don't need to manage the state ourselves—as a property it would be created once when the class is constructed.
style: { color: '#dedede' }, | ||
onClick: () => this.handleInputEvent(), | ||
}), | ||
// !to && h(`i.fa.fa-caret-down.fa-lg.send-v2__to-autocomplete__down-caret`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we can remove these lines
import Identicon from '../../../../components/ui/identicon' | ||
import { CONTACT_LIST_ROUTE, CONTACT_EDIT_ROUTE } from '../../../../helpers/constants/routes' | ||
import Button from '../../../../components/ui/button/button.component' | ||
const copyToClipboard = require('copy-to-clipboard') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: import copyToClipboard from 'copy-to-clipboard'
maybe
ui/app/store/actions.js
Outdated
} | ||
} | ||
|
||
// Calls the addressBookController to remove an existing address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can we use JSDoc here?
ui/app/selectors/selectors.js
Outdated
function getAddressBookEntryName (state, address) { | ||
const entry = getAddressBookEntry(state, address) || state.metamask.identities[address] | ||
const name = entry && entry.name !== '' ? entry.name : addressSlicer(address) | ||
return name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: inline this return statement
ui/app/selectors/selectors.js
Outdated
@@ -203,7 +208,26 @@ function conversionRateSelector (state) { | |||
} | |||
|
|||
function getAddressBook (state) { | |||
return state.metamask.addressBook | |||
const network = state.metamask.network | |||
const addressBookEntries = Object.entries(state.metamask.addressBook) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be Object.values
and then filter
ed
backRoute = SETTINGS_ROUTE | ||
} | ||
|
||
const address = pathname.slice(-42) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does 42 come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could instead treat pathname
here as a URL component and split it on /
and pick out the constituent parts which might be less fragile?
const copyToClipboard = require('copy-to-clipboard/index') | ||
const ENS = require('ethjs-ens') | ||
const networkMap = require('ethjs-ens/lib/network-map.json') | ||
const log = require('loglevel') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we translate all of these to ESM imports?
Also we'll need to rebase this on the latest |
@whymarrh Apart from the one comment I directly replied to, all of your comments are addressed in 305e96a1d I also addressed all the other issues we found earlier while QAing in the following commits: |
305e96a
to
88aa542
Compare
1fa7533
to
4d8295f
Compare
Rebased onto develop |
4d8295f
to
a8439a8
Compare
a8439a8
to
1b6430d
Compare
Here's my design feedback for the address book. ENS functionalityENS error message copyCan be made clearer by explicitly saying "ENS name not found on the current network. Try switching to Main Ethereum Network". ENS address not displaying (bug)Not sure what's going on but I have an ENS name that I've registered and set a resolver address (my full name) and the result is "0x..0x". As you can see it throw a check indicating that it recognizes this ENS name as an address, but it doesn't display the actual address under the name as I'd expect it to. Let me know if you need any more info to help debug this. Contact listCancelling out of Edit ModeWhen editing a contact there is a "save" and “cancel” button. The cancel button should take you out of “edit” mode, NOT take you back to the full contact list. MemoThe memo is missing - I personally think it’s a nice feature to help add context to accounts, I’d push to add this in. Current implementationDesigns (see specs in Figma file) Fullscreen modeI'd suggest we do a two-column layout as was done for networks in settings. I quickly hacked this screen together to get the idea across. let me know if you want me to provide more direction here. I realize "My wallet accounts" is 3 levels deep, so I'd like to suggest we introduce breadcrumbs when we have a nav >2 levels deep in settings. Again, I just hacked these screens together, so let me know if you have any questions. Designs are in here) |
Thanks @cjeria I am working on these changes now. One note regarding the bug with resolving your ens name. It seems that there was some sort of error when you registered it. See the difference between https://etherscan.io/address/christianjeria.eth and https://etherscan.io/address/dinodan.eth for example, or between https://manager.ens.domains/name/christianjeria.eth and https://manager.ens.domains/name/dinodan.eth If you go to https://etherscan.io/enslookup and enter your ens name, it looks like the address was previously in a different registrar but has not successfully registered in the new registrar. For us in MetaMask, we should show an error when this happens instead of a |
…x; allow display of addressbook name in settings header
…hecksummed address
…nd proper internal navigation
9ed68fe
to
8ebdf9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I've reviewed, QA'd, and reviewed again ❤️
Resolves #6365
Resolve #6585
Closes #6702, #6681
This PR includes all the work done #6681 and #6702. These PRs included the new address book send flow and much of the work for the contact list settings feature.
In addition to that work, this PR adds a number of changes and improvements have been made to the address book settings work, including:
Demo video here: https://streamable.com/lcdfd
@whymarrh @jennypollack @cjeria @bdresser