Skip to content

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

update drawer open/close functions

ammarahm-ede66274e4b3ca
diff --git a/apps/mobile/src/components/Menu/ColorSection.js b/apps/mobile/src/components/Menu/ColorSection.js
index 2b714daf4..bf9efa63e 100644
--- a/apps/mobile/src/components/Menu/ColorSection.js
+++ b/apps/mobile/src/components/Menu/ColorSection.js
@@ -1,14 +1,12 @@
-import React, {useEffect} from 'react';
-import {Text, View} from 'react-native';
-import {COLORS_NOTE, normalize, pv, SIZE} from '../../common/common';
-import {useTracked} from '../../provider';
-import {ACTIONS} from '../../provider/actions';
-import {eSendEvent} from '../../services/eventManager';
-import {refreshNotesPage} from '../../services/events';
+import React, { useEffect } from 'react';
+import { Text, View } from 'react-native';
+import { COLORS_NOTE, SIZE } from '../../common/common';
+import { useTracked } from '../../provider';
+import { ACTIONS } from '../../provider/actions';
+import { eSendEvent } from '../../services/eventManager';
+import { refreshNotesPage } from '../../services/events';
import NavigationService from '../../services/NavigationService';
-import {sideMenuRef} from '../../utils/refs';
-import {hexToRGBA, RGB_Linear_Shade} from '../../utils/utils';
-import {PressableButton} from '../PressableButton';
+import { PressableButton } from '../PressableButton';
export const ColorSection = ({noTextMode}) => {
const [state, dispatch] = useTracked();
@@ -61,7 +59,7 @@ export const ColorSection = ({noTextMode}) => {
NavigationService.navigate('Notes', params);
eSendEvent(refreshNotesPage, params);
- sideMenuRef.current?.closeDrawer();
+ NavigationService.closeDrawer();
}}
customStyle={{
flexDirection: 'row',
diff --git a/apps/mobile/src/components/Menu/MenuListItem.js b/apps/mobile/src/components/Menu/MenuListItem.js
index 759acef07..f0acac351 100644
--- a/apps/mobile/src/components/Menu/MenuListItem.js
+++ b/apps/mobile/src/components/Menu/MenuListItem.js
@@ -1,13 +1,13 @@
import React from 'react';
-import {Text, TouchableOpacity, View} from 'react-native';
+import { Text, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import {normalize, opacity, pv, SIZE, WEIGHT} from '../../common/common';
-import {useTracked} from '../../provider';
-import {ACTIONS} from '../../provider/actions';
-import {eSendEvent} from '../../services/eventManager';
-import {eClearSearch} from '../../services/events';
-import {sideMenuRef} from '../../utils/refs';
-import {PressableButton} from '../PressableButton';
+import { SIZE, WEIGHT } from '../../common/common';
+import { useTracked } from '../../provider';
+import { ACTIONS } from '../../provider/actions';
+import { eSendEvent } from '../../services/eventManager';
+import { eClearSearch } from '../../services/events';
+import NavigationService from '../../services/NavigationService';
+import { PressableButton } from '../PressableButton';
export const MenuListItem = ({item, index, noTextMode, ignore}) => {
const [state, dispatch] = useTracked();
@@ -26,7 +26,7 @@ export const MenuListItem = ({item, index, noTextMode, ignore}) => {
item.func();
if (item.close) {
- sideMenuRef.current?.closeDrawer();
+ NavigationService.closeDrawer();
}
};
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index 3f7c1a4fd..2afb6c288 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -29,6 +29,7 @@ import {MenuListItem} from './MenuListItem';
import {TagsSection} from './TagsSection';
import {UserSection} from './UserSection';
import {MMKV} from '../../utils/storage';
+import Seperator from '../Seperator';
const AnimatedSafeAreaView = createAnimatableComponent(SafeAreaView);
@@ -202,6 +203,7 @@ export const Menu = ({
/>
))}
</View>
+ <Seperator half />
<UserSection noTextMode={noTextMode} />
</View>
diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js
index 248219a6b..004db9c7f 100644
--- a/apps/mobile/src/components/header/index.js
+++ b/apps/mobile/src/components/header/index.js
@@ -30,7 +30,7 @@ export const Header = ({showSearch, root}) => {
const onLeftButtonPress = () => {
if (!headerState.canGoBack) {
- sideMenuRef.current?.openDrawer();
+ NavigationService.openDrawer();
return;
}
NavigationService.goBack();