A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
upgrade MoveNote Navigator
ammarahm-ed6da699f0aaf3
diff --git a/apps/mobile/index.js b/apps/mobile/index.jsindex 7cd4ca176..beffdf625 100644--- a/apps/mobile/index.js+++ b/apps/mobile/index.js@@ -1,12 +1,11 @@import "react-native-gesture-handler";import 'react-native-get-random-values'-import { enableScreens } from 'react-native-screens';import { AppRegistry } from 'react-native';import App from './App';import { name as appName } from './app.json';import React from 'react';import { Provider } from './src/provider';-enableScreens();+const AppProvider = () => {return (diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.jsindex 1b7dd34d5..719256c2e 100644--- a/apps/mobile/src/components/Container/index.js+++ b/apps/mobile/src/components/Container/index.js@@ -47,6 +47,7 @@ export const Container = ({noSelectionHeader = false,headerColor = null,type = null,+ route}) => {// Stateconst [state, dispatch] = useTracked();@@ -210,6 +211,7 @@ export const Container = ({countUp = 0;countDown = 0;}}+ route={route}headerColor={headerColor}navigation={navigation}colors={colors}diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.jsindex cd568c0f3..84c33f3de 100644--- a/apps/mobile/src/components/DialogManager/index.js+++ b/apps/mobile/src/components/DialogManager/index.js@@ -12,6 +12,7 @@ import MergeEditor from '../MergeEditor';import { VaultDialog } from '../VaultDialog';import { moveNoteEvent } from './recievers';import { TEMPLATE_DELETE, TEMPLATE_PERMANANT_DELETE } from './templates';+import MoveNoteDialog from '../MoveNoteDialog';export class DialogManager extends Component {constructor(props) {@@ -287,11 +288,11 @@ export class DialogManager extends Component {/><VaultDialog colors={colors} />-{/*+<MoveNoteDialogref={ref => (this.moveNoteDialog = ref)}colors={colors}- /> */}+ /><AddTopicDialogref={ref => (this.addTopicsDialog = ref)}diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.jsindex 54d74cb6c..fd747259d 100644--- a/apps/mobile/src/components/MoveNoteDialog/index.js+++ b/apps/mobile/src/components/MoveNoteDialog/index.js@@ -1,8 +1,6 @@-/* import React from 'react';+import React, {createRef} from 'react';import {Modal, TouchableOpacity, View} from 'react-native';import * as Animatable from 'react-native-animatable';-import {createAppContainer} from 'react-navigation';-import {createStackNavigator} from 'react-navigation-stack';import {ACTIONS} from '../../provider/actions';import {eSendEvent} from '../../services/eventManager';import {eMoveNoteDialogNavigateBack} from '../../services/events';@@ -11,69 +9,45 @@ import Folders from '../../views/Folders';import Notebook from '../../views/Notebook';import Notes from '../../views/Notes';import {updateEvent} from '../DialogManager/recievers';+import {NavigationContainer} from '@react-navigation/native';+import {createStackNavigator} from '@react-navigation/stack';-const fade = props => {- const {position, scene} = props;-- const index = scene.index;-- const translateX = 0;- const translateY = 0;-- const opacity = position.interpolate({- inputRange: [index - 0.7, index, index + 0.7],- outputRange: [0.3, 1, 0.3],- });-- return {- opacity,- transform: [{translateX}, {translateY}],- };+const Stack = createStackNavigator();+const modalNavigatorRef = createRef();+const ModalNavigator = () => {+ return (+ <NavigationContainer independent={true} ref={modalNavigatorRef}>+ <Stack.Navigator+ initialRouteName="Folders"+ screenOptions={{+ headerShown: false,+ animationEnabled: false,+ gestureEnabled: false,+ cardOverlayEnabled: false,+ cardShadowEnabled: false,+ }}>+ <Stack.Screen+ name="Folders"+ component={Folders}+ initialParams={{+ title: 'Select Notebook',+ isMove: true,+ hideMore: true,+ canGoBack: true,+ }}+ />+ <Stack.Screen name="Notes" component={Notes} />+ <Stack.Screen name="Notebook" component={Notebook} />+ </Stack.Navigator>+ </NavigationContainer>+ );};-const ModalNavigator = createStackNavigator(- {- Folders: {- screen: Folders,- },- Notebook: {- screen: Notebook,- },- Notes: {- screen: Notes,- },- },- {- initialRouteName: 'Folders',- initialRouteParams: {- title: 'Select Notebook',- isMove: true,- hideMore: true,- canGoBack: true,- },- defaultNavigationOptions: {- gesturesEnabled: false,- headerStyle: {- backgroundColor: 'transparent',- borderBottomWidth: 0,- height: 0,- },- },- transitionConfig: () => ({- screenInterpolator: props => {- return fade(props);- },- }),- },-);--const Navigator = createAppContainer(ModalNavigator);-class MoveNoteDialog extends React.Component {constructor(props) {super(props);this.state = {- visible: false,+ visible: true,animated: false,};this.routeIndex = 0;@@ -161,12 +135,7 @@ class MoveNoteDialog extends React.Component {padding: DDS.isTab ? 8 : 0,zIndex: 10,}}>- <Navigator- ref={ref => (this.navigation = ref)}- onNavigationStateChange={state => {- this.routeIndex = state.index;- }}- />+ <ModalNavigator /></View></Animatable.View></Modal>@@ -175,4 +144,3 @@ class MoveNoteDialog extends React.Component {}export default MoveNoteDialog;- */\ No newline at end of filediff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.jsindex 7f7253d03..a4a948ef0 100644--- a/apps/mobile/src/components/header/index.js+++ b/apps/mobile/src/components/header/index.js@@ -32,6 +32,7 @@ export const Header = ({navigation = null,isLoginNavigator,headerColor,+ route,}) => {const [state, dispatch] = useTracked();const {colors, syncing} = state;@@ -94,13 +95,13 @@ export const Header = ({hitSlop={{top: 20, bottom: 20, left: 50, right: 40}}onPress={() => {if (navigation && preventDefaultMargins) {- if (navigation.state.routeName === 'Folders') {+ if (route.name === 'Folders') {moveNoteHideEvent();} else {navigation.goBack();}} else if (navigation && isLoginNavigator) {- if (navigation.state.routeName === 'Login') {+ if (route.name === 'Login') {eSendEvent(eCloseLoginDialog);} else {navigation.goBack();diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.jsindex 1b69ffa72..3f9701784 100644--- a/apps/mobile/src/views/Folders/index.js+++ b/apps/mobile/src/views/Folders/index.js@@ -35,6 +35,7 @@ export const Folders = ({route, navigation}) => {};useEffect(() => {+if (isFocused) {dispatch({type: ACTIONS.PINNED});dispatch({type: ACTIONS.NOTEBOOKS});@@ -68,6 +69,7 @@ export const Folders = ({route, navigation}) => {<NotebookItemhideMore={params.hideMore}navigation={navigation}+ route={route}customStyle={{width: selectionMode ? w - 74 : '100%',marginHorizontal: 0,@@ -97,10 +99,11 @@ export const Folders = ({route, navigation}) => {return (<ContainerbottomButtonText="Create a new notebook"- menu={params.canGoBack ? false : true}+ menu={route.params.canGoBack ? false : true}preventDefaultMargins={preventDefaultMargins}heading={params.title}canGoBack={params.canGoBack}+ route={route}navigation={navigation}placeholder="Search all notebooks"data={notebooks}