-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathApp.js
More file actions
85 lines (78 loc) · 1.61 KB
/
Copy pathApp.js
File metadata and controls
85 lines (78 loc) · 1.61 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
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
/**
* Created by canfoo on 2017/12/10.
*/
import './src/common/globalContants'
import React, { Component } from 'react'
import {
View,
Text
} from 'react-native';
import {
TabNavigator,
StackNavigator
} from 'react-navigation'
import {
tabRoutes,
stackRoutes
} from './src/routes'
import { Provider } from 'mobx-react/native'
import stores from './src/store'
import Toast from 'react-native-easy-toast'
import Loading from './src/components/Loading'
import NavTitle from './src/components/NavTitle'
import Player from './src/components/Player'
const AppNavigator = TabNavigator(tabRoutes, {
tabBarOptions: {
activeTintColor: '#ff4d64',
labelStyle: {
fontSize: 13,
marginBottom: 5
},
style: {
backgroundColor: '#fff',
height: 56
}
}
})
const navigationOptions = ({ navigation }) => {
return {
headerTitle: (
<NavTitle navigation={navigation} />
),
headerMode: 'none'
}
}
const AppStackNavigator = StackNavigator({
Home: {
screen: AppNavigator,
navigationOptions
},
...stackRoutes
}, {
initialRouteName: 'Home'
})
class App extends Component {
constructor(props) {
super(props)
this.state = {
visible: true
}
}
componentDidMount () {
stores.toast.getToastRef(this.refs.toast)
}
render() {
return (
<View style={{flex: 1}}>
<Provider {...stores}>
<View style={{flex: 1}}>
<AppStackNavigator />
<Toast ref="toast" defaultCloseDelay={500} position={'top'} />
<Loading />
</View>
</Provider>
</View>
)
}
}
export default App