From 6c064ceead1de0ca89601edee14dff90cc60636b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 18 Jan 2026 21:16:02 +0000 Subject: [PATCH] fix: open LoginDialog instead of connection window for zap login Changes: - Import LoginDialog component into ZapWindow - Add showLogin state to control LoginDialog visibility - Update handleLogin to open LoginDialog instead of connection window - Remove unused useGrimoire import and addWindow destructuring - Add LoginDialog component to render alongside QR dialog User Experience: - "Log in to Zap" button now opens proper login dialog - Users can log in with extension, readonly, nsec, or NIP-46 - After login, user can proceed with zap flow - More intuitive than opening relay connection window All tests passing (939 passed) Build successful --- src/components/ZapWindow.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/ZapWindow.tsx b/src/components/ZapWindow.tsx index a4b7beb..4ec6ead 100644 --- a/src/components/ZapWindow.tsx +++ b/src/components/ZapWindow.tsx @@ -40,7 +40,6 @@ import { useWallet } from "@/hooks/useWallet"; import { getDisplayName } from "@/lib/nostr-utils"; import { KindRenderer } from "./nostr/kinds"; import type { EventPointer, AddressPointer } from "@/lib/open-parser"; -import { useGrimoire } from "@/core/state"; import accountManager from "@/services/accounts"; import { MentionEditor, @@ -48,6 +47,7 @@ import { } from "./editor/MentionEditor"; import { useEmojiSearch } from "@/hooks/useEmojiSearch"; import { useProfileSearch } from "@/hooks/useProfileSearch"; +import LoginDialog from "./nostr/LoginDialog"; export interface ZapWindowProps { /** Recipient pubkey (who receives the zap) */ @@ -99,7 +99,6 @@ export function ZapWindow({ const recipientProfile = useProfile(recipientPubkey); - const { addWindow } = useGrimoire(); const activeAccount = accountManager.active; const canSign = !!activeAccount?.signer; @@ -122,6 +121,7 @@ export function ZapWindow({ const [qrCodeUrl, setQrCodeUrl] = useState(""); const [invoice, setInvoice] = useState(""); const [showQrDialog, setShowQrDialog] = useState(false); + const [showLogin, setShowLogin] = useState(false); // Editor ref and search functions const editorRef = useRef(null); @@ -378,9 +378,9 @@ export function ZapWindow({ window.open(`lightning:${invoice}`, "_blank"); }; - // Open account selector for login + // Open login dialog const handleLogin = () => { - addWindow("conn", {}); + setShowLogin(true); }; return ( @@ -482,6 +482,9 @@ export function ZapWindow({ + {/* Login Dialog */} + + {/* QR Code Dialog */}