mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
df490ee859
* fix: recover Android snapshots from system-only helper output * fix: tighten Android snapshot recovery follow-up * fix: preserve Android foreground container pruning
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { Stack } from 'expo-router';
|
|
import { ThemeProvider } from 'expo-router/react-navigation';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import { StyleSheet } from 'react-native';
|
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
|
|
import { ToastViewport } from '../src/components';
|
|
import { LabStateProvider, useLabState } from '../src/lab-state';
|
|
import { getNavigationTheme, useAppColors } from '../src/theme';
|
|
|
|
function RootLayoutContent() {
|
|
const colors = useAppColors();
|
|
const { toastMessage } = useLabState();
|
|
|
|
return (
|
|
<ThemeProvider value={getNavigationTheme(colors)}>
|
|
<StatusBar style={colors.mode === 'light' ? 'dark' : 'light'} />
|
|
<Stack
|
|
screenOptions={{
|
|
contentStyle: { backgroundColor: colors.surface },
|
|
headerShown: false,
|
|
}}
|
|
>
|
|
<Stack.Screen name="(tabs)" />
|
|
<Stack.Screen name="product/[productId]" />
|
|
</Stack>
|
|
{toastMessage ? <ToastViewport message={toastMessage} /> : null}
|
|
</ThemeProvider>
|
|
);
|
|
}
|
|
|
|
export default function RootLayout() {
|
|
return (
|
|
<GestureHandlerRootView style={styles.root}>
|
|
<SafeAreaProvider>
|
|
<LabStateProvider>
|
|
<RootLayoutContent />
|
|
</LabStateProvider>
|
|
</SafeAreaProvider>
|
|
</GestureHandlerRootView>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
root: {
|
|
flex: 1,
|
|
},
|
|
});
|