-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
104 lines (96 loc) · 2.44 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
StatusBar,
Platform,
Text,
View
} from 'react-native';
import {Router, Scene} from 'react-native-mobx';
import {observer} from 'mobx-react/native';
import Drawer from './components/SideDrawer';
import PageOne from './components/PageOne';
// import AppBar from './components/AppBar'
/*import NavBar from 'react-native-router-flux/src/NavBar';*/
// view and model for Counter scene
//import Counter from './components/Counter';
import TopTabBar from './components/TopTabBar';
import store from './model/counter';
@observer
class App extends Component{
constructor(){
super();
}
closeControlPanel = () => {
this._drawer.close()
};
openControlPanel = () => {
this._drawer.open()
};
renderMenuButton = () => {
return (
<Button style={{fontSize: 30,color:'#fff'}} onPress={store.increase}>Mybutton</Button>
);
};
render(){
return(
<View style={styles.container}>
<StatusBar barStyle="light-content" />
<View style={styles.statusbar} />
{/*<View style={styles.appbar}></View>*/}
<Router store={store} titleStyle={{color:'#fff'}} hideNavBar={true} navigationBarStyle={{ backgroundColor: '#2196f3' }}>
{/*<Scene key="drawer" component={Drawer} open={false} initial={true}>*/}
{/*<Scene key="main" navBar={NavBar} >*/}
<Scene key="pageOne" component={TopTabBar} title="Home" />
{/*</Scene>*/}
{/*</Scene>*/}
</Router>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f5f5f5',
},
example: {
elevation: 4,
},
statusbar: {
backgroundColor: Platform.OS === 'ios' ? '#2196f3' : '#1b7dcb',
height: Platform.OS === 'ios' ? 20 : 24,
},
appbar: {
flexDirection: 'row',
alignItems: 'center',
height: Platform.OS === 'ios' ? 44 : 56,
backgroundColor: '#2196f3',
elevation: 4,
},
title: {
flex: 1,
margin: 16,
textAlign: Platform.OS === 'ios' ? 'center' : 'left',
fontSize: Platform.OS === 'ios' ? 20 : 18,
color: '#fff',
},
button: {
flexDirection: 'row',
alignItems: 'center',
width: 56,
padding: Platform.OS === 'ios' ? 12 : 16,
},
touchable: {
padding: 16,
backgroundColor: '#fff',
borderBottomWidth: 1,
borderBottomColor: 'rgba(0, 0, 0, .06)',
},
item: {
fontSize: 14,
color: '#333',
},
});
export default App;