-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
71 lines (67 loc) · 2.11 KB
/
App.tsx
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
import { NavigationContainer } from "@react-navigation/native";
import {
createNativeStackNavigator,
NativeStackNavigationOptions,
} from "@react-navigation/native-stack";
import React from "react";
import { StatusBar } from "react-native";
import { NavRouteList } from "./src/navigation/NavRouteList";
import GameOverScreen from "./src/screens/GameOverScreen";
import GameScreen from "./src/screens/GameScreen";
import HomeScreen from "./src/screens/HomeScreen";
import ScoresScreen from "./src/screens/ScoresScreen";
import SettingsScreen from "./src/screens/SettingsScreen";
import Colors from "./styles/Colors";
import Theme from "./styles/Theme";
const Stack = createNativeStackNavigator<NavRouteList>();
const App = () => {
const stackNavigatorOptions: NativeStackNavigationOptions = {
headerLargeTitle: true,
headerLargeTitleStyle: { color: Colors.dark.primary },
};
return (
<NavigationContainer
theme={Theme}
onReady={() => console.log("Navigation container ready!")}
>
<StatusBar
barStyle="light-content"
backgroundColor={Colors.dark.background}
animated={true}
/>
<Stack.Navigator
initialRouteName={"Home"}
screenOptions={stackNavigatorOptions}
>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Game"
component={GameScreen}
options={{
headerShown: false,
animation: "fade",
gestureEnabled: false,
}}
/>
<Stack.Screen
name="GameOver"
component={GameOverScreen}
options={{
headerShown: false,
animation: "fade",
gestureEnabled: false,
}}
/>
<Stack.Group screenOptions={{ statusBarColor: Colors.dark.surface }}>
<Stack.Screen name="Scores" component={ScoresScreen} />
<Stack.Screen name="Settings" component={SettingsScreen} />
</Stack.Group>
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;