-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
42 lines (30 loc) · 1.05 KB
/
App.js
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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Provider as PaperProvider, Switch } from 'react-native-paper';
import Home from "./src/views/Home";
import AppBar from './src/components/UI/AppBar';
import ChatHeader from "./src/components/UI/ChatHeader";
import Chat from "./src/views/Chats/Chat"
const App = () => {
const Stack = createNativeStackNavigator();
return (
<PaperProvider>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
header: (props) => <AppBar />,
}}
>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Chat" component={Chat}
options={{
header: props => <ChatHeader contactName={props.route.params.chatInfo.name} navigation={props.navigation}/>,
}}
/>
</Stack.Navigator>
</NavigationContainer>
</PaperProvider>
);
}
export default App;