-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
40 lines (35 loc) · 1.21 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
import "react-native-gesture-handler";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { SafeAreaView } from "react-native-safe-area-context";
import HomeScreen from "./src/screens/Home";
import Dashboard from "./src/screens/Dashboard";
type RootStackParamList = {
Home: undefined;
Dashboard: { code: string };
};
const Stack = createStackNavigator<RootStackParamList>();
const AppNavigator = () => {
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerMode: "screen",
headerTintColor: "white",
headerStyle: { backgroundColor: "black" },
}}>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Dashboard" options={{ title: "Dashboard" }}>
{(props: any) => <Dashboard {...props} />}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
};
export default function App() {
return (
<SafeAreaView style={{ flex: 1 }}>
<AppNavigator />
</SafeAreaView>
);
}