-
Notifications
You must be signed in to change notification settings - Fork 82
/
index.ios.js
executable file
·155 lines (142 loc) · 5.21 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
154
155
'use strict';
var Controllers = require('react-native-controllers');
var React = Controllers.hijackReact();
var {
ControllerRegistry,
TabBarControllerIOS,
NavigationControllerIOS,
ViewControllerIOS,
DrawerControllerIOS
} = React;
// require all top level react components you refer to in the layout
require('./SideMenu');
require('./MovieListScreen');
require('./MoreDrawerOptionsScreen');
require('./SearchScreen');
require('./FavoritesScreen');
require('./ExtraScreen');
require('./ModalScreen');
require('./StyledTabScreen');
var MoviesApp = Controllers.createClass({
render: function() {
return (
<DrawerControllerIOS id="drawer"
componentLeft="SideMenu"
componentRight="SideMenu"
type="MMDrawer"
animationType="slide"
style={{contentOverlayColor:'#162D3D55'}}>
<TabBarControllerIOS id="main">
<TabBarControllerIOS.Item title="Movies" icon={require('./img/home.png')} selectedIcon={require('./img/home_selected.png')}>
<NavigationControllerIOS
title="Red Title"
component="MovieListScreen"
id="movies_nav"
style={{navBarTextColor: '#ff0000', drawUnderNavBar: false, drawUnderTabBar: true}}
/>
</TabBarControllerIOS.Item>
<TabBarControllerIOS.Item title="Favorites" icon={require('./img/star.png')} selectedIcon={require('./img/star_selected.png')}>
<NavigationControllerIOS
title="Favorites"
component="FavoritesScreen"
id="favorites_nav"
passProps={{hidePop: true}}
style={{drawUnderNavBar: true, navBarTranslucent: true}}
/>
</TabBarControllerIOS.Item>
<TabBarControllerIOS.Item title="Search" icon={require('./img/discover.png')} selectedIcon={require('./img/discover_selected.png')}>
<ViewControllerIOS
component="SearchScreen"
style={{ drawUnderTabBar: true }}
/>
</TabBarControllerIOS.Item>
</TabBarControllerIOS>
</DrawerControllerIOS>
);
}
});
var ModalScreenTester = Controllers.createClass({
render: function() {
return (
<NavigationControllerIOS
title="Modal"
component="ModalScreen"
id="modal_nav"
leftButtons={[{
title: "Close",
onPress: function() {
Controllers.Modal.dismissController();
}
}]}
/>
);
},
});
var TabStyleTester = Controllers.createClass({
render: function() {
return (
<TabBarControllerIOS
id="styled_tabs"
style={{tabBarButtonColor: '#ffff00', tabBarSelectedButtonColor: '#ff9900', tabBarBackgroundColor: '#551A8B'}}
>
<TabBarControllerIOS.Item title="Movies" icon={require('./img/home.png')} selectedIcon={require('./img/home_selected.png')}>
<NavigationControllerIOS
title="Styled Tabs"
component="StyledTabScreen"
id="styled_tab_nav"
leftButtons={[{
title: "Close",
onPress: function() {
Controllers.Modal.dismissController();
}
}]}
/>
</TabBarControllerIOS.Item>
<TabBarControllerIOS.Item title="Favorites" icon={require('./img/star.png')} selectedIcon={require('./img/star_selected.png')}>
<NavigationControllerIOS
title="Styled Tabs"
component="StyledTabScreen"
id="styled_tab_nav2"
leftButtons={[{
title: "Close",
onPress: function() {
Controllers.Modal.dismissController();
}
}]}
/>
</TabBarControllerIOS.Item>
</TabBarControllerIOS>
);
}
})
var MoreDrawerScreenTester = Controllers.createClass({
render: function() {
return (
<DrawerControllerIOS id="drawer_options"
componentLeft="SideMenu"
componentRight="SideMenu"
type="TheSideBar"
animationType="airbnb"
style={{leftDrawerWidth: 80,
rightDrawerWidth: 50,
contentOverlayColor: '#162D3D55',
}}>
<NavigationControllerIOS
title="The Side Bar"
component="MoreDrawerOptionsScreen"
id="more_nav"
style={{navBarTextColor: '#00ff00', drawUnderNavBar: false, drawUnderTabBar: true}}
/>
</DrawerControllerIOS>
);
},
});
ControllerRegistry.registerController('MoviesApp', () => MoviesApp);
ControllerRegistry.registerController('ModalScreenTester', () => ModalScreenTester);
ControllerRegistry.registerController('TabStyleTester', () => TabStyleTester);
ControllerRegistry.registerController('MoreDrawerScreenTester', () => MoreDrawerScreenTester);
// this line makes the app actually start and initialize
ControllerRegistry.setRootController('MoviesApp');
module.exports = MoviesApp;
module.exports = ModalScreenTester;
module.exports = MoreDrawerScreenTester;