-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.android.js
More file actions
121 lines (112 loc) · 3 KB
/
index.android.js
File metadata and controls
121 lines (112 loc) · 3 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
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Navigator,
View,
Text,
TouchableHighlight,
} from 'react-native';
import Main from './App/Components/Main';
import Notes from './App/Components/Notes';
import Video from './App/Components/Video';
import Cheatsheet from './App/Components/Cheatsheet';
class WorkoutTracker extends Component {
constructor(props) {
super(props);
}
render() {
const routes = [
{title: "Julian Gym Tracker", index: 0},
{title: "Notes", index: 1},
{title: "Cheatsheet", index: 2},
{title: "Exercise Video", index: 3},
]
return (
<Navigator
style={styles.container}
initialRoute={routes[0]}
initialRouteStack={routes}
renderScene={(route, navigator) =>
{
if (route.index == 0) {
return <Main routes={routes} navigator={navigator} />
} else if (route.index == 1) {
return <Notes routes={routes} navigator={navigator} />
} else if (route.index == 2) {
return <Cheatsheet routes={routes} navigator={navigator} />
} else if (route.index == 3) {
return <Video routes={routes} {...route.passProps} />
}
}
}
navigationBar={
<Navigator.NavigationBar
style={styles.nav}
navigationStyles={Navigator.NavigationBar.StylesIOS}
routeMapper={{
LeftButton: (route, navigator, index, navState) => {
if (route.index !== 0) {
return (
<TouchableHighlight
onPress={() => navigator.pop()}
style={styles.backButton} >
<Text style={styles.backText}>Back</Text>
</TouchableHighlight>
)
} else {
return null;
}
},
RightButton: (route, navigator, index, navState) => {
return(
null )
},
Title: (route, navigator, index, navState) => {
return (
<View style={styles.title}>
<Text style={styles.titleText}>{route.title}</Text>
</View>)
}
}}
/>
}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
// backgroundColor: '#F5FCFF'
},
nav: {
flex: 1,
height: 65,
backgroundColor: '#F5FCFF',
justifyContent: 'center',
alignItems: 'center',
},
title: {
flex: 1,
// paddingTop: 13,
alignItems: 'center',
paddingLeft: 20,
},
titleText: {
fontSize: 18,
},
backButton: {
// paddingLeft: 10,
// paddingTop: 20,
},
backText: {
}
});
AppRegistry.registerComponent('WorkoutTracker', () => WorkoutTracker);