From bdc819ae9aa954e625b48e8c6fdb7a871e894379 Mon Sep 17 00:00:00 2001 From: Jony Bursztyn Date: Wed, 4 Sep 2024 17:11:59 +0100 Subject: [PATCH] fix: move porfolio button next to price amount (#26867) (#26897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry picks: https://github.com/MetaMask/metamask-extension/pull/26867 into V12.5.0 ## **Description** Moves the portfolio button so that it's next to the token price amount. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26867?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3201 ## **Manual testing steps** 1. Go to the portfolio page 2. Check that the Portfolio button is present next to the price amount of token 3. Click it to test it works fine ## **Screenshots/Recordings** Screenshot 2024-09-03 at 22 57 32 Screenshot 2024-09-03 at 22 58 54 ### **Before** Screenshot 2024-09-03 at 15 46 36 ### **After** Screenshot 2024-09-03 at 22 58 54 ## **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 - [ ] I’ve included tests if applicable - [ ] 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** - [X] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [X] 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. --- .../app/wallet-overview/coin-buttons.tsx | 32 ++++++------ .../app/wallet-overview/coin-overview.tsx | 51 +++++++++++-------- ui/components/app/wallet-overview/index.scss | 6 +++ .../__snapshots__/asset-page.test.tsx.snap | 24 ++++----- 4 files changed, 63 insertions(+), 50 deletions(-) diff --git a/ui/components/app/wallet-overview/coin-buttons.tsx b/ui/components/app/wallet-overview/coin-buttons.tsx index 1bd24c23ecdb..73b0679b49a7 100644 --- a/ui/components/app/wallet-overview/coin-buttons.tsx +++ b/ui/components/app/wallet-overview/coin-buttons.tsx @@ -326,22 +326,6 @@ const CoinButtons = ({ ///: END:ONLY_INCLUDE_IF } - - } - disabled={!isSigningEnabled} - label={t('send')} - onClick={handleSendOnClick} - tooltipRender={(contents: React.ReactElement) => - generateTooltip('sendButton', contents) - } - /> ///: END:ONLY_INCLUDE_IF } + + } + disabled={!isSigningEnabled} + label={t('send')} + onClick={handleSendOnClick} + tooltipRender={(contents: React.ReactElement) => + generateTooltip('sendButton', contents) + } + /> { <> {showReceiveModal && ( diff --git a/ui/components/app/wallet-overview/coin-overview.tsx b/ui/components/app/wallet-overview/coin-overview.tsx index 547ef107b05d..1a5e408bcac5 100644 --- a/ui/components/app/wallet-overview/coin-overview.tsx +++ b/ui/components/app/wallet-overview/coin-overview.tsx @@ -4,7 +4,7 @@ import classnames from 'classnames'; import { zeroAddress } from 'ethereumjs-util'; import { CaipChainId } from '@metamask/utils'; import type { Hex } from '@metamask/utils'; -import { Icon, IconName } from '../../component-library'; +import { Icon, IconName, IconSize } from '../../component-library'; import { IconColor } from '../../../helpers/constants/design-system'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { @@ -122,14 +122,6 @@ export const CoinOverview = ({ disabled={!balanceIsCached} >
-
- {t('portfolio')} - -
{balance ? ( )}
- {showFiat && isOriginalNativeSymbol && balance && ( - - )} +
+ {showFiat && isOriginalNativeSymbol && balance && ( + + )} +
+ {t('portfolio')} + +
+
{isEvm && (