caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

122 lines
2.9 KiB
TypeScript

import React, { useState } from 'react';
import {
View,
Text,
StyleSheet,
TouchableOpacity,
Alert,
} from 'react-native';
import { useRouter } from 'expo-router';
import { Colors } from '../../../constants/Colors';
import Header from '../../../components/navigation/Header';
import LoadingSpinner from '../../../components/common/LoadingSpinner';
import { useAuthStore } from '../../../store/authStore';
export default function LogoutScreen() {
const router = useRouter();
const { logout } = useAuthStore();
const [loading, setLoading] = useState(false);
const handleLogout = () => {
Alert.alert(
'Logout',
'Are you sure you want to logout?',
[
{ text: 'Cancel', style: 'cancel' },
{
text: 'Logout',
style: 'destructive',
onPress: async () => {
setLoading(true);
try {
await logout();
router.replace('/(auth)/login');
} catch (error) {
Alert.alert('Error', 'Failed to logout. Please try again.');
} finally {
setLoading(false);
}
},
},
]
);
};
return (
<View style={styles.container}>
<Header title="Logout" />
<View style={styles.content}>
<Text style={styles.message}>
Are you sure you want to logout? You'll need to sign in again to access your account.
</Text>
<TouchableOpacity
style={[styles.logoutButton, loading && styles.buttonDisabled]}
onPress={handleLogout}
disabled={loading}
>
{loading ? (
<LoadingSpinner />
) : (
<Text style={styles.logoutButtonText}>Logout</Text>
)}
</TouchableOpacity>
<TouchableOpacity
style={styles.cancelButton}
onPress={() => router.back()}
disabled={loading}
>
<Text style={styles.cancelButtonText}>Cancel</Text>
</TouchableOpacity>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
},
content: {
flex: 1,
justifyContent: 'center',
padding: 20,
},
message: {
color: Colors.text,
fontSize: 18,
textAlign: 'center',
marginBottom: 30,
lineHeight: 26,
},
logoutButton: {
backgroundColor: Colors.error || '#ff4444',
borderRadius: 8,
padding: 16,
alignItems: 'center',
marginBottom: 10,
},
buttonDisabled: {
opacity: 0.6,
},
logoutButtonText: {
color: Colors.text,
fontSize: 16,
fontWeight: '600',
},
cancelButton: {
backgroundColor: Colors.surface,
borderRadius: 8,
padding: 16,
alignItems: 'center',
borderWidth: 1,
borderColor: Colors.border,
},
cancelButtonText: {
color: Colors.text,
fontSize: 16,
fontWeight: '600',
},
});