From 0a2474d2f531c8630978bebd07e4195a9aef998e Mon Sep 17 00:00:00 2001 From: Chad Curtis Date: Mon, 14 Jul 2025 03:06:17 +0000 Subject: [PATCH] mobile enhancements --- src/components/WalletModal.tsx | 383 +++++++++++++++----------- src/components/ZapDialog.tsx | 481 +++++++++++++++++++++++---------- 2 files changed, 552 insertions(+), 312 deletions(-) diff --git a/src/components/WalletModal.tsx b/src/components/WalletModal.tsx index 05a3d02..e6725f8 100644 --- a/src/components/WalletModal.tsx +++ b/src/components/WalletModal.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Wallet, Plus, Trash2, Zap, Globe, WalletMinimal, CheckCircle } from 'lucide-react'; +import { Wallet, Plus, Trash2, Zap, Globe, WalletMinimal, CheckCircle, X } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -10,6 +10,15 @@ import { DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; +import { + Drawer, + DrawerContent, + DrawerDescription, + DrawerHeader, + DrawerTitle, + DrawerTrigger, + DrawerClose, +} from '@/components/ui/drawer'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; @@ -18,6 +27,7 @@ import { Separator } from '@/components/ui/separator'; import { useNWC } from '@/hooks/useNWCContext'; import { useWallet } from '@/hooks/useWallet'; import { useToast } from '@/hooks/useToast'; +import { useIsMobile } from '@/hooks/useIsMobile'; interface WalletModalProps { children?: React.ReactNode; @@ -30,6 +40,7 @@ export function WalletModal({ children, className }: WalletModalProps) { const [connectionUri, setConnectionUri] = useState(''); const [alias, setAlias] = useState(''); const [isConnecting, setIsConnecting] = useState(false); + const isMobile = useIsMobile(); const { connections, @@ -81,6 +92,213 @@ export function WalletModal({ children, className }: WalletModalProps) { }); }; + // Shared content component + const WalletContent = () => ( +
+ {/* Current Status */} +
+

Current Status

+ +
+ {/* WebLN */} +
+
+ +
+

WebLN

+

Browser extension

+
+
+
+ {hasWebLN && } + + {isDetecting ? "..." : hasWebLN ? "Ready" : "Not Found"} + +
+
+ + {/* NWC */} +
+
+ +
+

Nostr Wallet Connect

+

+ {connections.length > 0 + ? `${connections.length} wallet${connections.length !== 1 ? 's' : ''} connected` + : "Remote wallet connection" + } +

+
+
+
+ {hasNWC && } + + {hasNWC ? "Ready" : "None"} + +
+
+
+
+ + + + {/* NWC Management */} +
+
+

Nostr Wallet Connect

+ + + + + + + Connect NWC Wallet + + Enter your connection string from a compatible wallet. + + +
+
+ + setAlias(e.target.value)} + /> +
+
+ +