Skip to content

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

refactor

ammarahm-ed542efac1bc91
diff --git a/apps/mobile/src/components/DummyText/index.js b/apps/mobile/src/components/DummyText/index.js
deleted file mode 100644
index ac061c58a..000000000
--- a/apps/mobile/src/components/DummyText/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React, {createRef} from 'react';
-import {Text} from 'react-native';
-import {SIZE} from '../../utils/SizeUtils';
-
-export const dummyRef = createRef();
-
-export const DummyText = () => {
- return (
- <Text
- ref={dummyRef}
- style={[
- {
- fontSize: SIZE.sm,
- position: 'absolute',
- right: -1000,
- top: -1000,
- },
- ]}>
- a
- </Text>
- );
-};
diff --git a/apps/mobile/src/navigation/RootView.js b/apps/mobile/src/navigation/RootView.js
index 4e7313144..321ff6df8 100644
--- a/apps/mobile/src/navigation/RootView.js
+++ b/apps/mobile/src/navigation/RootView.js
@@ -8,7 +8,6 @@ import Animated, { useValue } from 'react-native-reanimated';
import { notesnook } from '../../e2e/test.ids';
import CustomTabs from '../components/CustomTabs';
import { DialogManager } from '../components/DialogManager';
-import { DummyText } from '../components/DummyText';
import { Menu } from '../components/Menu';
import { Toast } from '../components/Toast';
import { useTracked } from '../provider';
@@ -80,7 +79,6 @@ export const RootView = React.memo(
<>
<NativeStack />
<Toast />
- <DummyText />
<DialogManager />
</>
);
diff --git a/apps/mobile/src/utils/index.js b/apps/mobile/src/utils/index.js
index ac1947467..4f0c01032 100755
--- a/apps/mobile/src/utils/index.js
+++ b/apps/mobile/src/utils/index.js
@@ -1,20 +1,18 @@
-import {createRef} from 'react';
-import {Dimensions, Image, NativeModules, Platform} from 'react-native';
+import { createRef } from 'react';
+import { Dimensions, NativeModules, Platform } from 'react-native';
import BackgroundService from 'react-native-background-actions';
import {
beginBackgroundTask,
endBackgroundTask
} from 'react-native-begin-background-task';
import RNTooltips from 'react-native-tooltips';
-import {dummyRef} from '../components/DummyText';
-import {useSettingStore} from '../provider/stores';
-import {eSendEvent} from '../services/EventManager';
+import { useSettingStore } from '../provider/stores';
+import { eSendEvent } from '../services/EventManager';
import Navigation from '../services/Navigation';
import * as ackeeTracker from './ackee';
-import {eOpenPremiumDialog, refreshNotesPage} from './Events';
-import {MMKV} from './mmkv';
-import {tabBarRef} from './Refs';
-import {SIZE} from './SizeUtils';
+import { refreshNotesPage } from './Events';
+import { MMKV } from './mmkv';
+import { tabBarRef } from './Refs';
export const APP_VERSION = 1694;
@@ -115,36 +113,6 @@ export const history = {
selectionMode: false
};
-export async function showContext(event, title) {
- event._targetInst.ref.current?.measureInWindow((x, y, w, h) => {
- dummyRef.current.setNativeProps({
- style: {
- fontSize: SIZE.sm
- }
- });
- dummyRef.current?.measure((xt, yt, wt, ht) => {
- let xVal;
- let yVal;
-
- if (x > dWidth / 50) {
- xVal = x - (w + (wt * title.length - 40));
- } else {
- xVal = x + (w + (wt * title.length - 40));
- }
-
- yVal = y + h / 2 + 10;
-
- eSendEvent('showContextMenu', {
- location: {
- x: xVal,
- y: yVal
- },
- title: title
- });
- });
- });
-}
-
export const bgTaskOptions = {
taskName: 'notesnookSync',
taskTitle: 'Notesnook Sync',