diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2019-04-18 03:15:13 +0800 |
---|---|---|
committer | Dan J Miller <danjm.com@gmail.com> | 2019-04-18 03:15:13 +0800 |
commit | 931aaeb7003f175374a06eb949cd47a12ebc8bbf (patch) | |
tree | fe67bd73faf453f5f06ebae1987da5a2338f2e41 | |
parent | a844eb20da700b832003f63b83fc42ba74392d6c (diff) | |
download | tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar.gz tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar.bz2 tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar.lz tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar.xz tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.tar.zst tangerine-wallet-browser-931aaeb7003f175374a06eb949cd47a12ebc8bbf.zip |
Add token selection to the send screen (#6445)
* Move send to pages/
* Fix unit tests
* Finish UI
* Integrate asset dropdown to send actions
* Remove console.log
* Hide asset change during edit
* Enable switch from send token to seand eth
* Enable switching from token to eth when editing
* Fix linter
* Fixing test
* Fix unit tests
* Fix linter
* Fix react warning; remove console.log
* fix flat test
* Add metrics
* Address code review comments
* Consistent spacing between send screen form rows.
* Reduce height of gas buttons on send screen.
* Make send screen gas button height dependent on size of contents.
-rw-r--r-- | app/_locales/en/messages.json | 6 | ||||
-rw-r--r-- | test/integration/lib/send-new-ui.js | 4 | ||||
-rw-r--r-- | ui/app/components/app/customize-gas-modal/index.js | 6 | ||||
-rw-r--r-- | ui/app/components/app/ens-input.js | 2 | ||||
-rw-r--r-- | ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js | 2 | ||||
-rw-r--r-- | ui/app/components/app/gas-customization/gas-price-button-group/index.scss | 6 | ||||
-rw-r--r-- | ui/app/components/app/modals/customize-gas/customize-gas.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/app/transaction-list-item/transaction-list-item.container.js | 2 | ||||
-rw-r--r-- | ui/app/components/ui/account-dropdown-mini/account-dropdown-mini.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/ui/account-dropdown-mini/tests/account-dropdown-mini.component.test.js | 2 | ||||
-rw-r--r-- | ui/app/components/ui/unit-input/unit-input.component.js | 2 | ||||
-rw-r--r-- | ui/app/css/itcss/components/send.scss | 104 | ||||
-rw-r--r-- | ui/app/ducks/metamask/metamask.js | 19 | ||||
-rw-r--r-- | ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js | 2 | ||||
-rw-r--r-- | ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js | 4 | ||||
-rw-r--r-- | ui/app/pages/home/home.container.js | 2 | ||||
-rw-r--r-- | ui/app/pages/routes/index.js | 2 | ||||
-rw-r--r-- | ui/app/pages/send/README.md (renamed from ui/app/components/app/send/README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/account-list-item-README.md (renamed from ui/app/components/app/send/account-list-item/account-list-item-README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/account-list-item.component.js (renamed from ui/app/components/app/send/account-list-item/account-list-item.component.js) | 10 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/account-list-item.container.js (renamed from ui/app/components/app/send/account-list-item/account-list-item.container.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/index.js (renamed from ui/app/components/app/send/account-list-item/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js (renamed from ui/app/components/app/send/account-list-item/tests/account-list-item-component.test.js) | 6 | ||||
-rw-r--r-- | ui/app/pages/send/account-list-item/tests/account-list-item-container.test.js (renamed from ui/app/components/app/send/account-list-item/tests/account-list-item-container.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/index.js (renamed from ui/app/components/app/send/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/index.js (renamed from ui/app/components/app/send/send-content/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/README.md (renamed from ui/app/components/app/send/send-content/send-amount-row/README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/index.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/index.js (renamed from ui/app/components/app/send/send-content/send-amount-row/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js (renamed from ui/app/components/app/send/send-content/send-amount-row/send-amount-row.component.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js (renamed from ui/app/components/app/send/send-content/send-amount-row/send-amount-row.container.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/send-amount-row.scss (renamed from ui/app/components/app/send/send-content/send-amount-row/send-amount-row.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/send-amount-row.selectors.js (renamed from ui/app/components/app/send/send-content/send-amount-row/send-amount-row.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-component.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-container.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js (renamed from ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-asset-row/index.js | 1 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js | 152 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js | 21 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-content.component.js (renamed from ui/app/components/app/send/send-content/send-content.component.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-dropdown-list/index.js (renamed from ui/app/components/app/send/send-content/send-dropdown-list/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js (renamed from ui/app/components/app/send/send-content/send-dropdown-list/send-dropdown-list.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js (renamed from ui/app/components/app/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/index.js (renamed from ui/app/components/app/send/send-content/send-from-row/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/send-from-row.component.js (renamed from ui/app/components/app/send/send-content/send-from-row/send-from-row.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/send-from-row.container.js (renamed from ui/app/components/app/send/send-content/send-from-row/send-from-row.container.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/send-from-row.selectors.js (renamed from ui/app/components/app/send/send-content/send-from-row/send-from-row.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/tests/send-from-row-component.test.js (renamed from ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/tests/send-from-row-container.test.js (renamed from ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-container.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-from-row/tests/send-from-row-selectors.test.js (renamed from ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/README.md (renamed from ui/app/components/app/send/send-content/send-gas-row/README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js (renamed from ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/gas-fee-display/index.js (renamed from ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js (renamed from ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/index.js (renamed from ui/app/components/app/send/send-content/send-gas-row/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js (renamed from ui/app/components/app/send/send-content/send-gas-row/send-gas-row.component.js) | 8 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js (renamed from ui/app/components/app/send/send-content/send-gas-row/send-gas-row.container.js) | 10 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss (renamed from ui/app/components/app/send/send-content/send-gas-row/send-gas-row.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/send-gas-row.selectors.js (renamed from ui/app/components/app/send/send-content/send-gas-row/send-gas-row.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js (renamed from ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-component.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js (renamed from ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-container.test.js) | 10 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js (renamed from ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-hex-data-row/index.js (renamed from ui/app/components/app/send/send-content/send-hex-data-row/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js (renamed from ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js (renamed from ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.container.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/index.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/index.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/index.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper-README.md (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper-README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.component.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.scss (renamed from ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js (renamed from ui/app/components/app/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/index.js (renamed from ui/app/components/app/send/send-content/send-to-row/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/send-to-row-README.md (renamed from ui/app/components/app/send/send-content/send-to-row/send-to-row-README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/send-to-row.component.js (renamed from ui/app/components/app/send/send-content/send-to-row/send-to-row.component.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/send-to-row.container.js (renamed from ui/app/components/app/send/send-content/send-to-row/send-to-row.container.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/send-to-row.selectors.js (renamed from ui/app/components/app/send/send-content/send-to-row/send-to-row.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/send-to-row.utils.js (renamed from ui/app/components/app/send/send-content/send-to-row/send-to-row.utils.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/tests/send-to-row-component.test.js (renamed from ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-component.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/tests/send-to-row-container.test.js (renamed from ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-container.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/tests/send-to-row-selectors.test.js (renamed from ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/send-to-row/tests/send-to-row-utils.test.js (renamed from ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-utils.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/tests/send-content-component.test.js (renamed from ui/app/components/app/send/send-content/tests/send-content-component.test.js) | 17 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/README.md (renamed from ui/app/components/app/send/send-footer/README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/index.js (renamed from ui/app/components/app/send/send-footer/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/send-footer.component.js (renamed from ui/app/components/app/send/send-footer/send-footer.component.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/send-footer.container.js (renamed from ui/app/components/app/send/send-footer/send-footer.container.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/send-footer.scss (renamed from ui/app/components/app/send/send-footer/send-footer.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/send-footer.selectors.js (renamed from ui/app/components/app/send/send-footer/send-footer.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/send-footer.utils.js (renamed from ui/app/components/app/send/send-footer/send-footer.utils.js) | 1 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/tests/send-footer-component.test.js (renamed from ui/app/components/app/send/send-footer/tests/send-footer-component.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/tests/send-footer-container.test.js (renamed from ui/app/components/app/send/send-footer/tests/send-footer-container.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js (renamed from ui/app/components/app/send/send-footer/tests/send-footer-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-footer/tests/send-footer-utils.test.js (renamed from ui/app/components/app/send/send-footer/tests/send-footer-utils.test.js) | 1 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/README.md (renamed from ui/app/components/app/send/send-header/README.md) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/index.js (renamed from ui/app/components/app/send/send-header/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/send-header.component.js (renamed from ui/app/components/app/send/send-header/send-header.component.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/send-header.container.js (renamed from ui/app/components/app/send/send-header/send-header.container.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/send-header.selectors.js (renamed from ui/app/components/app/send/send-header/send-header.selectors.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/tests/send-header-component.test.js (renamed from ui/app/components/app/send/send-header/tests/send-header-component.test.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/tests/send-header-container.test.js (renamed from ui/app/components/app/send/send-header/tests/send-header-container.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send-header/tests/send-header-selectors.test.js (renamed from ui/app/components/app/send/send-header/tests/send-header-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send.component.js (renamed from ui/app/components/app/send/send.component.js) | 38 | ||||
-rw-r--r-- | ui/app/pages/send/send.constants.js (renamed from ui/app/components/app/send/send.constants.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/send.container.js (renamed from ui/app/components/app/send/send.container.js) | 10 | ||||
-rw-r--r-- | ui/app/pages/send/send.scss (renamed from ui/app/components/app/send/send.scss) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/send.selectors.js (renamed from ui/app/components/app/send/send.selectors.js) | 8 | ||||
-rw-r--r-- | ui/app/pages/send/send.utils.js (renamed from ui/app/components/app/send/send.utils.js) | 4 | ||||
-rw-r--r-- | ui/app/pages/send/tests/send-component.test.js (renamed from ui/app/components/app/send/tests/send-component.test.js) | 2 | ||||
-rw-r--r-- | ui/app/pages/send/tests/send-container.test.js (renamed from ui/app/components/app/send/tests/send-container.test.js) | 6 | ||||
-rw-r--r-- | ui/app/pages/send/tests/send-selectors-test-data.js (renamed from ui/app/components/app/send/tests/send-selectors-test-data.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/tests/send-selectors.test.js (renamed from ui/app/components/app/send/tests/send-selectors.test.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/tests/send-utils.test.js (renamed from ui/app/components/app/send/tests/send-utils.test.js) | 6 | ||||
-rw-r--r-- | ui/app/pages/send/to-autocomplete.component.js (renamed from ui/app/components/app/send/to-autocomplete.component.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/to-autocomplete/index.js (renamed from ui/app/components/app/send/to-autocomplete/index.js) | 0 | ||||
-rw-r--r-- | ui/app/pages/send/to-autocomplete/to-autocomplete.js (renamed from ui/app/components/app/send/to-autocomplete/to-autocomplete.js) | 4 | ||||
-rw-r--r-- | ui/app/selectors/custom-gas.js | 2 | ||||
-rw-r--r-- | ui/app/store/actions.js | 2 |
137 files changed, 444 insertions, 134 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b0cd1ca8b..184507cbb 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -139,6 +139,9 @@ "approved": { "message": "Approved" }, + "asset": { + "message": "Asset" + }, "attemptingConnect": { "message": "Attempting to connect to blockchain." }, @@ -1351,6 +1354,9 @@ "selectAnAccountHelp": { "message": "Select the account to view in MetaMask" }, + "selectAnAsset": { + "message": "Select an Asset" + }, "selectAHigherGasFee": { "message": "Select a higher gas fee to accelerate the processing of your transaction.*" }, diff --git a/test/integration/lib/send-new-ui.js b/test/integration/lib/send-new-ui.js index ce470fc02..d4c14392f 100644 --- a/test/integration/lib/send-new-ui.js +++ b/test/integration/lib/send-new-ui.js @@ -72,7 +72,7 @@ async function runSendFlowTest (assert, done) { const sendToAccountAddress = sendToFieldInput.val() assert.equal(sendToAccountAddress, '0x2f8D4a878cFA04A6E60D46362f5644DeAb66572D', 'send to dropdown selects the correct address') - const sendAmountField = await queryAsync($, '.send-v2__form-row:eq(2)') + const sendAmountField = await queryAsync($, '.send-v2__form-row:eq(3)') sendAmountField.find('.unit-input')[0].click() const sendAmountFieldInput = await findAsync(sendAmountField, '.unit-input__input') @@ -115,7 +115,7 @@ async function runSendFlowTest (assert, done) { sendToFieldInputInEdit[0].focus() sendToFieldInputInEdit.val('0xd85a4b6a394794842887b8284293d69163007bbb') - const sendAmountFieldInEdit = await queryAsync($, '.send-v2__form-row:eq(2)') + const sendAmountFieldInEdit = await queryAsync($, '.send-v2__form-row:eq(3)') sendAmountFieldInEdit.find('.unit-input')[0].click() const sendAmountFieldInputInEdit = sendAmountFieldInEdit.find('.unit-input__input') diff --git a/ui/app/components/app/customize-gas-modal/index.js b/ui/app/components/app/customize-gas-modal/index.js index 4434b8c25..1f9436810 100644 --- a/ui/app/components/app/customize-gas-modal/index.js +++ b/ui/app/components/app/customize-gas-modal/index.js @@ -18,11 +18,11 @@ const { MIN_GAS_PRICE_DEC, MIN_GAS_LIMIT_DEC, MIN_GAS_PRICE_GWEI, -} = require('../send/send.constants') +} = require('../../../pages/send/send.constants') const { isBalanceSufficient, -} = require('../send/send.utils') +} = require('../../../pages/send/send.utils') const { conversionUtil, @@ -47,7 +47,7 @@ const { const { getGasPrice, getGasLimit, -} = require('../send/send.selectors') +} = require('../../../pages/send/send.selectors') function mapStateToProps (state) { const selectedToken = getSelectedToken(state) diff --git a/ui/app/components/app/ens-input.js b/ui/app/components/app/ens-input.js index 274058a1b..424c5061e 100644 --- a/ui/app/components/app/ens-input.js +++ b/ui/app/components/app/ens-input.js @@ -10,7 +10,7 @@ const networkMap = require('ethjs-ens/lib/network-map.json') const ensRE = /.+\..+$/ const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const connect = require('react-redux').connect -const ToAutoComplete = require('./send/to-autocomplete').default +const ToAutoComplete = require('../../pages/send/to-autocomplete').default const log = require('loglevel') const { isValidENSAddress } = require('../../helpers/utils/util') diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index d541056f4..0e7e30347 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -63,7 +63,7 @@ import { import { calcGasTotal, isBalanceSufficient, -} from '../../send/send.utils' +} from '../../../../pages/send/send.utils' import { addHexPrefix } from 'ethereumjs-util' import { getAdjacentGasPrices, extrapolateY } from '../gas-price-chart/gas-price-chart.utils' diff --git a/ui/app/components/app/gas-customization/gas-price-button-group/index.scss b/ui/app/components/app/gas-customization/gas-price-button-group/index.scss index cb2f3ecf1..0b48995e2 100644 --- a/ui/app/components/app/gas-customization/gas-price-button-group/index.scss +++ b/ui/app/components/app/gas-customization/gas-price-button-group/index.scss @@ -99,15 +99,13 @@ } &__loading-container { - height: 78px; + height: 54px; } .button-group__button, .button-group__button--active { - height: 78px; background: white; color: $scorpion; - padding-top: 9px; - padding-left: 8.5px; + padding: 2px 8.5px 4px 8.5px; @media screen and (max-width: $break-small) { padding-left: 4px; diff --git a/ui/app/components/app/modals/customize-gas/customize-gas.component.js b/ui/app/components/app/modals/customize-gas/customize-gas.component.js index 178f45729..387da2f79 100644 --- a/ui/app/components/app/modals/customize-gas/customize-gas.component.js +++ b/ui/app/components/app/modals/customize-gas/customize-gas.component.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import BigNumber from 'bignumber.js' import GasModalCard from '../../customize-gas-modal/gas-modal-card' -import { MIN_GAS_PRICE_GWEI } from '../../send/send.constants' +import { MIN_GAS_PRICE_GWEI } from '../../../../pages/send/send.constants' import Button from '../../../ui/button' import { diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js index de8a3bbba..a8fb8c246 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.container.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.container.js @@ -15,7 +15,7 @@ import { setCustomGasLimit, } from '../../../ducks/gas/gas.duck' import { getIsMainnet, preferencesSelector, getSelectedAddress, conversionRateSelector } from '../../../selectors/selectors' -import { isBalanceSufficient } from '../send/send.utils' +import { isBalanceSufficient } from '../../../pages/send/send.utils' const mapStateToProps = (state, ownProps) => { const { metamask: { knownMethodData, accounts } } = state diff --git a/ui/app/components/ui/account-dropdown-mini/account-dropdown-mini.component.js b/ui/app/components/ui/account-dropdown-mini/account-dropdown-mini.component.js index 8abe1ab18..d9627e31b 100644 --- a/ui/app/components/ui/account-dropdown-mini/account-dropdown-mini.component.js +++ b/ui/app/components/ui/account-dropdown-mini/account-dropdown-mini.component.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import AccountListItem from '../../app/send/account-list-item/account-list-item.component' +import AccountListItem from '../../../pages/send/account-list-item/account-list-item.component' export default class AccountDropdownMini extends PureComponent { static propTypes = { diff --git a/ui/app/components/ui/account-dropdown-mini/tests/account-dropdown-mini.component.test.js b/ui/app/components/ui/account-dropdown-mini/tests/account-dropdown-mini.component.test.js index bc74ceb3c..9691f38aa 100644 --- a/ui/app/components/ui/account-dropdown-mini/tests/account-dropdown-mini.component.test.js +++ b/ui/app/components/ui/account-dropdown-mini/tests/account-dropdown-mini.component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import AccountDropdownMini from '../account-dropdown-mini.component' -import AccountListItem from '../../../app/send/account-list-item/account-list-item.component' +import AccountListItem from '../../../../pages/send/account-list-item/account-list-item.component' describe('AccountDropdownMini', () => { it('should render an account with an icon', () => { diff --git a/ui/app/components/ui/unit-input/unit-input.component.js b/ui/app/components/ui/unit-input/unit-input.component.js index 7b414f177..c5f8350a6 100644 --- a/ui/app/components/ui/unit-input/unit-input.component.js +++ b/ui/app/components/ui/unit-input/unit-input.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import { removeLeadingZeroes } from '../../app/send/send.utils' +import { removeLeadingZeroes } from '../../../pages/send/send.utils' /** * Component that attaches a suffix or unit of measurement trailing user input, ex. 'ETH'. Also diff --git a/ui/app/css/itcss/components/send.scss b/ui/app/css/itcss/components/send.scss index 07ab04613..91daf977e 100644 --- a/ui/app/css/itcss/components/send.scss +++ b/ui/app/css/itcss/components/send.scss @@ -549,7 +549,7 @@ } &__form-row { - margin: 14.5px 18px 0px; + margin: 8px 18px 0px; position: relative; display: flex; flex-flow: row; @@ -592,8 +592,8 @@ flex: 0 0 auto; } - &__from-dropdown { - height: 73px; + &__from-dropdown, + &__asset-dropdown { width: 100%; border: 1px solid $alto; border-radius: 4px; @@ -628,6 +628,104 @@ } } + &__from-dropdown { + height: 73px; + } + + &__asset-dropdown { + height: 62px; + border: none; + + &__asset { + display: flex; + flex-flow: row nowrap; + align-items: center; + padding: 10px 8px; + cursor: pointer; + + &:hover { + background-color: rgba($alto, 0.2); + } + } + + &__asset-icon { + .identicon { + border: 1px solid $alto; + } + } + + &__asset-data { + display: flex; + flex-flow: column nowrap; + margin-left: 8px; + } + + &__symbol { + font-size: 16px; + margin-bottom: 2px; + } + + &__name { + display: flex; + flex-flow: row nowrap; + font-size: 12px; + + &__label { + margin-right: .25rem; + } + } + + &__close-area { + z-index: 2000; + } + + &__list { + z-index: 2050; + position: absolute; + height: 220px; + width: 100%; + border: 1px solid $geyser; + border-radius: 4px; + background-color: $white; + box-shadow: 0 3px 6px 0 rgba(0 ,0 ,0 ,.11); + top: 55px; + left: 0; + box-sizing: content-box; + overflow-y: scroll; + } + + &__input-wrapper { + border: 1px solid $alto; + border-radius: 4px; + + &--opened { + position: relative; + z-index: 2050; + } + + .send-v2__asset-dropdown__asset { + &:hover { + background-color: $white; + } + } + } + + &__input { + z-index: 1025; + position: relative; + height: 54px; + width: 100%; + border: none; + border-radius: 4px; + background-color: $white; + color: $tundora; + padding: 10px; + font-family: Roboto; + font-size: 16px; + line-height: 21px; + } + } + &__to-autocomplete { position: relative; diff --git a/ui/app/ducks/metamask/metamask.js b/ui/app/ducks/metamask/metamask.js index 47c767d68..3ca487c1f 100644 --- a/ui/app/ducks/metamask/metamask.js +++ b/ui/app/ducks/metamask/metamask.js @@ -154,9 +154,26 @@ function reduceMetamask (state, action) { return newState case actions.SET_SELECTED_TOKEN: - return extend(metamaskState, { + newState = extend(metamaskState, { selectedTokenAddress: action.value, }) + const newSend = extend(metamaskState.send) + + if (metamaskState.send.editingTransactionId && !action.value) { + delete newSend.token + const unapprovedTx = newState.unapprovedTxs[newSend.editingTransactionId] || {} + const txParams = unapprovedTx.txParams || {} + newState.unapprovedTxs = extend(newState.unapprovedTxs, { + [newSend.editingTransactionId]: extend(unapprovedTx, { + txParams: extend(txParams, { data: '' }), + }), + }) + newSend.tokenBalance = null + newSend.balance = '0' + } + + newState.send = newSend + return newState case actions.SET_ACCOUNT_LABEL: const account = action.value.account diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index 63e63ce4a..be819b5f0 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types' import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import ConfirmPageContainer, { ConfirmDetailRow } from '../../components/app/confirm-page-container' -import { isBalanceSufficient } from '../../components/app/send/send.utils' +import { isBalanceSufficient } from '../send/send.utils' import { DEFAULT_ROUTE, CONFIRM_TRANSACTION_ROUTE } from '../../helpers/constants/routes' import { INSUFFICIENT_FUNDS_ERROR_KEY, diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js index 83543f1a4..2b087f5cc 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -14,9 +14,9 @@ import { GAS_LIMIT_TOO_LOW_ERROR_KEY, } from '../../helpers/constants/error-keys' import { getHexGasTotal } from '../../helpers/utils/confirm-tx.util' -import { isBalanceSufficient, calcGasTotal } from '../../components/app/send/send.utils' +import { isBalanceSufficient, calcGasTotal } from '../send/send.utils' import { conversionGreaterThan } from '../../helpers/utils/conversion-util' -import { MIN_GAS_LIMIT_DEC } from '../../components/app/send/send.constants' +import { MIN_GAS_LIMIT_DEC } from '../send/send.constants' import { checksumAddress, addressSlicer, valuesFor } from '../../helpers/utils/util' import {getMetaMaskAccounts, getAdvancedInlineGasShown, preferencesSelector, getIsMainnet} from '../../selectors/selectors' diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 7508654dc..d0a5d7b47 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' - +`` const mapStateToProps = state => { const { metamask, appState } = state const { diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index 1c96eaf8e..e38a6d6ce 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -10,7 +10,7 @@ import { getMetaMaskAccounts, getNetworkIdentifier } from '../../selectors/selec // init import FirstTimeFlow from '../first-time-flow' // accounts -const SendTransactionScreen = require('../../components/app/send/send.container') +const SendTransactionScreen = require('../send/send.container') const ConfirmTransaction = require('../confirm-transaction') // slideout menu diff --git a/ui/app/components/app/send/README.md b/ui/app/pages/send/README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/README.md +++ b/ui/app/pages/send/README.md diff --git a/ui/app/components/app/send/account-list-item/account-list-item-README.md b/ui/app/pages/send/account-list-item/account-list-item-README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/account-list-item/account-list-item-README.md +++ b/ui/app/pages/send/account-list-item/account-list-item-README.md diff --git a/ui/app/components/app/send/account-list-item/account-list-item.component.js b/ui/app/pages/send/account-list-item/account-list-item.component.js index 18e77b4f9..e6cca39b9 100644 --- a/ui/app/components/app/send/account-list-item/account-list-item.component.js +++ b/ui/app/pages/send/account-list-item/account-list-item.component.js @@ -1,11 +1,11 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import { checksumAddress } from '../../../../helpers/utils/util' -import Identicon from '../../../ui/identicon' -import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display' -import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common' -import Tooltip from '../../../ui/tooltip-v2' +import { checksumAddress } from '../../../helpers/utils/util' +import Identicon from '../../../components/ui/identicon' +import UserPreferencedCurrencyDisplay from '../../../components/app/user-preferenced-currency-display' +import { PRIMARY, SECONDARY } from '../../../helpers/constants/common' +import Tooltip from '../../../components/ui/tooltip-v2' export default class AccountListItem extends Component { diff --git a/ui/app/components/app/send/account-list-item/account-list-item.container.js b/ui/app/pages/send/account-list-item/account-list-item.container.js index bc9a60f49..21f800306 100644 --- a/ui/app/components/app/send/account-list-item/account-list-item.container.js +++ b/ui/app/pages/send/account-list-item/account-list-item.container.js @@ -8,7 +8,7 @@ import { getIsMainnet, isBalanceCached, preferencesSelector, -} from '../../../../selectors/selectors' +} from '../../../selectors/selectors' import AccountListItem from './account-list-item.component' export default connect(mapStateToProps)(AccountListItem) diff --git a/ui/app/components/app/send/account-list-item/index.js b/ui/app/pages/send/account-list-item/index.js index 907485cf7..907485cf7 100644 --- a/ui/app/components/app/send/account-list-item/index.js +++ b/ui/app/pages/send/account-list-item/index.js diff --git a/ui/app/components/app/send/account-list-item/tests/account-list-item-component.test.js b/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js index 5df9f77d6..bec88402d 100644 --- a/ui/app/components/app/send/account-list-item/tests/account-list-item-component.test.js +++ b/ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js @@ -3,15 +3,15 @@ import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' import proxyquire from 'proxyquire' -import Identicon from '../../../../ui/identicon' -import UserPreferencedCurrencyDisplay from '../../../user-preferenced-currency-display' +import Identicon from '../../../../components/ui/identicon' +import UserPreferencedCurrencyDisplay from '../../../../components/app/user-preferenced-currency-display' const utilsMethodStubs = { checksumAddress: sinon.stub().returns('mockCheckSumAddress'), } const AccountListItem = proxyquire('../account-list-item.component.js', { - '../../../../helpers/utils/util': utilsMethodStubs, + '../../../helpers/utils/util': utilsMethodStubs, }).default diff --git a/ui/app/components/app/send/account-list-item/tests/account-list-item-container.test.js b/ui/app/pages/send/account-list-item/tests/account-list-item-container.test.js index 19a9a02d0..33f932daf 100644 --- a/ui/app/components/app/send/account-list-item/tests/account-list-item-container.test.js +++ b/ui/app/pages/send/account-list-item/tests/account-list-item-container.test.js @@ -15,7 +15,7 @@ proxyquire('../account-list-item.container.js', { getCurrentCurrency: () => `mockCurrentCurrency`, getNativeCurrency: () => `mockNativeCurrency`, }, - '../../../../selectors/selectors': { + '../../../selectors/selectors': { isBalanceCached: () => `mockBalanceIsCached`, preferencesSelector: ({ showFiatInTestnets }) => ({ showFiatInTestnets, diff --git a/ui/app/components/app/send/index.js b/ui/app/pages/send/index.js index b5114babc..b5114babc 100644 --- a/ui/app/components/app/send/index.js +++ b/ui/app/pages/send/index.js diff --git a/ui/app/components/app/send/send-content/index.js b/ui/app/pages/send/send-content/index.js index 891c17e6a..891c17e6a 100644 --- a/ui/app/components/app/send/send-content/index.js +++ b/ui/app/pages/send/send-content/index.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/README.md b/ui/app/pages/send/send-content/send-amount-row/README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/README.md +++ b/ui/app/pages/send/send-content/send-amount-row/README.md diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js index f17137c1e..f17137c1e 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js index 16c5a0db5..cd48a105f 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js @@ -10,11 +10,11 @@ import { calcMaxAmount } from './amount-max-button.utils.js' import { updateSendAmount, setMaxModeTo, -} from '../../../../../../store/actions' +} from '../../../../../store/actions' import AmountMaxButton from './amount-max-button.component' import { updateSendErrors, -} from '../../../../../../ducks/send/send.duck' +} from '../../../../../ducks/send/send.duck' export default connect(mapStateToProps, mapDispatchToProps)(AmountMaxButton) diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js index 69fec1994..69fec1994 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.selectors.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js index f4c8fad8a..a570e49b4 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js @@ -1,7 +1,7 @@ const { multiplyCurrencies, subtractCurrencies, -} = require('../../../../../../helpers/utils/conversion-util') +} = require('../../../../../helpers/utils/conversion-util') const ethUtil = require('ethereumjs-util') function calcMaxAmount ({ balance, gasTotal, selectedToken, tokenBalance }) { diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/index.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/index.js index ee8271494..ee8271494 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/index.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/index.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js index b04d3897f..b04d3897f 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js index f446e330c..a75ed5e8f 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-container.test.js @@ -29,8 +29,8 @@ proxyquire('../amount-max-button.container.js', { }, './amount-max-button.selectors.js': { getMaxModeOn: (s) => `mockMaxModeOn:${s}` }, './amount-max-button.utils.js': { calcMaxAmount: (mockObj) => mockObj.val + 1 }, - '../../../../../../store/actions': actionSpies, - '../../../../../../ducks/send/send.duck': duckActionSpies, + '../../../../../store/actions': actionSpies, + '../../../../../ducks/send/send.duck': duckActionSpies, }) describe('amount-max-button container', () => { diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js index 655fe1969..655fe1969 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-selectors.test.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js index 1ee858f67..1ee858f67 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/index.js b/ui/app/pages/send/send-content/send-amount-row/index.js index abc6852fe..abc6852fe 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/index.js +++ b/ui/app/pages/send/send-content/send-amount-row/index.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.component.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js index e725e7eda..c0241ea91 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.component.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js @@ -2,8 +2,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper' import AmountMaxButton from './amount-max-button' -import UserPreferencedCurrencyInput from '../../../user-preferenced-currency-input' -import UserPreferencedTokenInput from '../../../user-preferenced-token-input' +import UserPreferencedCurrencyInput from '../../../../components/app/user-preferenced-currency-input' +import UserPreferencedTokenInput from '../../../../components/app/user-preferenced-token-input' export default class SendAmountRow extends Component { diff --git a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.container.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js index 0646355ab..2b3470da4 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.container.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.container.js @@ -17,10 +17,10 @@ import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils' import { setMaxModeTo, updateSendAmount, -} from '../../../../../store/actions' +} from '../../../../store/actions' import { updateSendErrors, -} from '../../../../../ducks/send/send.duck' +} from '../../../../ducks/send/send.duck' import SendAmountRow from './send-amount-row.component' export default connect(mapStateToProps, mapDispatchToProps)(SendAmountRow) diff --git a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.scss b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.scss +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.scss diff --git a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.selectors.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.selectors.js index fb08c7ed7..fb08c7ed7 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/send-amount-row.selectors.js +++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.selectors.js diff --git a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js index 14a71129f..62e0676db 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-component.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js @@ -6,7 +6,7 @@ import SendAmountRow from '../send-amount-row.component.js' import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component' import AmountMaxButton from '../amount-max-button/amount-max-button.container' -import UserPreferencedTokenInput from '../../../../user-preferenced-token-input' +import UserPreferencedTokenInput from '../../../../../components/app/user-preferenced-token-input' const propsMethodSpies = { setMaxModeTo: sinon.spy(), diff --git a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-container.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js index 6d20202b0..dada1c5e9 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-container.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-container.test.js @@ -37,8 +37,8 @@ proxyquire('../send-amount-row.container.js', { getAmountErrorObject: (mockDataObject) => ({ ...mockDataObject, mockChange: true }), getGasFeeErrorObject: (mockDataObject) => ({ ...mockDataObject, mockGasFeeErrorChange: true }), }, - '../../../../../store/actions': actionSpies, - '../../../../../ducks/send/send.duck': duckActionSpies, + '../../../../store/actions': actionSpies, + '../../../../ducks/send/send.duck': duckActionSpies, }) describe('send-amount-row container', () => { diff --git a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js index 4672cb8a7..4672cb8a7 100644 --- a/ui/app/components/app/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js +++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-selectors.test.js diff --git a/ui/app/pages/send/send-content/send-asset-row/index.js b/ui/app/pages/send/send-content/send-asset-row/index.js new file mode 100644 index 000000000..ba424a083 --- /dev/null +++ b/ui/app/pages/send/send-content/send-asset-row/index.js @@ -0,0 +1 @@ +export { default } from './send-asset-row.container' diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js new file mode 100644 index 000000000..256271a17 --- /dev/null +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -0,0 +1,152 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import SendRowWrapper from '../send-row-wrapper' +import Identicon from '../../../../components/ui/identicon/identicon.component' +import TokenBalance from '../../../../components/ui/token-balance' +import UserPreferencedCurrencyDisplay from '../../../../components/app/user-preferenced-currency-display' +import {PRIMARY} from '../../../../helpers/constants/common' + +export default class SendAssetRow extends Component { + static propTypes = { + tokens: PropTypes.arrayOf( + PropTypes.shape({ + address: PropTypes.string, + decimals: PropTypes.string, + symbol: PropTypes.string, + }) + ).isRequired, + accounts: PropTypes.object.isRequired, + selectedAddress: PropTypes.string.isRequired, + selectedTokenAddress: PropTypes.string, + setSelectedToken: PropTypes.func.isRequired, + } + + static contextTypes = { + t: PropTypes.func, + metricsEvent: PropTypes.func, + } + + state = { + isShowingDropdown: false, + } + + openDropdown = () => this.setState({ isShowingDropdown: true }) + + closeDropdown = () => this.setState({ isShowingDropdown: false }) + + selectToken = address => { + this.setState({ + isShowingDropdown: false, + }, () => { + this.context.metricsEvent({ + eventOpts: { + category: 'Transactions', + action: 'Send Screen', + name: 'User clicks "Assets" dropdown', + }, + customVariables: { + assetSelected: address ? 'ERC20' : 'ETH', + }, + }) + this.props.setSelectedToken(address) + }) + } + + render () { + const { t } = this.context + + return ( + <SendRowWrapper label={`${t('asset')}:`}> + <div className="send-v2__asset-dropdown"> + { this.renderSelectedToken() } + { this.renderAssetDropdown() } + </div> + </SendRowWrapper> + ) + } + + renderSelectedToken () { + const { selectedTokenAddress } = this.props + const token = this.props.tokens.find(({ address }) => address === selectedTokenAddress) + return ( + <div + className="send-v2__asset-dropdown__input-wrapper" + onClick={this.openDropdown} + > + { token ? this.renderAsset(token) : this.renderEth() } + </div> + ) + } + + renderAssetDropdown () { + return this.state.isShowingDropdown && ( + <div> + <div + className="send-v2__asset-dropdown__close-area" + onClick={this.closeDropdown} + /> + <div className="send-v2__asset-dropdown__list"> + { this.renderEth() } + { this.props.tokens.map(token => this.renderAsset(token)) } + </div> + </div> + ) + } + + renderEth () { + const { t } = this.context + const { accounts, selectedAddress } = this.props + + const balanceValue = accounts[selectedAddress] ? accounts[selectedAddress].balance : '' + + return ( + <div + className="send-v2__asset-dropdown__asset" + onClick={() => this.selectToken()} + > + <div className="send-v2__asset-dropdown__asset-icon"> + <Identicon diameter={36} /> + </div> + <div className="send-v2__asset-dropdown__asset-data"> + <div className="send-v2__asset-dropdown__symbol">ETH</div> + <div className="send-v2__asset-dropdown__name"> + <span className="send-v2__asset-dropdown__name__label">{`${t('balance')}:`}</span> + <UserPreferencedCurrencyDisplay + value={balanceValue} + type={PRIMARY} + /> + </div> + </div> + </div> + ) + } + + + renderAsset (token) { + const { address, symbol } = token + const { t } = this.context + + return ( + <div + key={address} className="send-v2__asset-dropdown__asset" + onClick={() => this.selectToken(address)} + > + <div className="send-v2__asset-dropdown__asset-icon"> + <Identicon address={address} diameter={36} /> + </div> + <div className="send-v2__asset-dropdown__asset-data"> + <div className="send-v2__asset-dropdown__symbol"> + { symbol } + </div> + <div className="send-v2__asset-dropdown__name"> + <span className="send-v2__asset-dropdown__name__label">{`${t('balance')}:`}</span> + <TokenBalance + token={token} + withSymbol + /> + </div> + </div> + </div> + ) + } +} diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js new file mode 100644 index 000000000..57b62fba1 --- /dev/null +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js @@ -0,0 +1,21 @@ +import { connect } from 'react-redux' +import SendAssetRow from './send-asset-row.component' +import {getMetaMaskAccounts} from '../../../../selectors/selectors' +import { setSelectedToken } from '../../../../store/actions' + +function mapStateToProps (state) { + return { + tokens: state.metamask.tokens, + selectedAddress: state.metamask.selectedAddress, + selectedTokenAddress: state.metamask.selectedTokenAddress, + accounts: getMetaMaskAccounts(state), + } +} + +function mapDispatchToProps (dispatch) { + return { + setSelectedToken: address => dispatch(setSelectedToken(address)), + } +} + +export default connect(mapStateToProps, mapDispatchToProps)(SendAssetRow) diff --git a/ui/app/components/app/send/send-content/send-content.component.js b/ui/app/pages/send/send-content/send-content.component.js index 2c09ceb19..d799806c7 100644 --- a/ui/app/components/app/send/send-content/send-content.component.js +++ b/ui/app/pages/send/send-content/send-content.component.js @@ -1,11 +1,12 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import PageContainerContent from '../../../ui/page-container/page-container-content.component' +import PageContainerContent from '../../../components/ui/page-container/page-container-content.component' import SendAmountRow from './send-amount-row' import SendFromRow from './send-from-row' import SendGasRow from './send-gas-row' import SendHexDataRow from './send-hex-data-row' import SendToRow from './send-to-row' +import SendAssetRow from './send-asset-row' export default class SendContent extends Component { @@ -26,6 +27,7 @@ export default class SendContent extends Component { updateGas={this.updateGas} scanQrCode={ _ => this.props.scanQrCode()} /> + <SendAssetRow /> <SendAmountRow updateGas={this.updateGas} /> <SendGasRow /> {(this.props.showHexData && ( diff --git a/ui/app/components/app/send/send-content/send-dropdown-list/index.js b/ui/app/pages/send/send-content/send-dropdown-list/index.js index 04af6536c..04af6536c 100644 --- a/ui/app/components/app/send/send-content/send-dropdown-list/index.js +++ b/ui/app/pages/send/send-content/send-dropdown-list/index.js diff --git a/ui/app/components/app/send/send-content/send-dropdown-list/send-dropdown-list.component.js b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js index 0d026bc69..0d026bc69 100644 --- a/ui/app/components/app/send/send-content/send-dropdown-list/send-dropdown-list.component.js +++ b/ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js diff --git a/ui/app/components/app/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js b/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js index b92dd4dfe..b92dd4dfe 100644 --- a/ui/app/components/app/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js +++ b/ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js diff --git a/ui/app/components/app/send/send-content/send-from-row/index.js b/ui/app/pages/send/send-content/send-from-row/index.js index 0a79726b2..0a79726b2 100644 --- a/ui/app/components/app/send/send-content/send-from-row/index.js +++ b/ui/app/pages/send/send-content/send-from-row/index.js diff --git a/ui/app/components/app/send/send-content/send-from-row/send-from-row.component.js b/ui/app/pages/send/send-content/send-from-row/send-from-row.component.js index dfa53e970..dfa53e970 100644 --- a/ui/app/components/app/send/send-content/send-from-row/send-from-row.component.js +++ b/ui/app/pages/send/send-content/send-from-row/send-from-row.component.js diff --git a/ui/app/components/app/send/send-content/send-from-row/send-from-row.container.js b/ui/app/pages/send/send-content/send-from-row/send-from-row.container.js index fe3ac9aa1..fe3ac9aa1 100644 --- a/ui/app/components/app/send/send-content/send-from-row/send-from-row.container.js +++ b/ui/app/pages/send/send-content/send-from-row/send-from-row.container.js diff --git a/ui/app/components/app/send/send-content/send-from-row/send-from-row.selectors.js b/ui/app/pages/send/send-content/send-from-row/send-from-row.selectors.js index 03ef4806b..03ef4806b 100644 --- a/ui/app/components/app/send/send-content/send-from-row/send-from-row.selectors.js +++ b/ui/app/pages/send/send-content/send-from-row/send-from-row.selectors.js diff --git a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-component.test.js b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-component.test.js index 18811c57e..18811c57e 100644 --- a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-component.test.js +++ b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-component.test.js diff --git a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-container.test.js b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-container.test.js index fd771ea77..fd771ea77 100644 --- a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-container.test.js +++ b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-container.test.js diff --git a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-selectors.test.js b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-selectors.test.js index ecb57bbc3..ecb57bbc3 100644 --- a/ui/app/components/app/send/send-content/send-from-row/tests/send-from-row-selectors.test.js +++ b/ui/app/pages/send/send-content/send-from-row/tests/send-from-row-selectors.test.js diff --git a/ui/app/components/app/send/send-content/send-gas-row/README.md b/ui/app/pages/send/send-content/send-gas-row/README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/README.md +++ b/ui/app/pages/send/send-content/send-gas-row/README.md diff --git a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js index 48088607a..3f5587318 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import UserPreferencedCurrencyDisplay from '../../../../user-preferenced-currency-display' -import { PRIMARY, SECONDARY } from '../../../../../../helpers/constants/common' +import UserPreferencedCurrencyDisplay from '../../../../../components/app/user-preferenced-currency-display' +import { PRIMARY, SECONDARY } from '../../../../../helpers/constants/common' export default class GasFeeDisplay extends Component { diff --git a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/index.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/index.js index dba0edb7b..dba0edb7b 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/index.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/index.js diff --git a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js index cb4180508..eedd43221 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js @@ -2,7 +2,7 @@ import React from 'react' import assert from 'assert' import {shallow} from 'enzyme' import GasFeeDisplay from '../gas-fee-display.component' -import UserPreferencedCurrencyDisplay from '../../../../../user-preferenced-currency-display' +import UserPreferencedCurrencyDisplay from '../../../../../../components/app/user-preferenced-currency-display' import sinon from 'sinon' diff --git a/ui/app/components/app/send/send-content/send-gas-row/index.js b/ui/app/pages/send/send-content/send-gas-row/index.js index 3c7ff1d5f..3c7ff1d5f 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/index.js +++ b/ui/app/pages/send/send-content/send-gas-row/index.js diff --git a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js index 424a65b20..1b850ac57 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js @@ -2,8 +2,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper' import GasFeeDisplay from './gas-fee-display/gas-fee-display.component' -import GasPriceButtonGroup from '../../../gas-customization/gas-price-button-group' -import AdvancedGasInputs from '../../../gas-customization/advanced-gas-inputs' +import GasPriceButtonGroup from '../../../../components/app/gas-customization/gas-price-button-group' +import AdvancedGasInputs from '../../../../components/app/gas-customization/advanced-gas-inputs' export default class SendGasRow extends Component { @@ -20,8 +20,8 @@ export default class SendGasRow extends Component { gasButtonGroupShown: PropTypes.bool, advancedInlineGasShown: PropTypes.bool, resetGasButtons: PropTypes.func, - gasPrice: PropTypes.number, - gasLimit: PropTypes.number, + gasPrice: PropTypes.string, + gasLimit: PropTypes.string, insufficientBalance: PropTypes.bool, } diff --git a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.container.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js index f81670c02..c4daa98af 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.container.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js @@ -15,18 +15,18 @@ import { getBasicGasEstimateLoadingStatus, getRenderableEstimateDataForSmallButtonsFromGWEI, getDefaultActiveButtonIndex, -} from '../../../../../selectors/custom-gas' +} from '../../../../selectors/custom-gas' import { showGasButtonGroup, -} from '../../../../../ducks/send/send.duck' +} from '../../../../ducks/send/send.duck' import { resetCustomData, setCustomGasPrice, setCustomGasLimit, -} from '../../../../../ducks/gas/gas.duck' +} from '../../../../ducks/gas/gas.duck' import { getGasLoadingError, gasFeeIsInError, getGasButtonGroupShown } from './send-gas-row.selectors.js' -import { showModal, setGasPrice, setGasLimit, setGasTotal } from '../../../../../store/actions' -import { getAdvancedInlineGasShown, getCurrentEthBalance, getSelectedToken } from '../../../../../selectors/selectors' +import { showModal, setGasPrice, setGasLimit, setGasTotal } from '../../../../store/actions' +import { getAdvancedInlineGasShown, getCurrentEthBalance, getSelectedToken } from '../../../../selectors/selectors' import SendGasRow from './send-gas-row.component' export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(SendGasRow) diff --git a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.scss b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.scss +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss diff --git a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.selectors.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.selectors.js index 79c838543..79c838543 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/send-gas-row.selectors.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.selectors.js diff --git a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js index 08f26854e..0cbc92621 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-component.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js @@ -6,7 +6,7 @@ import SendGasRow from '../send-gas-row.component.js' import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component' import GasFeeDisplay from '../gas-fee-display/gas-fee-display.component' -import GasPriceButtonGroup from '../../../../gas-customization/gas-price-button-group' +import GasPriceButtonGroup from '../../../../../components/app/gas-customization/gas-price-button-group' const propsMethodSpies = { showCustomizeGasModal: sinon.spy(), diff --git a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-container.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js index d1f753639..ddc6ea985 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-container.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-container.test.js @@ -32,7 +32,7 @@ proxyquire('../send-gas-row.container.js', { return () => ({}) }, }, - '../../../../../selectors/selectors': { + '../../../../selectors/selectors': { getCurrentEthBalance: (s) => `mockCurrentEthBalance:${s}`, getAdvancedInlineGasShown: (s) => `mockAdvancedInlineGasShown:${s}`, getSelectedToken: () => false, @@ -59,14 +59,14 @@ proxyquire('../send-gas-row.container.js', { gasFeeIsInError: (s) => `mockGasFeeError:${s}`, getGasButtonGroupShown: (s) => `mockGetGasButtonGroupShown:${s}`, }, - '../../../../../store/actions': actionSpies, - '../../../../../selectors/custom-gas': { + '../../../../store/actions': actionSpies, + '../../../../selectors/custom-gas': { getBasicGasEstimateLoadingStatus: (s) => `mockBasicGasEstimateLoadingStatus:${s}`, getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => `mockGasButtonInfo:${s}`, getDefaultActiveButtonIndex: (gasButtonInfo, gasPrice) => gasButtonInfo.length + gasPrice.length, }, - '../../../../../ducks/send/send.duck': sendDuckSpies, - '../../../../../ducks/gas/gas.duck': gasDuckSpies, + '../../../../ducks/send/send.duck': sendDuckSpies, + '../../../../ducks/gas/gas.duck': gasDuckSpies, }) describe('send-gas-row container', () => { diff --git a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js index bd3c9a257..bd3c9a257 100644 --- a/ui/app/components/app/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js +++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js diff --git a/ui/app/components/app/send/send-content/send-hex-data-row/index.js b/ui/app/pages/send/send-content/send-hex-data-row/index.js index 08c341067..08c341067 100644 --- a/ui/app/components/app/send/send-content/send-hex-data-row/index.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/index.js diff --git a/ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.component.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js index 62a74a77b..62a74a77b 100644 --- a/ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.component.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js diff --git a/ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.container.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js index 76c929d08..8b1c540c3 100644 --- a/ui/app/components/app/send/send-content/send-hex-data-row/send-hex-data-row.container.js +++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux' import { updateSendHexData, -} from '../../../../../store/actions' +} from '../../../../store/actions' import SendHexDataRow from './send-hex-data-row.component' export default connect(mapStateToProps, mapDispatchToProps)(SendHexDataRow) diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/index.js b/ui/app/pages/send/send-content/send-row-wrapper/index.js index d17545dcc..d17545dcc 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/index.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/index.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/index.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/index.js index c00617f83..c00617f83 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/index.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/index.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message-README.md diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js index 61bc7bab7..61bc7bab7 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js index 59622047f..59622047f 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.scss diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js index 2304a43d2..2304a43d2 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js index eecff165d..eecff165d 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/index.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/index.js index fd4d19ef7..fd4d19ef7 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/index.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/index.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js index f1caa8f99..f1caa8f99 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.component.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js index 7df14fd96..7df14fd96 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.container.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/send-row-warning-message.scss diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js index bd803d833..bd803d833 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-component.test.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js index 225bf056c..225bf056c 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-warning-message/tests/send-row-warning-message-container.test.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper-README.md b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper-README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper-README.md +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper-README.md diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.component.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.component.js index 94309bd96..94309bd96 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.component.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.component.js diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.scss b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/send-row-wrapper.scss +++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-wrapper.scss diff --git a/ui/app/components/app/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js index 30280e1d0..30280e1d0 100644 --- a/ui/app/components/app/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js +++ b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js diff --git a/ui/app/components/app/send/send-content/send-to-row/index.js b/ui/app/pages/send/send-content/send-to-row/index.js index 121f15148..121f15148 100644 --- a/ui/app/components/app/send/send-content/send-to-row/index.js +++ b/ui/app/pages/send/send-content/send-to-row/index.js diff --git a/ui/app/components/app/send/send-content/send-to-row/send-to-row-README.md b/ui/app/pages/send/send-content/send-to-row/send-to-row-README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-content/send-to-row/send-to-row-README.md +++ b/ui/app/pages/send/send-content/send-to-row/send-to-row-README.md diff --git a/ui/app/components/app/send/send-content/send-to-row/send-to-row.component.js b/ui/app/pages/send/send-content/send-to-row/send-to-row.component.js index e8a55cb2a..9baf327c1 100644 --- a/ui/app/components/app/send/send-content/send-to-row/send-to-row.component.js +++ b/ui/app/pages/send/send-content/send-to-row/send-to-row.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper' -import EnsInput from '../../../ens-input' +import EnsInput from '../../../../components/app/ens-input' import { getToErrorObject, getToWarningObject } from './send-to-row.utils.js' export default class SendToRow extends Component { diff --git a/ui/app/components/app/send/send-content/send-to-row/send-to-row.container.js b/ui/app/pages/send/send-content/send-to-row/send-to-row.container.js index 30865d295..2cbe9fcd0 100644 --- a/ui/app/components/app/send/send-content/send-to-row/send-to-row.container.js +++ b/ui/app/pages/send/send-content/send-to-row/send-to-row.container.js @@ -14,13 +14,13 @@ import { } from './send-to-row.selectors.js' import { updateSendTo, -} from '../../../../../store/actions' +} from '../../../../store/actions' import { updateSendErrors, updateSendWarnings, openToDropdown, closeToDropdown, -} from '../../../../../ducks/send/send.duck' +} from '../../../../ducks/send/send.duck' import SendToRow from './send-to-row.component' export default connect(mapStateToProps, mapDispatchToProps)(SendToRow) diff --git a/ui/app/components/app/send/send-content/send-to-row/send-to-row.selectors.js b/ui/app/pages/send/send-content/send-to-row/send-to-row.selectors.js index a6160d335..a6160d335 100644 --- a/ui/app/components/app/send/send-content/send-to-row/send-to-row.selectors.js +++ b/ui/app/pages/send/send-content/send-to-row/send-to-row.selectors.js diff --git a/ui/app/components/app/send/send-content/send-to-row/send-to-row.utils.js b/ui/app/pages/send/send-content/send-to-row/send-to-row.utils.js index 60e75d34c..d0a43f086 100644 --- a/ui/app/components/app/send/send-content/send-to-row/send-to-row.utils.js +++ b/ui/app/pages/send/send-content/send-to-row/send-to-row.utils.js @@ -4,8 +4,8 @@ const { KNOWN_RECIPIENT_ADDRESS_ERROR, INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR, } = require('../../send.constants') -const { isValidAddress, isEthNetwork } = require('../../../../../helpers/utils/util') -import { checkExistingAddresses } from '../../../../../pages/add-token/util' +const { isValidAddress, isEthNetwork } = require('../../../../helpers/utils/util') +import { checkExistingAddresses } from '../../../add-token/util' const ethUtil = require('ethereumjs-util') const contractMap = require('eth-contract-metadata') diff --git a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-component.test.js b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-component.test.js index d4d054057..c180d97f1 100644 --- a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-component.test.js +++ b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-component.test.js @@ -16,7 +16,7 @@ const SendToRow = proxyquire('../send-to-row.component.js', { }).default import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component' -import EnsInput from '../../../../ens-input' +import EnsInput from '../../../../../components/app/ens-input' const propsMethodSpies = { closeToDropdown: sinon.spy(), diff --git a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-container.test.js b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-container.test.js index 94b4f1024..bb8702e9a 100644 --- a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-container.test.js +++ b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-container.test.js @@ -36,8 +36,8 @@ proxyquire('../send-to-row.container.js', { sendToIsInWarning: (s) => `mockInWarning:${s}`, getTokens: (s) => `mockTokens:${s}`, }, - '../../../../../store/actions': actionSpies, - '../../../../../ducks/send/send.duck': duckActionSpies, + '../../../../store/actions': actionSpies, + '../../../../ducks/send/send.duck': duckActionSpies, }) describe('send-to-row container', () => { diff --git a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-selectors.test.js b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-selectors.test.js index 0fa342d1e..0fa342d1e 100644 --- a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-selectors.test.js +++ b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-selectors.test.js diff --git a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-utils.test.js b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-utils.test.js index 95882d640..f29f5efec 100644 --- a/ui/app/components/app/send/send-content/send-to-row/tests/send-to-row-utils.test.js +++ b/ui/app/pages/send/send-content/send-to-row/tests/send-to-row-utils.test.js @@ -13,7 +13,7 @@ const stubs = { } const toRowUtils = proxyquire('../send-to-row.utils.js', { - '../../../../../helpers/utils/util': { + '../../../../helpers/utils/util': { isValidAddress: stubs.isValidAddress, }, }) diff --git a/ui/app/components/app/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js index 7d102c930..521c6523e 100644 --- a/ui/app/components/app/send/send-content/tests/send-content-component.test.js +++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js @@ -3,12 +3,13 @@ import assert from 'assert' import { shallow } from 'enzyme' import SendContent from '../send-content.component.js' -import PageContainerContent from '../../../../ui/page-container/page-container-content.component' +import PageContainerContent from '../../../../components/ui/page-container/page-container-content.component' import SendAmountRow from '../send-amount-row/send-amount-row.container' import SendFromRow from '../send-from-row/send-from-row.container' import SendGasRow from '../send-gas-row/send-gas-row.container' import SendToRow from '../send-to-row/send-to-row.container' import SendHexDataRow from '../send-hex-data-row/send-hex-data-row.container' +import SendAssetRow from '../send-asset-row/send-asset-row.container' describe('SendContent Component', function () { let wrapper @@ -32,9 +33,10 @@ describe('SendContent Component', function () { const PageContainerContentChild = wrapper.find(PageContainerContent).children() assert(PageContainerContentChild.childAt(0).is(SendFromRow)) assert(PageContainerContentChild.childAt(1).is(SendToRow)) - assert(PageContainerContentChild.childAt(2).is(SendAmountRow)) - assert(PageContainerContentChild.childAt(3).is(SendGasRow)) - assert(PageContainerContentChild.childAt(4).is(SendHexDataRow)) + assert(PageContainerContentChild.childAt(2).is(SendAssetRow)) + assert(PageContainerContentChild.childAt(3).is(SendAmountRow)) + assert(PageContainerContentChild.childAt(4).is(SendGasRow)) + assert(PageContainerContentChild.childAt(5).is(SendHexDataRow)) }) it('should not render the SendHexDataRow if props.showHexData is false', () => { @@ -42,9 +44,10 @@ describe('SendContent Component', function () { const PageContainerContentChild = wrapper.find(PageContainerContent).children() assert(PageContainerContentChild.childAt(0).is(SendFromRow)) assert(PageContainerContentChild.childAt(1).is(SendToRow)) - assert(PageContainerContentChild.childAt(2).is(SendAmountRow)) - assert(PageContainerContentChild.childAt(3).is(SendGasRow)) - assert.equal(PageContainerContentChild.childAt(4).exists(), false) + assert(PageContainerContentChild.childAt(2).is(SendAssetRow)) + assert(PageContainerContentChild.childAt(3).is(SendAmountRow)) + assert(PageContainerContentChild.childAt(4).is(SendGasRow)) + assert.equal(PageContainerContentChild.childAt(5).exists(), false) }) }) }) diff --git a/ui/app/components/app/send/send-footer/README.md b/ui/app/pages/send/send-footer/README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-footer/README.md +++ b/ui/app/pages/send/send-footer/README.md diff --git a/ui/app/components/app/send/send-footer/index.js b/ui/app/pages/send/send-footer/index.js index 58e91d622..58e91d622 100644 --- a/ui/app/components/app/send/send-footer/index.js +++ b/ui/app/pages/send/send-footer/index.js diff --git a/ui/app/components/app/send/send-footer/send-footer.component.js b/ui/app/pages/send/send-footer/send-footer.component.js index 7d894391f..16a8fdde2 100644 --- a/ui/app/components/app/send/send-footer/send-footer.component.js +++ b/ui/app/pages/send/send-footer/send-footer.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import PageContainerFooter from '../../../ui/page-container/page-container-footer' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' +import PageContainerFooter from '../../../components/ui/page-container/page-container-footer' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../helpers/constants/routes' export default class SendFooter extends Component { diff --git a/ui/app/components/app/send/send-footer/send-footer.container.js b/ui/app/pages/send/send-footer/send-footer.container.js index 4757f6bec..68f4dc7c3 100644 --- a/ui/app/components/app/send/send-footer/send-footer.container.js +++ b/ui/app/pages/send/send-footer/send-footer.container.js @@ -6,7 +6,7 @@ import { signTokenTx, signTx, updateTransaction, -} from '../../../../store/actions' +} from '../../../store/actions' import SendFooter from './send-footer.component' import { getGasLimit, @@ -34,7 +34,7 @@ import { import { getRenderableEstimateDataForSmallButtonsFromGWEI, getDefaultActiveButtonIndex, -} from '../../../../selectors/custom-gas' +} from '../../../selectors/custom-gas' export default connect(mapStateToProps, mapDispatchToProps)(SendFooter) diff --git a/ui/app/components/app/send/send-footer/send-footer.scss b/ui/app/pages/send/send-footer/send-footer.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-footer/send-footer.scss +++ b/ui/app/pages/send/send-footer/send-footer.scss diff --git a/ui/app/components/app/send/send-footer/send-footer.selectors.js b/ui/app/pages/send/send-footer/send-footer.selectors.js index e20addfdc..e20addfdc 100644 --- a/ui/app/components/app/send/send-footer/send-footer.selectors.js +++ b/ui/app/pages/send/send-footer/send-footer.selectors.js diff --git a/ui/app/components/app/send/send-footer/send-footer.utils.js b/ui/app/pages/send/send-footer/send-footer.utils.js index abb2ebc77..91ac29014 100644 --- a/ui/app/components/app/send/send-footer/send-footer.utils.js +++ b/ui/app/pages/send/send-footer/send-footer.utils.js @@ -38,6 +38,7 @@ function constructUpdatedTx ({ }) { const unapprovedTx = unapprovedTxs[editingTransactionId] const txParamsData = unapprovedTx.txParams.data ? unapprovedTx.txParams.data : data + const editingTx = { ...unapprovedTx, txParams: Object.assign( diff --git a/ui/app/components/app/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js index 6683ca8c0..56fc95df2 100644 --- a/ui/app/components/app/send/send-footer/tests/send-footer-component.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js @@ -2,10 +2,10 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../../../helpers/constants/routes' +import { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } from '../../../../helpers/constants/routes' import SendFooter from '../send-footer.component.js' -import PageContainerFooter from '../../../../ui/page-container/page-container-footer' +import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer' const propsMethodSpies = { addToAddressBookIfNew: sinon.spy(), diff --git a/ui/app/components/app/send/send-footer/tests/send-footer-container.test.js b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js index 64c6451f2..118ebf356 100644 --- a/ui/app/components/app/send/send-footer/tests/send-footer-container.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js @@ -28,7 +28,7 @@ proxyquire('../send-footer.container.js', { return () => ({}) }, }, - '../../../../store/actions': actionSpies, + '../../../store/actions': actionSpies, '../send.selectors': { getGasLimit: (s) => `mockGasLimit:${s}`, getGasPrice: (s) => `mockGasPrice:${s}`, @@ -46,7 +46,7 @@ proxyquire('../send-footer.container.js', { }, './send-footer.selectors': { isSendFormInError: (s) => `mockInError:${s}` }, './send-footer.utils': utilsStubs, - '../../../../selectors/custom-gas': { + '../../../selectors/custom-gas': { getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => ([{ labelKey: `mockLabel:${s}` }]), getDefaultActiveButtonIndex: () => 0, }, diff --git a/ui/app/components/app/send/send-footer/tests/send-footer-selectors.test.js b/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js index 8de032f57..8de032f57 100644 --- a/ui/app/components/app/send/send-footer/tests/send-footer-selectors.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js diff --git a/ui/app/components/app/send/send-footer/tests/send-footer-utils.test.js b/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js index 28ff0c891..f4705e691 100644 --- a/ui/app/components/app/send/send-footer/tests/send-footer-utils.test.js +++ b/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js @@ -149,7 +149,6 @@ describe('send-footer utils', () => { }, }, }) - assert.deepEqual(result, { unapprovedTxParam: 'someOtherParam', txParams: { diff --git a/ui/app/components/app/send/send-header/README.md b/ui/app/pages/send/send-header/README.md index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send-header/README.md +++ b/ui/app/pages/send/send-header/README.md diff --git a/ui/app/components/app/send/send-header/index.js b/ui/app/pages/send/send-header/index.js index 0b17f0b7d..0b17f0b7d 100644 --- a/ui/app/components/app/send/send-header/index.js +++ b/ui/app/pages/send/send-header/index.js diff --git a/ui/app/components/app/send/send-header/send-header.component.js b/ui/app/pages/send/send-header/send-header.component.js index f216954ef..02bda383e 100644 --- a/ui/app/components/app/send/send-header/send-header.component.js +++ b/ui/app/pages/send/send-header/send-header.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import PageContainerHeader from '../../../ui/page-container/page-container-header' -import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes' +import PageContainerHeader from '../../../components/ui/page-container/page-container-header' +import { DEFAULT_ROUTE } from '../../../helpers/constants/routes' export default class SendHeader extends Component { diff --git a/ui/app/components/app/send/send-header/send-header.container.js b/ui/app/pages/send/send-header/send-header.container.js index ce53fba9a..1a9c5e9c0 100644 --- a/ui/app/components/app/send/send-header/send-header.container.js +++ b/ui/app/pages/send/send-header/send-header.container.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux' -import { clearSend } from '../../../../store/actions' +import { clearSend } from '../../../store/actions' import SendHeader from './send-header.component' import { getSubtitleParams, getTitleKey } from './send-header.selectors' diff --git a/ui/app/components/app/send/send-header/send-header.selectors.js b/ui/app/pages/send/send-header/send-header.selectors.js index d7c9d3766..d7c9d3766 100644 --- a/ui/app/components/app/send/send-header/send-header.selectors.js +++ b/ui/app/pages/send/send-header/send-header.selectors.js diff --git a/ui/app/components/app/send/send-header/tests/send-header-component.test.js b/ui/app/pages/send/send-header/tests/send-header-component.test.js index db2ee8967..4a5575e9f 100644 --- a/ui/app/components/app/send/send-header/tests/send-header-component.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-component.test.js @@ -2,10 +2,10 @@ import React from 'react' import assert from 'assert' import { shallow } from 'enzyme' import sinon from 'sinon' -import { DEFAULT_ROUTE } from '../../../../../helpers/constants/routes' +import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes' import SendHeader from '../send-header.component.js' -import PageContainerHeader from '../../../../ui/page-container/page-container-header' +import PageContainerHeader from '../../../../components/ui/page-container/page-container-header' const propsMethodSpies = { clearSend: sinon.spy(), diff --git a/ui/app/components/app/send/send-header/tests/send-header-container.test.js b/ui/app/pages/send/send-header/tests/send-header-container.test.js index 634c3424b..fdad8aab3 100644 --- a/ui/app/components/app/send/send-header/tests/send-header-container.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-container.test.js @@ -17,7 +17,7 @@ proxyquire('../send-header.container.js', { return () => ({}) }, }, - '../../../../store/actions': actionSpies, + '../../../store/actions': actionSpies, './send-header.selectors': { getTitleKey: (s) => `mockTitleKey:${s}`, getSubtitleParams: (s) => `mockSubtitleParams:${s}`, diff --git a/ui/app/components/app/send/send-header/tests/send-header-selectors.test.js b/ui/app/pages/send/send-header/tests/send-header-selectors.test.js index e0c6a3ab3..e0c6a3ab3 100644 --- a/ui/app/components/app/send/send-header/tests/send-header-selectors.test.js +++ b/ui/app/pages/send/send-header/tests/send-header-selectors.test.js diff --git a/ui/app/components/app/send/send.component.js b/ui/app/pages/send/send.component.js index a38b681b0..5f0c9c9f2 100644 --- a/ui/app/components/app/send/send.component.js +++ b/ui/app/pages/send/send.component.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import PersistentForm from '../../../../lib/persistent-form' +import PersistentForm from '../../../lib/persistent-form' import { getAmountErrorObject, getGasFeeErrorObject, @@ -112,6 +112,7 @@ export default class SendTransactionScreen extends PersistentForm { gasTotal: prevGasTotal, tokenBalance: prevTokenBalance, network: prevNetwork, + selectedToken: prevSelectedToken, } = prevProps const uninitialized = [prevBalance, prevGasTotal].every(n => n === null) @@ -161,6 +162,13 @@ export default class SendTransactionScreen extends PersistentForm { this.updateGas() } } + + const prevTokenAddress = prevSelectedToken && prevSelectedToken.address + const selectedTokenAddress = selectedToken && selectedToken.address + + if (selectedTokenAddress && prevTokenAddress !== selectedTokenAddress) { + this.updateSendToken() + } } componentDidMount () { @@ -171,18 +179,7 @@ export default class SendTransactionScreen extends PersistentForm { } componentWillMount () { - const { - from: { address }, - selectedToken, - tokenContract, - updateSendTokenBalance, - } = this.props - - updateSendTokenBalance({ - selectedToken, - tokenContract, - address, - }) + this.updateSendToken() // Show QR Scanner modal if ?scan=true if (window.location.search === '?scan=true') { @@ -199,6 +196,21 @@ export default class SendTransactionScreen extends PersistentForm { this.props.resetSendState() } + updateSendToken () { + const { + from: { address }, + selectedToken, + tokenContract, + updateSendTokenBalance, + } = this.props + + updateSendTokenBalance({ + selectedToken, + tokenContract, + address, + }) + } + render () { const { history, showHexData } = this.props diff --git a/ui/app/components/app/send/send.constants.js b/ui/app/pages/send/send.constants.js index 36549038e..d3fa38d10 100644 --- a/ui/app/components/app/send/send.constants.js +++ b/ui/app/pages/send/send.constants.js @@ -1,5 +1,5 @@ const ethUtil = require('ethereumjs-util') -const { conversionUtil, multiplyCurrencies } = require('../../../helpers/utils/conversion-util') +const { conversionUtil, multiplyCurrencies } = require('../../helpers/utils/conversion-util') const MIN_GAS_PRICE_DEC = '0' const MIN_GAS_PRICE_HEX = (parseInt(MIN_GAS_PRICE_DEC)).toString(16) diff --git a/ui/app/components/app/send/send.container.js b/ui/app/pages/send/send.container.js index 303639c76..69adbb765 100644 --- a/ui/app/components/app/send/send.container.js +++ b/ui/app/pages/send/send.container.js @@ -4,7 +4,7 @@ import { withRouter } from 'react-router-dom' import { compose } from 'recompose' const { getSelectedAddress, -} = require('../../../selectors/selectors') +} = require('../../selectors/selectors') import { getAmountConversionRate, @@ -34,21 +34,21 @@ import { setGasTotal, showQrScanner, qrCodeDetected, -} from '../../../store/actions' +} from '../../store/actions' import { resetSendState, updateSendErrors, -} from '../../../ducks/send/send.duck' +} from '../../ducks/send/send.duck' import { fetchBasicGasEstimates, -} from '../../../ducks/gas/gas.duck' +} from '../../ducks/gas/gas.duck' import { calcGasTotal, } from './send.utils.js' import { SEND_ROUTE, -} from '../../../helpers/constants/routes' +} from '../../helpers/constants/routes' module.exports = compose( withRouter, diff --git a/ui/app/components/app/send/send.scss b/ui/app/pages/send/send.scss index e69de29bb..e69de29bb 100644 --- a/ui/app/components/app/send/send.scss +++ b/ui/app/pages/send/send.scss diff --git a/ui/app/components/app/send/send.selectors.js b/ui/app/pages/send/send.selectors.js index 6056dea21..d4035df28 100644 --- a/ui/app/components/app/send/send.selectors.js +++ b/ui/app/pages/send/send.selectors.js @@ -1,19 +1,19 @@ -const { valuesFor } = require('../../../helpers/utils/util') +const { valuesFor } = require('../../helpers/utils/util') const abi = require('human-standard-token-abi') const { multiplyCurrencies, -} = require('../../../helpers/utils/conversion-util') +} = require('../../helpers/utils/conversion-util') const { getMetaMaskAccounts, getSelectedAddress, -} = require('../../../selectors/selectors') +} = require('../../selectors/selectors') const { estimateGasPriceFromRecentBlocks, calcGasTotal, } = require('./send.utils') import { getFastPriceEstimateInHexWEI, -} from '../../../selectors/custom-gas' +} from '../../selectors/custom-gas' const selectors = { accountsWithSendEtherInfoSelector, diff --git a/ui/app/components/app/send/send.utils.js b/ui/app/pages/send/send.utils.js index 7609d46ea..4acc174f9 100644 --- a/ui/app/components/app/send/send.utils.js +++ b/ui/app/pages/send/send.utils.js @@ -5,10 +5,10 @@ const { multiplyCurrencies, conversionGreaterThan, conversionLessThan, -} = require('../../../helpers/utils/conversion-util') +} = require('../../helpers/utils/conversion-util') const { calcTokenAmount, -} = require('../../../helpers/utils/token-util') +} = require('../../helpers/utils/token-util') const { BASE_TOKEN_GAS_COST, INSUFFICIENT_FUNDS_ERROR, diff --git a/ui/app/components/app/send/tests/send-component.test.js b/ui/app/pages/send/tests/send-component.test.js index 738c14839..81955cc1d 100644 --- a/ui/app/components/app/send/tests/send-component.test.js +++ b/ui/app/pages/send/tests/send-component.test.js @@ -3,7 +3,7 @@ import assert from 'assert' import proxyquire from 'proxyquire' import { shallow } from 'enzyme' import sinon from 'sinon' -import timeout from '../../../../../lib/test-timeout' +import timeout from '../../../../lib/test-timeout' import SendHeader from '../send-header/send-header.container' import SendContent from '../send-content/send-content.component' diff --git a/ui/app/components/app/send/tests/send-container.test.js b/ui/app/pages/send/tests/send-container.test.js index 9d7365ac9..b3e202030 100644 --- a/ui/app/components/app/send/tests/send-container.test.js +++ b/ui/app/pages/send/tests/send-container.test.js @@ -46,11 +46,11 @@ proxyquire('../send.container.js', { getTokenBalance: (s) => `mockTokenBalance:${s}`, getQrCodeData: (s) => `mockQrCodeData:${s}`, }, - '../../../selectors/selectors': { + '../../selectors/selectors': { getSelectedAddress: (s) => `mockSelectedAddress:${s}`, }, - '../../../store/actions': actionSpies, - '../../../ducks/send/send.duck': duckActionSpies, + '../../store/actions': actionSpies, + '../../ducks/send/send.duck': duckActionSpies, './send.utils.js': { calcGasTotal: (gasLimit, gasPrice) => gasLimit + gasPrice, }, diff --git a/ui/app/components/app/send/tests/send-selectors-test-data.js b/ui/app/pages/send/tests/send-selectors-test-data.js index cff26a191..cff26a191 100644 --- a/ui/app/components/app/send/tests/send-selectors-test-data.js +++ b/ui/app/pages/send/tests/send-selectors-test-data.js diff --git a/ui/app/components/app/send/tests/send-selectors.test.js b/ui/app/pages/send/tests/send-selectors.test.js index ccc126795..ccc126795 100644 --- a/ui/app/components/app/send/tests/send-selectors.test.js +++ b/ui/app/pages/send/tests/send-selectors.test.js diff --git a/ui/app/components/app/send/tests/send-utils.test.js b/ui/app/pages/send/tests/send-utils.test.js index fc4c6deed..b19535b9e 100644 --- a/ui/app/components/app/send/tests/send-utils.test.js +++ b/ui/app/pages/send/tests/send-utils.test.js @@ -9,7 +9,7 @@ import { const { addCurrencies, subtractCurrencies, -} = require('../../../../helpers/utils/conversion-util') +} = require('../../../helpers/utils/conversion-util') const { INSUFFICIENT_FUNDS_ERROR, @@ -32,7 +32,7 @@ const stubs = { } const sendUtils = proxyquire('../send.utils.js', { - '../../../helpers/utils/conversion-util': { + '../../helpers/utils/conversion-util': { addCurrencies: stubs.addCurrencies, conversionUtil: stubs.conversionUtil, conversionGTE: stubs.conversionGTE, @@ -40,7 +40,7 @@ const sendUtils = proxyquire('../send.utils.js', { conversionGreaterThan: stubs.conversionGreaterThan, conversionLessThan: stubs.conversionLessThan, }, - '../../../helpers/utils/token-util': { calcTokenAmount: stubs.calcTokenAmount }, + '../../helpers/utils/token-util': { calcTokenAmount: stubs.calcTokenAmount }, 'ethereumjs-abi': { rawEncode: stubs.rawEncode, }, diff --git a/ui/app/components/app/send/to-autocomplete.component.js b/ui/app/pages/send/to-autocomplete.component.js index 183967c58..183967c58 100644 --- a/ui/app/components/app/send/to-autocomplete.component.js +++ b/ui/app/pages/send/to-autocomplete.component.js diff --git a/ui/app/components/app/send/to-autocomplete/index.js b/ui/app/pages/send/to-autocomplete/index.js index 244d301d1..244d301d1 100644 --- a/ui/app/components/app/send/to-autocomplete/index.js +++ b/ui/app/pages/send/to-autocomplete/index.js diff --git a/ui/app/components/app/send/to-autocomplete/to-autocomplete.js b/ui/app/pages/send/to-autocomplete/to-autocomplete.js index d3db8cb59..b246413fb 100644 --- a/ui/app/components/app/send/to-autocomplete/to-autocomplete.js +++ b/ui/app/pages/send/to-autocomplete/to-autocomplete.js @@ -4,8 +4,8 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const AccountListItem = require('../account-list-item/account-list-item.component').default const connect = require('react-redux').connect -const Tooltip = require('../../../ui/tooltip') -const checksumAddress = require('../../../../helpers/utils/util').checksumAddress +const Tooltip = require('../../../components/ui/tooltip') +const checksumAddress = require('../../../helpers/utils/util').checksumAddress ToAutoComplete.contextTypes = { t: PropTypes.func, diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index ecffb37ca..5ba786f0f 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -18,7 +18,7 @@ import { } from '../helpers/utils/formatters' import { calcGasTotal, -} from '../components/app/send/send.utils' +} from '../pages/send/send.utils' import { addHexPrefix } from 'ethereumjs-util' const selectors = { diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 7d369fdb9..f594d9002 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -5,7 +5,7 @@ const { getTokenAddressFromTokenObject } = require('../helpers/utils/util') const { calcTokenBalance, estimateGas, -} = require('../components/app/send/send.utils') +} = require('../pages/send/send.utils') const ethUtil = require('ethereumjs-util') const { fetchLocale } = require('../helpers/utils/i18n-helper') const log = require('loglevel') |