Skip to content

Commit

Permalink
chore: don't show account info and balance in psbt headers and block …
Browse files Browse the repository at this point in the history
…logo click
  • Loading branch information
pete-watters committed Mar 21, 2024
1 parent 91403ce commit 927ee6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/app/features/container/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { TotalBalance } from './total-balance';
import {
getDisplayAddresssBalanceOf,
isKnownPopupRoute,
isRpcRoute,
showAccountInfo,
showBalanceInfo,
} from './utils/get-popup-header';
Expand Down Expand Up @@ -103,6 +104,7 @@ export function Container() {
const hideSettings =
isKnownPopupRoute(pathname) || isSummaryPage(pathname) || variant === 'onboarding';

const isLogoClickable = variant !== 'home' && !isRpcRoute(pathname);
return (
<>
<SwitchAccountDialog
Expand Down Expand Up @@ -149,7 +151,7 @@ export function Container() {
>
<Logo
data-testid={OnboardingSelectors.LogoRouteToHome}
onClick={variant !== 'home' ? () => navigate(RouteUrls.Home) : undefined}
onClick={isLogoClickable ? () => navigate(RouteUrls.Home) : undefined}
/>
</Box>
)
Expand Down
17 changes: 11 additions & 6 deletions src/app/features/container/utils/get-popup-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 927ee6f

Please sign in to comment.