2020-10-13 17:02:14 +05:00
|
|
|
import {NavigationContainer} from '@react-navigation/native';
|
|
|
|
|
import {createStackNavigator} from '@react-navigation/stack';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import Container from '../components/Container';
|
2020-11-02 20:43:52 +05:00
|
|
|
import { useTracked } from '../provider';
|
2020-10-13 17:02:14 +05:00
|
|
|
import {rootNavigatorRef} from '../utils/Refs';
|
|
|
|
|
import Favorites from '../views/Favorites';
|
|
|
|
|
import Folders from '../views/Folders';
|
|
|
|
|
import Home from '../views/Home';
|
|
|
|
|
import Notebook from '../views/Notebook';
|
|
|
|
|
import Notes from '../views/Notes';
|
|
|
|
|
import Settings from '../views/Settings';
|
|
|
|
|
import Tags from '../views/Tags';
|
|
|
|
|
import Trash from '../views/Trash';
|
|
|
|
|
|
|
|
|
|
const Stack = createStackNavigator();
|
|
|
|
|
|
|
|
|
|
export const NavigatorStack = () => {
|
2020-11-02 20:43:52 +05:00
|
|
|
const [state, dispatch] = useTracked();
|
|
|
|
|
const {settings} = state;
|
|
|
|
|
|
2020-10-13 17:02:14 +05:00
|
|
|
return (
|
|
|
|
|
<Container root={true}>
|
|
|
|
|
<NavigationContainer independent={true} ref={rootNavigatorRef}>
|
|
|
|
|
<Stack.Navigator
|
2020-11-02 20:43:52 +05:00
|
|
|
initialRouteName={settings.homepage}
|
2020-10-13 17:02:14 +05:00
|
|
|
screenOptions={{
|
|
|
|
|
headerShown: false,
|
|
|
|
|
animationEnabled: false,
|
|
|
|
|
gestureEnabled: false,
|
|
|
|
|
cardOverlayEnabled: false,
|
|
|
|
|
cardShadowEnabled: false,
|
2020-11-03 12:44:31 +05:00
|
|
|
|
2020-10-13 17:02:14 +05:00
|
|
|
}}>
|
|
|
|
|
<Stack.Screen name="Home" component={Home} />
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
initialParams={{
|
|
|
|
|
title: 'Notebooks',
|
|
|
|
|
canGoBack: false,
|
|
|
|
|
root: true,
|
|
|
|
|
}}
|
2020-11-02 20:43:52 +05:00
|
|
|
name="Notebooks"
|
2020-10-13 17:02:14 +05:00
|
|
|
component={Folders}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen name="Favorites" component={Favorites} />
|
|
|
|
|
<Stack.Screen name="Trash" component={Trash} />
|
|
|
|
|
<Stack.Screen name="Notes" component={Notes} />
|
|
|
|
|
<Stack.Screen name="Tags" component={Tags} />
|
|
|
|
|
<Stack.Screen name="Notebook" component={Notebook} />
|
|
|
|
|
<Stack.Screen name="Settings" component={Settings} />
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
</NavigationContainer>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
};
|