Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
122 lines
2.9 KiB
TypeScript
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',
|
|
},
|
|
});
|
|
|