-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
61 lines (54 loc) · 2.22 KB
/
App.js
File metadata and controls
61 lines (54 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
import 'react-native-gesture-handler';
import React, { useEffect, useCallback, useState } from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import { useFonts } from 'expo-font';
import { SpaceGrotesk_700Bold, SpaceGrotesk_500Medium } from '@expo-google-fonts/space-grotesk';
import { IBMPlexMono_400Regular, IBMPlexMono_700Bold } from '@expo-google-fonts/ibm-plex-mono';
import InputScreen from './src/screens/InputScreen';
import ProcessingScreen from './src/screens/ProcessingScreen';
import PortfolioScreen from './src/screens/PortfolioScreen';
import EditorScreen from './src/screens/EditorScreen';
import ShareScreen from './src/screens/ShareScreen';
const Stack = createNativeStackNavigator();
// Keep the splash screen visible while we fetch resources
SplashScreen.preventAutoHideAsync();
export default function App() {
const [fontsLoaded, fontError] = useFonts({
SpaceGrotesk_700Bold,
SpaceGrotesk_500Medium,
IBMPlexMono_400Regular,
IBMPlexMono_700Bold,
});
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded || fontError) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded, fontError]);
if (!fontsLoaded && !fontError) {
return null;
}
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<NavigationContainer onReady={onLayoutRootView}>
<StatusBar style="auto" />
<Stack.Navigator
initialRouteName="Input"
screenOptions={{
headerShown: false,
contentStyle: { backgroundColor: '#F4F4F0' }
}}
>
<Stack.Screen name="Input" component={InputScreen} />
<Stack.Screen name="Processing" component={ProcessingScreen} />
<Stack.Screen name="Portfolio" component={PortfolioScreen} />
<Stack.Screen name="Editor" component={EditorScreen} />
<Stack.Screen name="Share" component={ShareScreen} />
</Stack.Navigator>
</NavigationContainer>
</GestureHandlerRootView>
);
}