// app/(tabs)/profile/settings.tsx
import React, { useState } from 'react';
import { View, ScrollView, Switch, TouchableOpacity } from 'react-native';
import { Text } from '@/components/ui/text';
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { useNDKCurrentUser, useNDKAuth } from '@/lib/hooks/useNDK';
import { ActivityIndicator } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import NostrLoginSheet from '@/components/sheets/NostrLoginSheet';
import TermsOfServiceModal from '@/components/TermsOfServiceModal';
import { useTheme } from '@react-navigation/native';
import type { CustomTheme } from '@/lib/theme';
import { useColorScheme } from '@/lib/theme/useColorScheme';
import { ChevronRight } from 'lucide-react-native';
export default function SettingsScreen() {
const insets = useSafeAreaInsets();
const theme = useTheme() as CustomTheme;
const { colorScheme, toggleColorScheme } = useColorScheme();
const { currentUser, isAuthenticated } = useNDKCurrentUser();
const { logout } = useNDKAuth();
const [isLoginSheetOpen, setIsLoginSheetOpen] = useState(false);
const [isTermsModalVisible, setIsTermsModalVisible] = useState(false);
// Show different UI when not authenticated
if (!isAuthenticated) {
return (
Login with your Nostr private key to access settings.
{/* NostrLoginSheet */}
setIsLoginSheetOpen(false)}
/>
);
}
return (
{/* Account Settings */}
Account Settings
Nostr Publishing
Public
Local Storage
Enabled
Connected Relays
5
{/* App Settings */}
App Settings
Dark Mode
Notifications
Units
Metric (kg)
{/* About */}
About
Version
1.0.0
setIsTermsModalVisible(true)}
>
Terms of Service
View
{/* Terms of Service Modal */}
setIsTermsModalVisible(false)}
/>
{/* Logout Button */}
);
}