/
index.ios.js
153 lines (132 loc) · 3.43 KB
/
index.ios.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
TouchableOpacity,
Image,
} from 'react-native';
//Scenes
import LoginView from './components/LoginView.js';
import SecureView from './components/SecureView.js'
import Dashboard from './components/Dashboard.js';
import ReservationList from './components/ReservationList.js';
import GuestList from './components/GuestList.js';
import {Scene, Router,Actions} from 'react-native-router-flux';
import Drawer from 'react-native-drawer'
import SideDrawer from './components/SideDrawer.js';
import SideDrawerContent from './components/SideDrawerContent.js'
class navBar extends React.Component{
render(){
return(
<View style={styles.navBar}>
<TouchableOpacity
style={styles.leftButtonContainer}
onPress={Actions.pop}
>
<Image source={require('./components/images/ic_menu_white_24dp.png')} style={{height: 24, width: 24}} />
</TouchableOpacity>
<View style={styles.titleContainer} >
<Text style={styles.navTitle}>Dashboard</Text>
</View>
<TouchableOpacity
style={styles.leftButtonContainer}
onPress={Actions.pop}
>
<Image style={{height: 24, width: 24}} />
</TouchableOpacity>
</View>
)
}
}
class hotel extends React.Component {
renderMenuButton () {
return (
<TouchableOpacity
style={styles.leftButtonContainer}
onPress={Actions.pop}
>
<Image
source={require('./components/images/ic_arrow_back_white_24dp.png')}
style={{height: 24, width: 24}}
/>
</TouchableOpacity>
)
}
renderTitle(){
return( <View style={styles.titleContainer} >
<Text style={styles.navTitle}>Dashboard</Text>
</View>
)
}
render() {
return(
<Router>
<Scene key="root">
<Scene key="pageOne" component={LoginView} initial={true} hideNavBar={true} />
<Scene key="pageTwo" component={SecureView} title="PageTwo" hideNavBar={true} />
<Scene key="dashboard" component={Dashboard} hideNavBar={false} />
<Scene key="reservationlist" component={ReservationList} title="ReservationList" hideNavBar={true} />
<Scene key="guestlist" component={GuestList} title="GuestList" hideNavBar={true} />
</Scene>
</Router>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
navBar: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: '#1d1820',
paddingTop: 0,
top: 0,
height: 54,
right: 0,
left: 0,
borderBottomWidth: 0.5,
borderBottomColor: '#828287',
position: 'absolute',
},
navTitle: {
color: 'white',
},
routerScene: {
paddingTop: Navigator.NavigationBar.Styles.General.NavBarHeight, // some navbar padding to avoid content overlap
},
leftButtonContainer: {
paddingLeft: 15,
paddingRight: 20,
flex: 1,
flexDirection: 'row',
alignItems: 'center',
},
titleContainer: {
paddingLeft: 15,
paddingRight: 20,
flex: 8,
flexDirection: 'row',
alignItems: 'center',
justifyContent:'center'
},
});
AppRegistry.registerComponent('hotel', () => hotel);