aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-08-01 03:56:44 +0800
committerGitHub <noreply@github.com>2019-08-01 03:56:44 +0800
commite9c7df28ed88f6dc3a5074cf873f3920429d1803 (patch)
tree6075769d6a43cda8ce7de0a141b8f55065f05727 /app
parent1fd3dc9ecf16f00d721078e114138e529a7b8e16 (diff)
downloadtangerine-wallet-browser-e9c7df28ed88f6dc3a5074cf873f3920429d1803.tar.gz
tangerine-wallet-browser-e9c7df28ed88f6dc3a5074cf873f3920429d1803.tar.zst
tangerine-wallet-browser-e9c7df28ed88f6dc3a5074cf873f3920429d1803.zip
Address book send plus contact list (#6914)
* Style Send Header * Move Send to-row to send view and restyle * Add "Recents" group to select recipient view * Rename SendToRow to AddRecipient * Basic UI and Layout * New ENSInput component * wip - fuzzy search for input * small refactor * Add Dialog * contact list initial * initial error on invalid address * clean up edit * Click to open modal * Create AddToAddressBookModal component * Modal styling and layout * modal i18n * Add to Addressbook * ens wip * ens wip * ENS Resolution * Reset input * Send to explicit address * Happy Path Complete * Add back error checking * Reset send-to when emptying input * Add back warning object * Fix linter * Fix unit test #1 - fix import paths * Remove dead tests * One more to go * Fix all unit tests * add unit test for reducers and actions * test rendering AddRecipient * Add tests for dialog boxes in AddRecipient * Add test for validating * Fix linter * Fix e2e tests * Token send e2e fix * Style View Contact * Style edit-contact * Fix e2e * Fix from-import-beta-ui e2e spec * Make section header say "add recipient” by default * Auto-focus add recipient input * Update placeholder text * Update input title font size * Auto advance to next step if user paste a valid address * Ellipsify address when recipient is selected * Fix app header background color on desktop * Give each form row a margin of 16px * Use .container/.component naming pattern for ens-input * Auto-focus on input when add to addressbook modal is opened; Save on Enter * Fix and add unit test * Fix selectors name in e2e tests * Correct e2e test token amount for address-book-send changes * Adds e2e test for editing a transaction * Delete test/integration/lib/send-new-ui.js * Add tests for amount max button and high value error on send screen to test/e2e/metamask-ui.spec.js * lint and revert to address as object keys * add chainId based on current network to address book entry * fix test * only display contacts for the current network * Improve ENS message when not found on current network * Add error to indicate when network does not support ENS * bump gaba * address book, resolve comments * Move contact-list to its own component * De-duplicate getaddressbook selector and refactor name selection logic in contact-list-tab/ * Use contact-list component in contact-list-tab.component (i.e. in settings) * Improve/fix settings headers for popup and browser views * Lint fixes related to address book updates * Add 'My accounts' page to settings address book * Update add new contact button in settings to match floating circular design * Improve styles of view contact page * Improve styles and labels of the add-contact.component * Further lint fixes related to address book updates * Update unit tests as per address book updates * Ensure that contact list groups are sorted alphabetically * Refactor settings component to use a container for connection to redux; allow display of addressbook name in settings header * Decouple ens-input.component from send context * Add ens resolution to add contact screen in settings * Switching networks when an ens address is shown on send form removes the ens address. * Resolve send screen search for ensAddress to matching address book entry if it exists * Show resolved ens icon and address if exists (settings: add-contact.component) * Make the displayed and copied address in view-contact.component the checksummed address * Default alias state prop in AddToAddressBookModal to empty string * Use keyCode to detect enter key in AddToAddressBookModal * Ensure add-contact component properly updates after QR code detection * Fix display of all recents after clicking 'Load More' in contact list * Fix send screen contact searching after network switching * Code cleanup related to address book changes * Update unit tests for address book changes * Update ENS name not found on network message * Add ens registration error message * Cancel on edit mode takes user back to view screen * Adds support for memo to settings contact list view and edit screens * Modify designs of edit and view contact in popup environment * Update settings content list UX to show split columns in fullscreen and proper internal navigation * Correct background address book API usages in UI
Diffstat (limited to 'app')
-rw-r--r--app/_locales/en/messages.json81
-rw-r--r--app/images/check-green-solid.svg4
-rwxr-xr-xapp/images/close-gray.svg4
-rw-r--r--app/images/qr-blue.svg7
-rw-r--r--app/images/search-black.svg4
-rw-r--r--app/scripts/metamask-controller.js1
6 files changed, 101 insertions, 0 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index e69b3dc36..1f60bfa57 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -80,12 +80,21 @@
"activityLog": {
"message": "activity log"
},
+ "add": {
+ "message": "Add"
+ },
"address": {
"message": "Address"
},
"addNetwork": {
"message": "Add Network"
},
+ "addRecipient": {
+ "message": "Add Recipient"
+ },
+ "addressBook": {
+ "message": "Address Book"
+ },
"advanced": {
"message": "Advanced"
},
@@ -98,6 +107,18 @@
"addCustomToken": {
"message": "Add custom token"
},
+ "addToAddressBook": {
+ "message": "Add to address book"
+ },
+ "addToAddressBookModalPlaceholder": {
+ "message": "e.g. John D."
+ },
+ "addAlias": {
+ "message": "Add alias"
+ },
+ "addEthAddress": {
+ "message": "Add an Ethereum address"
+ },
"addToken": {
"message": "Add Token"
},
@@ -172,6 +193,9 @@
"back": {
"message": "Back"
},
+ "backToAll": {
+ "message": "Back to All"
+ },
"balance": {
"message": "Balance"
},
@@ -354,6 +378,12 @@
"connectToTrezor": {
"message": "Connect to Trezor"
},
+ "contactList": {
+ "message": "Contact List"
+ },
+ "contactListDescription": {
+ "message": "Add, edit, remove, and manage your contacts"
+ },
"continue": {
"message": "Continue"
},
@@ -463,6 +493,9 @@
"delete": {
"message": "Delete"
},
+ "deleteAccount": {
+ "message": "Delete Account"
+ },
"denExplainer": {
"message": "Your DEN is your password-encrypted storage within MetaMask."
},
@@ -529,6 +562,9 @@
"editAccountName": {
"message": "Edit Account Name"
},
+ "editContact":{
+ "message": "Edit Contact"
+ },
"editingTransaction": {
"message": "Make changes to your transaction"
},
@@ -571,6 +607,15 @@
"ensNameNotFound": {
"message": "ENS name not found"
},
+ "ensRegistrationError": {
+ "message": "Error in ENS name registration"
+ },
+ "ensNotFoundOnCurrentNetwork": {
+ "message": "ENS name not found on the current network. Try switching to Main Ethereum Network."
+ },
+ "enterAnAlias": {
+ "message": "Enter an alias"
+ },
"enterPassword": {
"message": "Enter password"
},
@@ -583,6 +628,9 @@
"eth": {
"message": "ETH"
},
+ "ethereumPublicAddress": {
+ "message": "Ethereum Public Address"
+ },
"etherscanView": {
"message": "View account on Etherscan"
},
@@ -893,6 +941,9 @@
"loadingTokens": {
"message": "Loading Tokens..."
},
+ "loadMore": {
+ "message": "Load More"
+ },
"localhost": {
"message": "Localhost 8545"
},
@@ -914,6 +965,9 @@
"memorizePhrase": {
"message": "Memorize this phrase."
},
+ "memo": {
+ "message": "memo"
+ },
"menu": {
"message": "Menu"
},
@@ -947,6 +1001,12 @@
"myAccounts": {
"message": "My Accounts"
},
+ "myWalletAccounts": {
+ "message": "My Wallet Accounts"
+ },
+ "myWalletAccountsDescription": {
+ "message": "All of your MetaMask created accounts will automatically be added to this section."
+ },
"mustSelectOne": {
"message": "Must select at least 1 token."
},
@@ -979,10 +1039,16 @@
"newAccount": {
"message": "New Account"
},
+ "newAccountDetectedDialogMessage": {
+ "message": "New address detected! Click here to add to your address book."
+ },
"newAccountNumberName": {
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"
},
+ "newContact": {
+ "message": "New Contact"
+ },
"newContract": {
"message": "New Contract"
},
@@ -1193,9 +1259,15 @@
"receive": {
"message": "Receive"
},
+ "recents": {
+ "message": "Recents"
+ },
"recipientAddress": {
"message": "Recipient Address"
},
+ "recipientAddressPlaceholder": {
+ "message": "Search, public address (0x), or ENS"
+ },
"refundAddress": {
"message": "Your Refund Address"
},
@@ -1670,6 +1742,9 @@
"transfer": {
"message": "Transfer"
},
+ "transferBetweenAccounts": {
+ "message": "Transfer between my accounts"
+ },
"transferFrom": {
"message": "Transfer From"
},
@@ -1750,6 +1825,9 @@
"useOldUI": {
"message": "Use old UI"
},
+ "userName":{
+ "message": "Username"
+ },
"validFileImport": {
"message": "You must select a valid file to import."
},
@@ -1762,6 +1840,9 @@
"viewinExplorer": {
"message": "View in Explorer"
},
+ "viewContact": {
+ "message": "View Contact"
+ },
"viewOnCustomBlockExplorer": {
"message": "View at $1"
},
diff --git a/app/images/check-green-solid.svg b/app/images/check-green-solid.svg
new file mode 100644
index 000000000..3e58e8dcc
--- /dev/null
+++ b/app/images/check-green-solid.svg
@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M0.833374 10C0.833374 4.9374 4.93743 0.833344 10 0.833344C15.0626 0.833344 19.1667 4.9374 19.1667 10C19.1667 15.0626 15.0626 19.1667 10 19.1667C4.93743 19.1667 0.833374 15.0626 0.833374 10Z" fill="#28A745"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4256 6.70245C14.7511 7.02789 14.7511 7.55553 14.4256 7.88097L9.25303 13.2976C8.9276 13.6231 8.39996 13.6231 8.07452 13.2976L5.57452 10.7976C5.24909 10.4722 5.24909 9.94456 5.57452 9.61912C5.89996 9.29368 6.4276 9.29368 6.75303 9.61912L8.66378 11.5299L13.2471 6.70245C13.5725 6.37702 14.1002 6.37702 14.4256 6.70245Z" fill="white"/>
+</svg>
diff --git a/app/images/close-gray.svg b/app/images/close-gray.svg
new file mode 100755
index 000000000..fca1c4740
--- /dev/null
+++ b/app/images/close-gray.svg
@@ -0,0 +1,4 @@
+<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="0.14917" y="1.09723" width="1.34076" height="15.4188" rx="0.670381" transform="rotate(-45 0.14917 1.09723)" fill="#A1A5B3"/>
+<rect x="0.94812" y="11.8508" width="1.34076" height="15.4188" rx="0.670381" transform="rotate(-135 0.94812 11.8508)" fill="#A1A5B3"/>
+</svg>
diff --git a/app/images/qr-blue.svg b/app/images/qr-blue.svg
new file mode 100644
index 000000000..54434295a
--- /dev/null
+++ b/app/images/qr-blue.svg
@@ -0,0 +1,7 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M16.32 8H8.63997L8.63997 16H16.32V8ZM8.63997 6C7.57958 6 6.71997 6.89543 6.71997 8V16C6.71997 17.1046 7.57958 18 8.63997 18H16.32C17.3804 18 18.24 17.1046 18.24 16V8C18.24 6.89543 17.3804 6 16.32 6H8.63997Z" fill="#037DD6"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M16.32 1C16.32 0.447715 16.7498 0 17.28 0H21.12C22.7106 0 24 1.34315 24 3V7C24 7.55228 23.5702 8 23.04 8C22.5098 8 22.08 7.55228 22.08 7V3C22.08 2.44772 21.6502 2 21.12 2H17.28C16.7498 2 16.32 1.55228 16.32 1Z" fill="#037DD6"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M23.04 16C23.5702 16 24 16.4477 24 17L24 21C24 22.6569 22.7106 24 21.12 24L17.28 24C16.7498 24 16.32 23.5523 16.32 23C16.32 22.4477 16.7498 22 17.28 22L21.12 22C21.6502 22 22.08 21.5523 22.08 21L22.08 17C22.08 16.4477 22.5098 16 23.04 16Z" fill="#037DD6"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.67999 23C7.67999 23.5523 7.25019 24 6.71999 24L2.87999 24C1.28941 24 -6.563e-06 22.6569 -6.42394e-06 21L-6.08824e-06 17C-6.04189e-06 16.4477 0.429801 16 0.959994 16C1.49019 16 1.91999 16.4477 1.91999 17L1.91999 21C1.91999 21.5523 2.3498 22 2.87999 22L6.71999 22C7.25019 22 7.67999 22.4477 7.67999 23Z" fill="#037DD6"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.96 8C0.429807 8 5.87108e-08 7.55228 1.31134e-07 7L6.55671e-07 3C8.72941e-07 1.34315 1.28942 1.69087e-07 2.88 3.77666e-07L6.72 8.81222e-07C7.25019 9.50748e-07 7.68 0.447716 7.68 1C7.68 1.55229 7.25019 2 6.72 2L2.88 2C2.34981 2 1.92 2.44772 1.92 3L1.92 7C1.92 7.55229 1.49019 8 0.96 8Z" fill="#037DD6"/>
+</svg>
diff --git a/app/images/search-black.svg b/app/images/search-black.svg
new file mode 100644
index 000000000..7b7db5124
--- /dev/null
+++ b/app/images/search-black.svg
@@ -0,0 +1,4 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.16667 3.33341C5.94501 3.33341 3.33334 5.94509 3.33334 9.16675C3.33334 12.3884 5.94501 15.0001 9.16667 15.0001C12.3883 15.0001 15 12.3884 15 9.16675C15 5.94509 12.3883 3.33341 9.16667 3.33341ZM1.66667 9.16675C1.66667 5.02461 5.02454 1.66675 9.16667 1.66675C13.3088 1.66675 16.6667 5.02461 16.6667 9.16675C16.6667 13.3089 13.3088 16.6667 9.16667 16.6667C5.02454 16.6667 1.66667 13.3089 1.66667 9.16675Z" fill="black"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.2857 13.2858C13.6112 12.9604 14.1388 12.9604 14.4642 13.2858L18.0892 16.9108C18.4147 17.2363 18.4147 17.7639 18.0892 18.0893C17.7638 18.4148 17.2362 18.4148 16.9107 18.0893L13.2857 14.4643C12.9603 14.1389 12.9603 13.6113 13.2857 13.2858Z" fill="black"/>
+</svg>
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 84a25b008..8ab2bc5dc 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -460,6 +460,7 @@ module.exports = class MetamaskController extends EventEmitter {
// AddressController
setAddressBook: this.addressBookController.set.bind(this.addressBookController),
+ removeFromAddressBook: this.addressBookController.delete.bind(this.addressBookController),
// AppStateController
setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController),