'use strict';

var React = require('react-native');
var AddEntryPage = require('./app/components/addEntryPage/addEntryPage');
var Leaderboard = require('./app/components/leaderboard/leaderboard');

var {
  StyleSheet,
  Component,
  AppRegistry,
  NavigatorIOS
} = React;

var styles = StyleSheet.create({
  container: {
    flex: 1
  }
});

class MoveItIOS extends Component {
  render() {
    return (
      <NavigatorIOS
        ref="nav"
        barTintColor="#FDC300"
        style={styles.container}
        initialRoute={{
          title: 'Add Entry',
          component: AddEntryPage,
          rightButtonTitle: 'Cancel',
          onRightButtonPress: () => {
            this.refs.nav.navigator.push({
              title: 'Leaderboard',
              component: Leaderboard
            })
          }
        }}
        />
    );
  }
}

AppRegistry.registerComponent('MoveItIOS', () => MoveItIOS);

'use strict';

var React = require('react-native');
var AddEntryPage = require('./app/components/addEntryPage/addEntryPage');

var {
    StyleSheet,
    Component,
    AppRegistry,
    NavigatorIOS
} = React;

var styles = StyleSheet.create({
    container: {
        flex: 1
    }
});

class MoveItIOS extends Component {
  render() {
    return (
        <NavigatorIOS
        barTintColor="#FDC300"
        style={styles.container}
        initialRoute={{
            title: 'Add Entry',
            component: AddEntryPage
        }}
        />
    );
  }
}

AppRegistry.registerComponent('MoveItIOS', () => MoveItIOS);

--- 
+++ 
@@ -2,38 +2,29 @@
 
 var React = require('react-native');
 var AddEntryPage = require('./app/components/addEntryPage/addEntryPage');
-var Leaderboard = require('./app/components/leaderboard/leaderboard');
 
 var {
-  StyleSheet,
-  Component,
-  AppRegistry,
-  NavigatorIOS
+    StyleSheet,
+    Component,
+    AppRegistry,
+    NavigatorIOS
 } = React;
 
 var styles = StyleSheet.create({
-  container: {
-    flex: 1
-  }
+    container: {
+        flex: 1
+    }
 });
 
 class MoveItIOS extends Component {
   render() {
     return (
-      <NavigatorIOS
-        ref="nav"
+        <NavigatorIOS
         barTintColor="#FDC300"
         style={styles.container}
         initialRoute={{
-          title: 'Add Entry',
-          component: AddEntryPage,
-          rightButtonTitle: 'Cancel',
-          onRightButtonPress: () => {
-            this.refs.nav.navigator.push({
-              title: 'Leaderboard',
-              component: Leaderboard
-            })
-          }
+            title: 'Add Entry',
+            component: AddEntryPage
         }}
         />
     );
Add navigation links in the navbar

https://trello.com/c/azIVrWVs/17-leaderboard

While the user always landed at the add entry page, there was
no way to go to the leaderboard without adding an entry.

- Add a 'Cancel' link in the add entry page
- Link this to the leaderboard
