-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
87 lines (80 loc) · 2.33 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from 'react';
import { Text, Button, Icon, Footer, FooterTab, StyleProvider } from 'native-base';
import { TabNavigator, StackNavigator } from "react-navigation";
import HomeScreen from './src/screens/HomeScreen';
import TestScreen from './src/screens/TestScreen';
import IntroScreen from './src/screens/IntroScreen';
import DetailScreen from './src/screens/DetailScreen';
import getTheme from './native-base-theme/components';
import platform from './native-base-theme/variables/platform';
import AppStore from './src/stores/AppStore.js';
import {observer} from 'mobx-react';
// const HomeStack = StackNavigator({
// Home: {
// screen: HomeScreen,
// navigationOptions: {
// header: null
// },
// },
// Detail: {
// screen: DetailScreen,
// },
// });
const Nav = (MainScreenNavigator = TabNavigator(
{
Home: { screen: HomeScreen },
Test: { screen: TestScreen },
Intro: {
screen: IntroScreen,
navigationOptions: { tabBarVisible: false }
},
Detail: { screen: DetailScreen }
},
{
tabBarPosition: "bottom",
tabBarComponent: props => {
return (
<Footer>
<FooterTab>
<Button
vertical
active={props.navigationState.index === 0}
onPress={() => props.navigation.navigate("Home")}>
<Icon name="home" />
<Text>Home</Text>
</Button>
<Button
vertical
active={props.navigationState.index === 1}
onPress={() => props.navigation.navigate("Test")}>
<Icon name="book" />
<Text>Test</Text>
</Button>
<Button
vertical
active={props.navigationState.index === 2}
onPress={() => props.navigation.navigate("Intro")} >
<Icon name="bowtie" />
<Text>No tab</Text>
</Button>
<Button
vertical
onPress={() => AppStore.modalVisible = true } >
<Icon name="square" />
<Text>Modal</Text>
</Button>
</FooterTab>
</Footer>
);
}
}
));
export default class App extends React.Component {
render() {
return (
<StyleProvider style={getTheme(platform)}>
<Nav />
</StyleProvider>
);
}
}