diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx
index 64e23a5..ea0b39e 100644
--- a/src/components/Layout.tsx
+++ b/src/components/Layout.tsx
@@ -1,4 +1,4 @@
-import { useState, useRef } from 'react';
+import { useState, useRef, lazy, Suspense } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { nip19 } from 'nostr-tools';
import { cn } from '@/lib/utils';
@@ -20,7 +20,6 @@ import { SasquatchGuide } from '@/components/SasquatchGuide';
import { useSasquatchGuide } from '@/hooks/useSasquatchGuide';
import { BackupReminder } from '@/components/BackupReminder';
import { LanguageToggle } from '@/components/LanguageToggle';
-import { useCashu } from '@/hooks/wallet/useCashu';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useTranslation } from '@/contexts/LanguageContext';
import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts';
@@ -63,6 +62,18 @@ import { genUserName } from '@/lib/genUserName';
import { NewsletterOverlay } from '@/components/NewsletterOverlay';
import { NotificationBell } from '@/components/NotificationBell';
+// Cashu balance widget is lazy — see components/wallet/CashuBalance.tsx for why
+// (keeps the Cashu stack out of the initial bundle).
+const LazyCashuBalanceText = lazy(() =>
+ import('@/components/wallet/CashuBalance').then((m) => ({ default: m.CashuBalanceText })),
+);
+const LazyCashuBalanceBadge = lazy(() =>
+ import('@/components/wallet/CashuBalance').then((m) => ({ default: m.CashuBalanceBadge })),
+);
+const LazyCashuMenuBalance = lazy(() =>
+ import('@/components/wallet/CashuBalance').then((m) => ({ default: m.CashuMenuBalance })),
+);
+
interface LayoutProps {
children: React.ReactNode;
/** If true, removes the bottom padding that prevents bottom nav overlap.
@@ -79,17 +90,6 @@ const navItemKeys = [
{ href: '/crews', labelKey: 'nav.crews', icon: Users },
];
-// Format sats for display (e.g., 1234 -> "1.2k", 12345 -> "12k")
-function formatSatsCompact(sats: number): string {
- if (sats >= 1000000) {
- return `${(sats / 1000000).toFixed(1)}M`;
- }
- if (sats >= 1000) {
- return `${(sats / 1000).toFixed(sats >= 10000 ? 0 : 1)}k`;
- }
- return sats.toString();
-}
-
function NavLink({
href,
label,
@@ -288,7 +288,6 @@ function MobileHeaderUserMenu({
function MobileNav({
isActive,
- cashuBalance,
isLoggedIn,
userPubkey,
userAvatar,
@@ -299,7 +298,6 @@ function MobileNav({
middleTabs,
}: {
isActive: (path: string) => boolean;
- cashuBalance: number;
isLoggedIn: boolean;
userPubkey?: string;
userAvatar?: string;
@@ -370,11 +368,9 @@ function MobileNav({
{isWallet ? (
<>
Ecash
- {hasCashu && ( -- {cashuBalance.toLocaleString()} -
-sats
-{totalBalance.toLocaleString()}
+sats
+