-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
45 lines (40 loc) · 1.22 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
import 'react-native-gesture-handler';
import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import ContactList from './src/layouts/ContactList';
import ContactView from './src/layouts/ContactView';
import NewContact from './src/layouts/NewContact';
import { StyleSheet } from 'react-native';
export type RootStackParamList = {
ContactList: undefined;
NewContact: undefined;
ContactView: {
contactId?: string;
};
};
const styles = StyleSheet.create({
headerStyle: { backgroundColor: '#FFEACA' },
});
const App = () => {
const Stack = createStackNavigator<RootStackParamList>();
return (
<Stack.Navigator>
<Stack.Screen
name="ContactList"
component={ContactList}
options={() => ({ title: 'All Contacts', headerStyle: styles.headerStyle })}
/>
<Stack.Screen
name="ContactView"
component={ContactView}
options={() => ({ title: 'View/Edit Contact', headerStyle: styles.headerStyle })}
/>
<Stack.Screen
name="NewContact"
component={NewContact}
options={() => ({ title: 'Add New Contact', headerStyle: styles.headerStyle })}
/>
</Stack.Navigator>
);
};
export default App;