-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
47 lines (43 loc) · 1.19 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
TextInput,
TouchableHighlight,
View,
Image,
ListView,
Navigator
} from 'react-native';
import styles from './constants/styles.js';
import SearchScene from './components/SearchScene';
import ResultsScene from './components/ResultsScene';
import RecipeScene from './components/RecipeScene';
class FoodBar extends Component {
renderScene(route, navigator) {
if (route.title == 'Search') {
return <SearchScene navigator={navigator} {...route.passProps} />
}
if (route.title == 'Results') {
return <ResultsScene navigator={navigator} {...route.passProps} />
}
if (route.title == 'Recipe Card') {
return <RecipeScene navigator={navigator} {...route.passProps} />
}
}
render() {
return (
<Image style={styles.container} source={require('./assets/app-bg.jpg')}>
<Navigator style={{ flex:1 }} initialRoute={{ title: 'Search', index: 0 }} renderScene={ this.renderScene } />
</Image>
);
}
}
AppRegistry.registerComponent('FoodBar', () => FoodBar);