managarten/apps/traces/apps/mobile/app/_layout.tsx
Till JS bd1178edf8 feat(traces): integrate traces app into monorepo with NestJS backend and AI city guides
Restructure standalone traces app into monorepo pattern with mobile + backend + shared types.
Add NestJS backend with Drizzle ORM schema for locations, cities, places, POIs, and AI guides.
Add mobile sync layer, cities tab, and guide generation UI. Fix pre-existing type errors across
mobile codebase, matrix-mana-bot (sendDirectMessage), llm-playground, and all web auth stores
(signUp call signature).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 08:12:42 +01:00

76 lines
2.3 KiB
TypeScript

import '../global.css';
import { Stack } from 'expo-router';
import { useEffect } from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { ThemeWrapper } from '~/components/ThemeWrapper';
import { registerBackgroundTasks } from '~/utils/registerBackgroundTasks';
import { startAutoSync } from '~/utils/syncService';
import { ThemeProvider } from '~/utils/themeContext';
export const unstable_settings = {
// Ensure that reloading on `/modal` keeps a back button present.
initialRouteName: '(tabs)',
};
export default function RootLayout() {
// Registriere Hintergrundaufgaben beim App-Start
useEffect(() => {
registerBackgroundTasks().catch((error) =>
console.error('Fehler beim Initialisieren der Hintergrundaufgaben:', error)
);
// Start auto-sync (syncs to backend when logged in)
startAutoSync();
}, []);
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<ThemeProvider>
{({ isDarkMode }) => (
<ThemeWrapper>
<Stack
screenOptions={{
headerStyle: {
// Use transparent background to allow the ThemeWrapper color to show through
backgroundColor: isDarkMode ? '#1E1E1E' : 'transparent',
},
headerTintColor: isDarkMode ? '#FFFFFF' : '#000000',
headerTitleStyle: {
color: isDarkMode ? '#FFFFFF' : '#000000',
},
contentStyle: {
backgroundColor: isDarkMode ? '#121212' : '#FFFFFF',
},
}}
>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen
name="modal"
options={{
presentation: 'modal',
title: 'Über die App',
}}
/>
<Stack.Screen
name="settings"
options={{ title: 'Einstellungen', headerBackTitle: 'Zurück' }}
/>
<Stack.Screen
name="city-detail"
options={{ title: 'Stadt-Details', headerBackTitle: 'Zurück' }}
/>
<Stack.Screen
name="guide-detail"
options={{ title: 'Stadtführung', headerBackTitle: 'Zurück' }}
/>
</Stack>
</ThemeWrapper>
)}
</ThemeProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
);
}