HomeNavigator.tsx 1.8 KB
Newer Older
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
1
import React from 'react';
Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
2
import { createStackNavigator } from '@react-navigation/stack';
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
3
import DiscoverScreen from '../screens/DiscoverScreen';
Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
4
import SettingsScreen from '../screens/SettingsScreen';
5 6 7 8 9 10
import HeaderLeftButton from './HeaderLeftButton';
import theme from '../theme';
import SavedListScreen from '../screens/SavedListScreen';
import CacheDetailScreen, { NavParams } from '../screens/CacheDetailScreen';
import RevisitCacheScreen from '../screens/RevisitCacheScreen';
import DevScreen from '../screens/DevScreen';
11
import GroupScreen from '../screens/GroupScreen';
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
12

Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
13
const Stack = createStackNavigator();
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
14
const HomeNavigator = () => (
15 16 17 18 19 20 21 22 23
  <Stack.Navigator
    screenOptions={({ navigation }) => ({
      headerLeft: () => <HeaderLeftButton onPress={() => navigation.goBack()} />,
      headerStyle: {
        backgroundColor: theme.colors.green,
      },
      headerTitleStyle: { fontSize: 24, color: theme.colors.white },
    })}
  >
Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
24
    <Stack.Screen
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
25 26
      name={'Discover'}
      component={DiscoverScreen}
27
      options={{ headerShown: false }}
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
28
    />
29

Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
30
    <Stack.Screen
31 32 33 34 35 36 37 38 39 40 41 42 43
      name={'SavedList'}
      component={SavedListScreen}
      options={{ title: 'Saved' }}
    />
    <Stack.Screen
      name={'CacheDetail'}
      component={CacheDetailScreen}
      options={({ route }) => ({ title: (route.params as NavParams).title })}
    />
    <Stack.Screen
      name={'RevisitCache'}
      component={RevisitCacheScreen}
      options={({ route }) => ({ title: (route.params as NavParams).title })}
Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
44
    />
45

Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
46 47 48 49
    <Stack.Screen
      name={'Settings'}
      component={SettingsScreen}
      options={{ title: 'Settings' }}
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
50
    />
51 52 53 54 55

    <Stack.Screen
      name={'Dev'}
      component={DevScreen}
    />
56 57 58 59
    <Stack.Screen
      name={'Group'}
      component={GroupScreen}
    />
Milan DiGiuseppe's avatar
Milan DiGiuseppe committed
60
  </Stack.Navigator>
Milan John Paul Digiuseppe's avatar
Milan John Paul Digiuseppe committed
61 62 63
);

export default HomeNavigator;