// @flow

import React from 'react';
import { connect } from 'react-redux';
import { StackNavigator, addNavigationHelpers } from 'react-navigation';
import type { NavigationScreenProp } from 'react-navigation';
import * as Pages from 'DailyScrum/src/pages';

export const AppNavigator = StackNavigator(
  {
    home: {
      screen: Pages.Home,
      path: 'login#token=:token',
    },
    board: {
      screen: Pages.Board,
    },
  },
  {
    initialRouteName: 'home',
    URIPrefix: 'dailyscrum://',
    headerMode: 'none',
  }
);

const Scenes = (props) => (
  <AppNavigator navigation={addNavigationHelpers({
    dispatch: props.dispatch,
    state: props.navigation,
  })} />
);

export default connect(state => ({
  navigation: state.navigation,
}))(Scenes);

@@ -15,28 +15,83 @@
 rt React
- from 'react
+, %7B Component %7D from 'react';%0Aimport %7B Linking %7D from 'react-native
 ';%0Aimpor
@@ -311,22 +311,15 @@
 ';%0A%0A
-export 
 const 
-A
+a
 ppNa
@@ -329,33 +329,18 @@
 ator
- = StackNavigator(%0A 
+Pages =
  %7B%0A
-  
   ho
@@ -341,26 +341,24 @@
 %7B%0A  home: %7B%0A
-  
     screen: 
@@ -369,18 +369,16 @@
 s.Home,%0A
-  
     path
@@ -401,25 +401,21 @@
 token',%0A
-  
   %7D,%0A
-  
   board:
@@ -417,18 +417,16 @@
 oard: %7B%0A
-  
     scre
@@ -446,26 +446,46 @@
 rd,%0A
-  
   %7D,%0A
-  %7D,%0A 
+%7D;%0A%0Aconst appNavigatorConfig =
  %7B%0A
-  
   in
@@ -508,18 +508,16 @@
 'home',%0A
-  
   URIPre
@@ -538,18 +538,16 @@
 um://',%0A
-  
   header
@@ -564,44 +564,1046 @@
 e',%0A
-  %7D%0A);%0A%0Aconst Scenes = (props) =%3E (%0A
+%7D;%0A%0Aexport const AppNavigator = StackNavigator(appNavigatorPages, appNavigatorConfig);%0A%0Afunction urlToPathAndParams(url: string) %7B%0A  const params = %7B%7D;%0A  const URIPrefix = appNavigatorConfig.URIPrefix;%0A  const delimiter = URIPrefix %7C%7C '://';%0A  let path = url.split(delimiter)%5B1%5D;%0A  if (!path) %7B%0A    path = url;%0A  %7D%0A  return %7B%0A    path,%0A    params,%0A  %7D;%0A%7D%0A%0Aclass Scenes extends Component %7B%0A  componentDidMount() %7B%0A    Linking.addEventListener('url', this._handleOpenURL);%0A    Linking.getInitialURL().then((url: string) =%3E %7B%0A      if (url) %7B%0A        this._handleOpenURL(url);%0A      %7D%0A    %7D);%0A  %7D%0A%0A  componentWillUnmount() %7B%0A    Linking.removeEventListener('url', this._handleOpenURL);%0A  %7D%0A%0A  _handleOpenURL = (%7B url %7D: %7B url: string %7D) =%3E %7B%0A    const parsedUrl = urlToPathAndParams(url);%0A    if (parsedUrl) %7B%0A      const %7B path, params %7D = parsedUrl;%0A      const action = AppNavigator.router.getActionForPathAndParams(path, params);%0A      if (action) %7B%0A        this.props.dispatch(action);%0A      %7D%0A    %7D%0A  %7D;%0A%0A  render() %7B%0A    return (%0A    
   %3CA
@@ -1613,16 +1613,24 @@
 avigator
+%0A       
  navigat
@@ -1657,16 +1657,22 @@
 lpers(%7B%0A
+      
     disp
@@ -1677,16 +1677,21 @@
 spatch: 
+this.
 props.di
@@ -1698,16 +1698,22 @@
 spatch,%0A
+      
     stat
@@ -1715,16 +1715,21 @@
  state: 
+this.
 props.na
@@ -1744,17 +1744,39 @@
 ,%0A  
-%7D)%7D /%3E%0A);
+      %7D)%7D%0A      /%3E%0A    );%0A  %7D%0A%7D
 %0A%0Aex

Add deep-linking redux integration