// components/sheets/NostrLoginSheet.tsx import React, { useState } from 'react'; import { View, StyleSheet, Alert, Platform, KeyboardAvoidingView, ScrollView } from 'react-native'; import { Info, ArrowRight } from 'lucide-react-native'; import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet'; import { Text } from '@/components/ui/text'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Separator } from '@/components/ui/separator'; import { useNDKAuth } from '@/lib/hooks/useNDK'; interface NostrLoginSheetProps { open: boolean; onClose: () => void; } export default function NostrLoginSheet({ open, onClose }: NostrLoginSheetProps) { const [privateKey, setPrivateKey] = useState(''); const { login, isLoading } = useNDKAuth(); const handleLogin = async () => { if (!privateKey.trim()) { Alert.alert('Error', 'Please enter your private key'); return; } try { const success = await login(privateKey); if (success) { setPrivateKey(''); onClose(); } else { Alert.alert('Login Error', 'Failed to login with the provided private key'); } } catch (error) { console.error('Login error:', error); Alert.alert('Error', 'An unexpected error occurred'); } }; return ( Login with Nostr {/* Removed the X close button here */} Enter your Nostr private key What is a Nostr Key? Nostr is a decentralized protocol where your private key (nsec) is your identity and password. Your private key is securely stored on your device and is never sent to any servers. ); } const styles = StyleSheet.create({ container: { flex: 1, }, scrollView: { flex: 1, }, content: { padding: 16, }, });