-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ios.js
More file actions
93 lines (81 loc) · 2.22 KB
/
index.ios.js
File metadata and controls
93 lines (81 loc) · 2.22 KB
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
"use strict";
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Navigator,
TextInput,
TouchableHighlight,
ActivityIndicatorIOS,
View
} from 'react-native';
import fetchWeather from "./App/Api/weatherapi"
import TrailList from "./App/Components/TrailList"
import weatherIcon from "./App/Utils/icons"
import Trail from './App/Components/Trail'
import Weather from './App/Components/Weather'
import Local from './App/Components/Local'
import Map from './App/Components/Map'
import Landmark from './App/Components/Landmark'
import LandmarkList from './App/Components/LandmarkList'
var Main = require('./App/Components/Main');
const SCREEN_WIDTH = require('Dimensions').get('window').width;
/**
* Overwrite the default navigator scene config.
* to use a wider area for back swiping.
*/
const FloatFromRight = {
...Navigator.SceneConfigs.FloatFromRight,
gestures: {
pop: {
...Navigator.SceneConfigs.FloatFromRight.gestures.pop,
edgeHitWidth: SCREEN_WIDTH / 2,
},
},
};
class CycleTheBay extends React.Component {
renderScene(route,navigator) {
if (route.name == 'Main') {
return <Main navigator={navigator} />
}
if (route.name == 'Trails') {
return <TrailList navigator={navigator} />
}
if (route.name == 'Trail') {
return <Trail navigator={navigator} {...route.passProps} />
}
if (route.name == 'Weather') {
return <Weather navigator={navigator} />
}
if (route.name == 'Local') {
return <Local navigator={navigator} />
}
if (route.name == 'Map') {
return <Map navigator={navigator} />
}
if (route.name == 'Landmarks') {
return <LandmarkList navigator={navigator} {...route.passProps} />
}
if (route.name == 'Landmark') {
return <Landmark navigator={navigator} {...route.passProps} />
}
}
render() {
return (
<Navigator
style={{ flex: 1 }}
initialRoute={{ name: 'Main' }}
renderScene={ this.renderScene }
configureScene={ () => FloatFromRight }
/>
);
}
};
var styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffff'
}
});
AppRegistry.registerComponent('CycleTheBay', () => CycleTheBay);