-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_layout.tsx
More file actions
73 lines (66 loc) · 2.22 KB
/
_layout.tsx
File metadata and controls
73 lines (66 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import {
Inter_400Regular,
Inter_500Medium,
Inter_600SemiBold,
Inter_700Bold,
useFonts,
} from '@expo-google-fonts/inter';
import { DarkTheme, DefaultTheme, type Theme, ThemeProvider } from '@react-navigation/native';
import { Stack } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import 'react-native-reanimated';
import { installDebugLogger } from '@/components/debug-log';
import { useColorScheme } from '@/hooks/use-color-scheme';
installDebugLogger();
SplashScreen.preventAutoHideAsync().catch(() => {});
function withInterFonts(theme: Theme): Theme {
return {
...theme,
fonts: {
regular: { fontFamily: 'Inter_400Regular', fontWeight: '400' },
medium: { fontFamily: 'Inter_500Medium', fontWeight: '500' },
bold: { fontFamily: 'Inter_700Bold', fontWeight: '700' },
heavy: { fontFamily: 'Inter_700Bold', fontWeight: '700' },
},
};
}
export default function RootLayout() {
const colorScheme = useColorScheme();
const [fontsLoaded] = useFonts({
Inter_400Regular,
Inter_500Medium,
Inter_600SemiBold,
Inter_700Bold,
});
React.useEffect(() => {
if (fontsLoaded) {
SplashScreen.hideAsync().catch(() => {});
}
}, [fontsLoaded]);
if (!fontsLoaded) return null;
return (
<ThemeProvider value={withInterFonts(colorScheme === 'dark' ? DarkTheme : DefaultTheme)}>
<Stack
screenOptions={{
headerStyle: { backgroundColor: '#000000' },
headerTintColor: '#ffffff',
headerTitleStyle: {
color: '#ffffff',
fontFamily: 'Inter_600SemiBold',
},
headerShadowVisible: false,
contentStyle: { backgroundColor: '#000000' },
}}
>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="studio" options={{ title: 'Studio Scene' }} />
<Stack.Screen name="vr" options={{ title: 'VR Scene' }} />
<Stack.Screen name="settings" options={{ title: 'Settings' }} />
<Stack.Screen name="modal" options={{ presentation: 'modal', title: 'Modal' }} />
</Stack>
<StatusBar style="light" />
</ThemeProvider>
);
}