Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

upgrade to hermes & add new drawer

ammarahm-ed33984a123b92
diff --git a/apps/mobile/android/app/proguard-rules.pro b/apps/mobile/android/app/proguard-rules.pro
index 147ffbc0a..9ef3682de 100644
--- a/apps/mobile/android/app/proguard-rules.pro
+++ b/apps/mobile/android/app/proguard-rules.pro
@@ -9,4 +9,5 @@
# Add any project specific keep options here:
+-keep class com.facebook.jni.** { *; }
-keep public class com.horcrux.svg.** {*;}
\ No newline at end of file
diff --git a/apps/mobile/index.mobile.js b/apps/mobile/index.mobile.js
index 616eeeff0..a74bbe95e 100644
--- a/apps/mobile/index.mobile.js
+++ b/apps/mobile/index.mobile.js
@@ -1,9 +1,10 @@
import React, {createRef, useEffect, useState} from 'react';
import {Platform, StatusBar, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
-import DrawerLayout from 'react-native-drawer-layout';
import Animated from 'react-native-reanimated';
-import {Menu} from './src/components/Menu';
+import {Screen, ScreenContainer} from 'react-native-screens';
+import {DialogManager} from './src/components/DialogManager';
+import {Toast} from './src/components/Toast';
import {useTracked} from './src/provider';
import {NavigationStack} from './src/services/Navigator';
import {
@@ -12,18 +13,14 @@ import {
EditorScale,
EditorTranslateY,
} from './src/utils/animations';
-import {sideMenuRef} from './src/utils/refs';
import {DDS} from './src/utils/utils';
import Editor from './src/views/Editor';
-import {eSubscribeEvent, eUnSubscribeEvent} from './src/services/eventManager';
-import {eOpenSideMenu, eCloseSideMenu} from './src/services/events';
-import { Toast } from './src/components/Toast';
-import { DialogManager } from './src/components/DialogManager';
-import { Screen, ScreenContainer } from 'react-native-screens';
const editorRef = createRef();
-const AnimatedScreenContainer = Animated.createAnimatedComponent(ScreenContainer);
+const AnimatedScreenContainer = Animated.createAnimatedComponent(
+ ScreenContainer,
+);
export const Initialize = () => {
const [state, dispatch] = useTracked();
@@ -34,28 +31,10 @@ export const Initialize = () => {
if (Platform.OS === 'android') {
StatusBar.setBackgroundColor('transparent');
StatusBar.setTranslucent(true);
-
}
StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content');
}, []);
- const setGestureDisabled = () => {
- setLocked(true);
- };
-
- const setGestureEnabled = () => {
- setLocked(false);
- };
-
- useEffect(() => {
- eSubscribeEvent(eOpenSideMenu, setGestureEnabled);
- eSubscribeEvent(eCloseSideMenu, setGestureDisabled);
- return () => {
- eUnSubscribeEvent(eOpenSideMenu, setGestureEnabled);
- eUnSubscribeEvent(eCloseSideMenu, setGestureDisabled);
- };
- }, []);
-
return (
<>
<Animatable.View
@@ -67,33 +46,14 @@ export const Initialize = () => {
flexDirection: 'row',
backgroundColor: colors.bg,
}}>
- <DrawerLayout
- ref={sideMenuRef}
+ <View
style={{
- opacity: 0,
+ width: DDS.isTab ? '70%' : '100%',
+ height: '100%',
backgroundColor: colors.bg,
- }}
-
- keyboardDismissMode="ondrag"
- drawerWidth={300}
- drawerLockMode={locked ? 'locked-closed' : 'unlocked'}
- useNativeAnimations={true}
- renderNavigationView={() => (
- <Menu
- hide={false}
- colors={colors}
- close={() => sideMenuRef.current?.closeDrawer()}
- />
- )}>
- <View
- style={{
- width: DDS.isTab ? '70%' : '100%',
- height: '100%',
- backgroundColor: colors.bg,
- }}>
- <NavigationStack />
- </View>
- </DrawerLayout>
+ }}>
+ <NavigationStack />
+ </View>
<AnimatedScreenContainer
ref={editorRef}
@@ -115,7 +75,7 @@ export const Initialize = () => {
translateX: EditorPosition,
},
{
- translateY:EditorTranslateY,
+ translateY: EditorTranslateY,
},
{
scaleX: EditorScale,
@@ -125,16 +85,13 @@ export const Initialize = () => {
},
],
}}>
- <Screen
+ <Screen
active={1}
- style={{
- width:'100%',
- height:'100%'
- }}
- >
-
-
- <Editor noMenu={false} />
+ style={{
+ width: '100%',
+ height: '100%',
+ }}>
+ <Editor noMenu={false} />
</Screen>
</AnimatedScreenContainer>
</Animatable.View>
diff --git a/apps/mobile/index.tablet.js b/apps/mobile/index.tablet.js
index ffa22388c..6c3900d0a 100644
--- a/apps/mobile/index.tablet.js
+++ b/apps/mobile/index.tablet.js
@@ -1,7 +1,10 @@
import React, {createRef, useEffect, useState} from 'react';
import {Platform, StatusBar, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
+import {ScreenContainer} from 'react-native-screens';
+import {DialogManager} from './src/components/DialogManager';
import {Menu} from './src/components/Menu';
+import {Toast} from './src/components/Toast';
import {useTracked} from './src/provider';
import {
eSendEvent,
@@ -13,13 +16,11 @@ import {
eOnLoadNote,
eOpenFullscreenEditor,
} from './src/services/events';
-import {NavigationStack} from './src/services/Navigator';
+import {MainComponent, NavigationStack} from './src/services/Navigator';
import Editor from './src/views/Editor';
-import {sideMenuRef} from './src/utils/refs';
-import DrawerLayout from 'react-native-drawer-layout';
-import {getElevation} from './src/utils/utils';
-import {Toast} from './src/components/Toast';
-import {DialogManager} from './src/components/DialogManager';
+const AnimatedScreenContainer = Animated.createAnimatedComponent(
+ ScreenContainer,
+);
const editorRef = createRef();
let outColors;
@@ -27,6 +28,18 @@ let outColors;
export const Initialize = () => {
const [state, dispatch] = useTracked();
const {colors} = state;
+ return (
+ <>
+ <NavigationStack component={NavWrapper} />
+ <Toast />
+ <DialogManager colors={colors} />
+ </>
+ );
+};
+
+const NavWrapper = () => {
+ const [state, dispatch] = useTracked();
+ const {colors} = state;
const [fullscreen, setFullscreen] = useState(false);
@@ -77,73 +90,47 @@ export const Initialize = () => {
StatusBar.setBackgroundColor('transparent');
StatusBar.setTranslucent(true);
}
- StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content');
-
+ StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content');
}, []);
-
return (
- <>
- <DrawerLayout
- ref={sideMenuRef}
+ <View
+ style={{
+ width: '100%',
+ height: '100%',
+ flexDirection: 'row',
+ backgroundColor: colors.bg,
+ }}>
+ <Animatable.View
+ animation="fadeIn"
+ useNativeDriver={true}
+ duration={500}
+ delay={450}
style={{
- opacity: 0,
- backgroundColor: colors.bg,
- }}
- keyboardDismissMode="ondrag"
- drawerWidth={300}
- useNativeAnimations={true}
- renderNavigationView={() => (
- <Menu
- hide={false}
- colors={colors}
- close={() => sideMenuRef.current?.closeDrawer()}
- />
- )}>
- <Animatable.View
- transition="backgroundColor"
- duration={300}
- style={{
- width: '100%',
- height: '100%',
- flexDirection: 'row',
- backgroundColor: colors.bg,
- }}>
- <Animatable.View
- animation="fadeIn"
- useNativeDriver={true}
- duration={500}
- delay={450}
- style={{
- width: '4%',
- }}>
- <Menu hide={false} noTextMode={true} colors={colors} />
- </Animatable.View>
- <Animatable.View
- transition="backgroundColor"
- duration={300}
- style={{
- width: '28%',
- height: '100%',
- borderRightColor: colors.nav,
- borderRightWidth: 2,
- }}>
- <NavigationStack />
- </Animatable.View>
-
- <View
- ref={editorRef}
- style={{
- width: '68%',
- height: '100%',
- backgroundColor: 'transparent',
- }}>
- <Editor noMenu={fullscreen ? false : true} />
- </View>
- </Animatable.View>
- </DrawerLayout>
+ width: '4%',
+ }}>
+ <Menu hide={false} noTextMode={true} colors={colors} />
+ </Animatable.View>
+ <View
+ style={{
+ width: '28%',
+ height: '100%',
+ borderRightColor: colors.nav,
+ borderRightWidth: 2,
+ }}>
+ <MainComponent />
+ </View>
- <Toast />
- <DialogManager colors={colors} />
- </>
+ <AnimatedScreenContainer
+ ref={editorRef}
+ style={{
+ width: '68%',
+ height: '100%',
+ backgroundColor: 'transparent',
+ }}>
+ <Screen>
+ <Editor noMenu={fullscreen ? false : true} />
+ </Screen>
+ </AnimatedScreenContainer>
+ </View>
);
};