bw-expo-app/app/_layout.tsx

40 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
import { Stack } from 'expo-router';
import 'react-native-reanimated';
import { AuthProvider } from '@/components/auth/auth-provider';
import { useColorScheme } from '@/hooks/use-color-scheme';
import { Platform } from 'react-native';
import { useEffect } from 'react';
// Clarity 只支持 android 和 iOSweb 平台跳过初始化
if (Platform.OS === 'android' || Platform.OS === 'ios') {
const Clarity = require('@microsoft/react-native-clarity').default;
Clarity.initialize('tyq6bmjzo1', {
logLevel: Clarity.LogLevel.Verbose,
});
}
export const unstable_settings = {
anchor: '(tabs)',
};
export default function RootLayout() {
const colorScheme = useColorScheme();
useEffect(()=>{
console.log(`app start`)
}, [])
return (
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
<AuthProvider>
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="modal" options={{ presentation: 'modal', title: 'Modal' }} />
<Stack.Screen name="result" options={{ headerShown: false }} />
<Stack.Screen name="exchange" options={{ headerShown: false }} />
<Stack.Screen name="recharge" options={{ headerShown: false }} />
</Stack>
</AuthProvider>
</ThemeProvider>
);
}