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
cleanup
ammarahm-edc229ef31ab05
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.jsindex 852975126..0472ed5a4 100644--- a/apps/mobile/src/components/Menu/index.js+++ b/apps/mobile/src/components/Menu/index.js@@ -17,23 +17,22 @@ import {COLOR_SCHEME_LIGHT,normalize,opacity,+ ph,pv,setColorScheme,SIZE,WEIGHT,- ph,} from '../../common/common';import {useTracked} from '../../provider';import {ACTIONS} from '../../provider/actions';import {eSendEvent} from '../../services/eventManager';import {+ eClearSearch,eOpenModalMenu,eSendSideMenuOverlayRef,- eClearSearch,} from '../../services/events';import NavigationService from '../../services/NavigationService';-import {timeSince, getElevation, hexToRGBA, db, DDS} from '../../utils/utils';-import {inputRef} from '../SearchInput';+import {db, DDS, hexToRGBA, timeSince} from '../../utils/utils';export const Menu = ({close = () => {},@@ -46,8 +45,6 @@ export const Menu = ({// todo- let overlayRef;-function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {let newColors = setColorScheme(colors, accent);StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content');@@ -172,10 +169,7 @@ export const Menu = ({{DDS.isTab ? null : (<View- ref={ref => (overlayRef = ref)}- onLayout={() => {- eSendEvent(eSendSideMenuOverlayRef, {ref: overlayRef});- }}+ ref={eSendSideMenuOverlayRef}style={{height: '100%',width: '100%',diff --git a/apps/mobile/src/components/SideMenu/index.js b/apps/mobile/src/components/SideMenu/index.jsindex 5617640e6..61f32f44d 100644--- a/apps/mobile/src/components/SideMenu/index.js+++ b/apps/mobile/src/components/SideMenu/index.js@@ -10,9 +10,8 @@ import {TouchableWithoutFeedback,View,} from 'react-native';-import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';-import {eSendSideMenuOverlayRef} from '../../services/events';import styles from './styles';+import {sideMenuOverlayRef} from '../../utils/refs';const deviceScreen = Dimensions.get('window');const barrierForward = deviceScreen.width / 4;@@ -201,7 +200,7 @@ export default class SideMenu extends React.Component {let o = newLeft / this.props.openMenuOffset;this.opacity.setValue(o * 0.5);if (o > 0.015) {- this.overlayViewRef.setNativeProps({+ sideMenuOverlayRef.setNativeProps({style: {display: 'none',position: 'relative',@@ -213,7 +212,7 @@ export default class SideMenu extends React.Component {},});} else {- this.overlayViewRef.setNativeProps({+ sideMenuOverlayRef.setNativeProps({style: {display: 'flex',position: 'absolute',@@ -268,7 +267,7 @@ export default class SideMenu extends React.Component {const {hiddenMenuOffset, openMenuOffset} = this.state;if (isOpen) {- this.overlayViewRef.setNativeProps({+ sideMenuOverlayRef.setNativeProps({style: {display: 'none',position: 'relative',@@ -281,7 +280,7 @@ export default class SideMenu extends React.Component {});} else {setTimeout(() => {- this.overlayViewRef.setNativeProps({+ sideMenuOverlayRef.setNativeProps({style: {display: 'flex',position: 'absolute',@@ -310,17 +309,8 @@ export default class SideMenu extends React.Component {componentDidMount() {this.setGestureEnabled(true);-- eSubscribeEvent(eSendSideMenuOverlayRef, this._getOverlayViewRef);- }- componentWillUnmount() {- eUnSubscribeEvent(eSendSideMenuOverlayRef, this._getOverlayViewRef);}- _getOverlayViewRef = data => {- this.overlayViewRef = data.ref;- };-render() {const boundryStyle =this.props.menuPosition === 'right'diff --git a/apps/mobile/src/utils/refs.js b/apps/mobile/src/utils/refs.jsindex 549b4ec1c..37200b4d6 100644--- a/apps/mobile/src/utils/refs.js+++ b/apps/mobile/src/utils/refs.js@@ -4,6 +4,7 @@ import {SafeAreaView} from 'react-native';export const sideMenuRef = createRef();export const inputRef = createRef();+export const sideMenuOverlayRef = createRef();export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(SafeAreaView,