From 5ec7c83533da23eca3b1d157e08017ed4e8d12ad Mon Sep 17 00:00:00 2001 From: jwinterm Date: Tue, 27 Jan 2026 13:00:41 -0500 Subject: [PATCH] fix: tip popout and coutner --- src/app/page.tsx | 3 +- src/app/tips/page.tsx | 90 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 605d153..1e17b6d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -151,7 +151,8 @@ export default function Home() { />

smirk.ca$h

- {userCount !== null && userCount > 0 && ( + {/* Only show user count before logging in */} + {!user && userCount !== null && userCount > 0 && (

{userCount.toLocaleString()}{' '} {userCount === 1 ? 'smirker' : 'smirkers'} and counting diff --git a/src/app/tips/page.tsx b/src/app/tips/page.tsx index d1526ac..fcbc999 100644 --- a/src/app/tips/page.tsx +++ b/src/app/tips/page.tsx @@ -93,6 +93,7 @@ export default function TipsPage() { const [error, setError] = useState(null); const [hasExtension, setHasExtension] = useState(false); const [activeTab, setActiveTab] = useState<'sent' | 'received'>('sent'); + const [showInstructions, setShowInstructions] = useState<'claim' | 'clawback' | null>(null); const token = typeof window !== 'undefined' ? localStorage.getItem('smirk_token') : null; @@ -137,13 +138,8 @@ export default function TipsPage() { }, [token]); const handleOpenExtension = (action: 'claim' | 'clawback', tipId?: string) => { - // The extension doesn't have a direct deep-link API yet - // For now, just show instructions - if (action === 'claim') { - alert('Open Smirk extension → Inbox → Claim the pending tip'); - } else { - alert('Open Smirk extension → Settings → Pending Tips → Clawback'); - } + // Show in-page instructions instead of an alert + setShowInstructions(action); }; if (loading) { @@ -199,6 +195,86 @@ export default function TipsPage() { )} + {/* Instructions modal for opening extension */} + {showInstructions && ( +

+
+ + +
+
+ Smirk +
+

+ {showInstructions === 'claim' ? 'Claim Your Tip' : 'Clawback Tip'} +

+
+ + {showInstructions === 'claim' ? ( +
+

+ To claim this tip, open your Smirk extension: +

+
    +
  1. + 1 + Click the puzzle piece icon in your browser toolbar +
  2. +
  3. + 2 + Click Smirk Wallet +
  4. +
  5. + 3 + Go to Inbox +
  6. +
  7. + 4 + Click Claim on the pending tip +
  8. +
+
+ ) : ( +
+

+ To clawback an unclaimed tip: +

+
    +
  1. + 1 + Open Smirk Wallet extension +
  2. +
  3. + 2 + Go to Settings +
  4. +
  5. + 3 + Find Pending Tips +
  6. +
  7. + 4 + Click Clawback +
  8. +
+
+ )} + + +
+
+ )} + {!hasExtension && (