-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ios.js
65 lines (56 loc) · 1.62 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
Component,
NavigatorIOS,
StyleSheet,
AppRegistry
} = React;
//Instatiate the 'global' event emitter object
var Dispatcher = require('./app/utils/Dispatcher');
var dispatcher = new Dispatcher();
//requiring the hotel store passing the dispatcher object
var HotelsStore = require('./app/stores/hotels')(dispatcher);
//requiring the hotel service passing the dispatcher object
var HotelsService = require('./app/services/hotels')(dispatcher);
//requiring the hotel actions passing the service object
var HotelsActions = require('./app/actions/hotels')(HotelsService);
//requiring the initial component
var SearchScreen = require('./app/components/SearchScreen');
/**
* App's main component
*/
class ReactHotelFinder extends Component {
/**
* Renders the component
*
* @return {XML}
*/
render() {
return (
<NavigatorIOS
style={styles.mainContainer}
tintColor="#F9A11B"
initialRoute={{
title: 'React Hotel Finder',
component: SearchScreen,
passProps: {
store: HotelsStore,
actions: HotelsActions
}
}} />
);
}
}
//Default styles
var styles = StyleSheet.create({
mainContainer: {
flex: 1
}
});
//Registering the main component, if we don`t nothing works
AppRegistry.registerComponent('ReactHotelFinder', () => ReactHotelFinder);