refactor(mobile): chats header opens settings instead of inline logout
This commit is contained in:
@@ -4,7 +4,6 @@ import { Stack, useRouter } from 'expo-router';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Alert,
|
||||
FlatList,
|
||||
Pressable,
|
||||
RefreshControl,
|
||||
@@ -14,7 +13,6 @@ import {
|
||||
} from 'react-native';
|
||||
|
||||
import { ConversationRow } from '../../components/ConversationRow';
|
||||
import { useAuth } from '../../lib/authContext';
|
||||
import { supabase } from '../../lib/supabase';
|
||||
import { colors } from '../../theme/colors';
|
||||
|
||||
@@ -23,7 +21,6 @@ import { colors } from '../../theme/colors';
|
||||
// is a Phase 1.5 follow-up. Tap → conversation detail.
|
||||
export default function Chats() {
|
||||
const router = useRouter();
|
||||
const { signOut } = useAuth();
|
||||
const [list, setList] = useState<ConversationSummary[] | null>(null);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -48,19 +45,6 @@ export default function Chats() {
|
||||
setRefreshing(false);
|
||||
}, [load]);
|
||||
|
||||
const confirmLogout = () => {
|
||||
Alert.alert('Abmelden', 'Diese Sitzung beenden?', [
|
||||
{ text: 'Abbrechen', style: 'cancel' },
|
||||
{
|
||||
text: 'Abmelden',
|
||||
style: 'destructive',
|
||||
onPress: () => {
|
||||
void signOut();
|
||||
},
|
||||
},
|
||||
]);
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Stack.Screen
|
||||
@@ -69,8 +53,8 @@ export default function Chats() {
|
||||
headerStyle: { backgroundColor: colors.bg },
|
||||
headerTitleStyle: { color: colors.text },
|
||||
headerRight: () => (
|
||||
<Pressable onPress={confirmLogout} hitSlop={10}>
|
||||
<Text style={styles.logoutLink}>Abmelden</Text>
|
||||
<Pressable onPress={() => router.push('/(app)/settings')} hitSlop={10}>
|
||||
<Text style={styles.logoutLink}>Einstellungen</Text>
|
||||
</Pressable>
|
||||
),
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user