From 014c9dc40e4ec9b7c2649d3cd137884ad5300e6f Mon Sep 17 00:00:00 2001 From: Micaela Estabillo <100321200+micaelae@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:49:56 -0800 Subject: [PATCH] fix: hide network picker back button when network is unselected (#29711) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This hides the network picker's back button when there's no selected network. Currently this causes the dest network picker to navigate to the src asset picker [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29711?quickstart=1) ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1852 ## **Manual testing steps** 1. Load bridge page 2. Open dest asset picker 3. Verify that back button is not visible ## **Screenshots/Recordings** ### **Before** https://github.com/user-attachments/assets/4bbde8e4-bdd5-4fa2-aeb5-248d433e25a2 ### **After** https://github.com/user-attachments/assets/731280a5-3faf-401c-9236-8e932a9f347e ## **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/main/.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/main/.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. --- .../asset-picker-modal-network.test.tsx.snap | 28 ------------------- .../asset-picker-modal-network.tsx | 2 +- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/__snapshots__/asset-picker-modal-network.test.tsx.snap b/ui/components/multichain/asset-picker-amount/asset-picker-modal/__snapshots__/asset-picker-modal-network.test.tsx.snap index f0d99284b7a8..7cc9ddd4d8e0 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/__snapshots__/asset-picker-modal-network.test.tsx.snap +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/__snapshots__/asset-picker-modal-network.test.tsx.snap @@ -32,20 +32,6 @@ exports[`AssetPickerModalNetwork renders modal with no network list by default 1
-
- -
@@ -121,20 +107,6 @@ exports[`AssetPickerModalNetwork should not show selected network when network p
-
- -
diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal-network.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal-network.tsx index 862e8e842b8d..a682c85a2cd9 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal-network.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal-network.tsx @@ -160,7 +160,7 @@ export const AssetPickerModalNetwork = ({