-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
37 lines (32 loc) · 982 Bytes
/
App.js
File metadata and controls
37 lines (32 loc) · 982 Bytes
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
import * as React from 'react';
import Index from './screens/Index';
import { BottomNavigation } from 'react-native-paper';
const PlanetRoute = () => <Index title="Planets"/>;
const InboxRoute = () => <Index title="Inbox"/>;
const ProfileRoute = () => <Index title="Profile"/>;
export default class App extends React.Component {
state = {
index: 0,
routes: [
{ key: 'planets', title: 'Planets', icon: 'star' },
{ key: 'inbox', title: 'Inbox', icon: 'inbox' },
{ key: 'porfile', title: 'Porfile', icon: 'face' },
],
};
_handleIndexChange = index => this.setState({ index });
_renderScene = BottomNavigation.SceneMap({
planets: PlanetRoute,
inbox: InboxRoute,
porfile: ProfileRoute,
});
render() {
return (
<BottomNavigation
barStyle={{backgroundColor:'#eee'}}
navigationState={this.state}
onIndexChange={this._handleIndexChange}
renderScene={this._renderScene}
/>
);
}
}