From 927ee6f8224808d4325e07976dd2010b824209f5 Mon Sep 17 00:00:00 2001 From: Pete Watters <2938440+pete-watters@users.noreply.github.com> Date: Tue, 19 Mar 2024 19:11:38 +0000 Subject: [PATCH] chore: don't show account info and balance in psbt headers and block logo click --- src/app/features/container/container.tsx | 4 +++- .../container/utils/get-popup-header.ts | 17 +++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/app/features/container/container.tsx b/src/app/features/container/container.tsx index 8fc4ce04e3..c519a23675 100644 --- a/src/app/features/container/container.tsx +++ b/src/app/features/container/container.tsx @@ -33,6 +33,7 @@ import { TotalBalance } from './total-balance'; import { getDisplayAddresssBalanceOf, isKnownPopupRoute, + isRpcRoute, showAccountInfo, showBalanceInfo, } from './utils/get-popup-header'; @@ -103,6 +104,7 @@ export function Container() { const hideSettings = isKnownPopupRoute(pathname) || isSummaryPage(pathname) || variant === 'onboarding'; + const isLogoClickable = variant !== 'home' && !isRpcRoute(pathname); return ( <> navigate(RouteUrls.Home) : undefined} + onClick={isLogoClickable ? () => navigate(RouteUrls.Home) : undefined} /> ) diff --git a/src/app/features/container/utils/get-popup-header.ts b/src/app/features/container/utils/get-popup-header.ts index d42d48e8e2..9c97b7ac67 100644 --- a/src/app/features/container/utils/get-popup-header.ts +++ b/src/app/features/container/utils/get-popup-header.ts @@ -3,14 +3,22 @@ */ import { RouteUrls } from '@shared/route-urls'; +export function isRpcRoute(pathname: RouteUrls) { + switch (pathname) { + case RouteUrls.PsbtRequest: + case RouteUrls.SignatureRequest: + case RouteUrls.RpcStacksSignature: + return true; + default: + return false; + } +} + export function showAccountInfo(pathname: RouteUrls) { switch (pathname) { case RouteUrls.TransactionRequest: case RouteUrls.ProfileUpdateRequest: - case RouteUrls.PsbtRequest: case RouteUrls.RpcSendTransfer: - case RouteUrls.SignatureRequest: - case RouteUrls.RpcStacksSignature: return true; default: return false; @@ -20,9 +28,7 @@ export function showAccountInfo(pathname: RouteUrls) { export function showBalanceInfo(pathname: RouteUrls) { switch (pathname) { case RouteUrls.ProfileUpdateRequest: - case RouteUrls.PsbtRequest: case RouteUrls.RpcSendTransfer: - case RouteUrls.RpcStacksSignature: return true; case RouteUrls.TransactionRequest: default: @@ -35,7 +41,6 @@ export function getDisplayAddresssBalanceOf(pathname: RouteUrls) { switch (pathname) { case RouteUrls.TransactionRequest: case RouteUrls.ProfileUpdateRequest: - case RouteUrls.PsbtRequest: case RouteUrls.RpcSendTransfer: return 'all'; case RouteUrls.RpcStacksSignature: