-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
50 lines (43 loc) · 1.12 KB
/
App.js
File metadata and controls
50 lines (43 loc) · 1.12 KB
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 { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import PeoplePage from './src/pages/PeoplePage';
import PeopleDetailPage from './src/pages/PeopleDetailPage';
import { capitalizeFirstLetter } from './src/util';
const AppNavigator = createStackNavigator({
'Main': {
screen: PeoplePage
},
'PeopleDetail': {
screen: PeopleDetailPage,
navigationOptions: ({ navigation }) => {
const peopleName = capitalizeFirstLetter(
navigation.state.params.people.name.first
);
return ({
title: peopleName,
headerTitleStyle: {
color: 'white',
fontSize: 30,
}
})
}
}
}, {
defaultNavigationOptions: {
title: 'Pessoas!',
headerTintColor: 'white',
headerStyle: {
backgroundColor: '#637fb8',
borderBottomWidth: 1,
borderBottomColor: '#555e70'
},
headerTitleStyle: {
color: 'white',
fontSize: 30,
flexGrow: 1,
textAlign: 'center',
}
}
});
const AppContainer = createAppContainer(AppNavigator);
export default AppContainer;