Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add network picker to AssetPicker (#26559)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Changes included in this PR: * Add a network picker to the AssetPicker modal component so that it can be reused within the cross-chain swaps experience * Update AssetPicker components to enable displaying network and asset data when the selected network is not the same as the wallet's active network. Example usecase: destination asset for cross-chain swaps. Specifically: - when selected `network` is not the same as wallet's network, display - selected network's icons in asset list - selected network's native token icons - add `customTokenListGenerator` prop to AssetPicker that allows upstream components to override the default displayed token list Figma design: https://www.figma.com/design/bC6RgeriyERMtMlZE8xwkm/Cross-Chain-Swaps?node-id=1490-18690&t=pnpoVVaJTqh15I0a-0 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26559?quickstart=1) ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/METABRIDGE-866 ## **Manual testing steps** 1. Swap+Send asset selection experience should not change 2. Storybook should show an AssetPicker variation that has a network picker ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> <img width="409" alt="Screenshot 2024-08-21 at 2 10 06 PM" src="https://github.com/user-attachments/assets/4a5999ae-711c-4d33-80b6-5422b5756f6c"> ### **After** <!-- [screenshots/recordings] --> ![Screenshot 2024-10-02 at 4 09 51 PM](https://github.com/user-attachments/assets/ff3f2854-7120-4f3d-9e55-88a325a5b3db)<img width="409" alt="Screenshot 2024-08-21 at 2 09 04 PM" src="https://github.com/user-attachments/assets/206367fb-3551-491c-a223-06553583c40d"> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [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. ## **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