-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
50 lines (47 loc) · 1.44 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
43
44
45
46
47
48
49
50
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Home from './src/components/Home';
import {Alert, Button, View} from 'react-native';
import User from './src/components/User';
import ChatDetails from './src/components/ChatDetails';
import Ionicons from 'react-native-vector-icons/Ionicons';
const Stack = createNativeStackNavigator();
const App = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
options={{
headerStyle: {height: 120},
title: '',
headerLeft: props => (
<View>
<Button
onPress={() => Alert.alert('Simple Button pressed')}
title="Edit"
color="#0070FF"
/>
</View>
),
headerRight: props => (
<Ionicons size={30} color="#0070FF" name="create-outline" />
),
}}
name="Home"
component={Home}
/>
<Stack.Screen name="User" component={User} />
<Stack.Screen
name="ChatDetails"
component={ChatDetails}
options={({route}) => ({
title: route.params.data.name,
headerTitleAlign: 'left',
})}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;