Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: overhaul
AssetPickerAmount
(#23192)
## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> As part of the ongoing monetization initiative in default experiences, Swap+Send was prioritized and assigned to the bridge team in an effort to capture revenue immediately following a send transaction; these typically go to MetaMask alternatives (i.e., Uniswap). A blocking for this flow is an agnostic, [design-compliant](https://www.figma.com/file/kVg6zwoyHt0fH2MGBlLrM3/Asset-Picker-(Extension)?type=design&node-id=224-149854&mode=design&t=ZUzvFEl0He30NL5M-0), component. Therefore, this PR aims to build a robust, optimized component to put at the heart of the Swap+Send experience. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23192?quickstart=1) ## **Related issues** [METABRIDGE-843](https://consensyssoftware.atlassian.net/browse/METABRIDGE-843) ## **Manual testing steps** 1. Run local server with `MULTICHAIN` environment variable set to `1` 2. Go to Swap page 3. Ensure that the updated component is there (see: [designs](https://www.figma.com/file/kVg6zwoyHt0fH2MGBlLrM3/Asset-Picker-(Extension)?type=design&node-id=224-149854&mode=design&t=BLuV7Q9MQ0QogGnR-0)) 4. Ensure that toggling the swap button switches the places of the fiat and raw token amount - ensure that both accept input and correctly adjust their counterpart 5. Ensure that the max button only shows for tokens when the raw token is in the input field – native token transfers will be slightly reduced for gas 6. Ensure that the token dropdown correctly adjusts when an ERC-721 or ERC-1155 is selected (see: [designs](https://www.figma.com/file/kVg6zwoyHt0fH2MGBlLrM3/Asset-Picker-(Extension)?type=design&node-id=224-149854&mode=design&t=BLuV7Q9MQ0QogGnR-0)) ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### Token #### **Before** <img width="371" alt="token old" src="https://github.com/MetaMask/metamask-extension/assets/44588480/85598e7d-d436-499c-833e-c273535db824"> #### **After** <img width="342" alt="token new" src="https://github.com/MetaMask/metamask-extension/assets/44588480/6a39c26e-b456-488e-88af-95c8d725b5a2"> ### ERC-721 #### **Before** <img width="371" alt="erc721 old" src="https://github.com/MetaMask/metamask-extension/assets/44588480/7f8762de-1c19-4cdb-aa1c-f90f08d1f279"> #### **After** <img width="342" alt="erc721 new" src="https://github.com/MetaMask/metamask-extension/assets/44588480/2d5e768d-1864-4699-a75b-cd47922936a4"> ### ERC-1155 #### **Before** <img width="371" alt="erc1155 old" src="https://github.com/MetaMask/metamask-extension/assets/44588480/6357dd4b-0178-440a-a4ba-79502385843e"> #### **After** <img width="342" alt="erc1155 new" src="https://github.com/MetaMask/metamask-extension/assets/44588480/18590bb0-abaa-4a56-9710-2325a99601ee"> ### New flow recording https://github.com/MetaMask/metamask-extension/assets/44588480/b5067372-ccec-4d34-977c-8dd8e42e8dc5 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information