This commit is contained in:
ammarahm-ed
2022-02-28 23:25:18 +05:00
parent 5679f1af41
commit 6fd462ad13
200 changed files with 1047 additions and 1430 deletions

View File

@@ -2,18 +2,17 @@ import React, { useEffect } from 'react';
import Orientation from 'react-native-orientation';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Launcher from './src/components/launcher';
import { useTracked } from './src/provider';
import { initialize, useSettingStore, useUserStore } from './src/provider/stores';
import { DDS } from './src/services/DeviceDetection';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from './src/services/EventManager';
import Notifications from './src/services/Notifications';
import SettingsService from './src/services/SettingsService';
import { ApplicationHolder } from './src/navigation';
import { useThemeStore } from './src/stores/theme';
import { initialize, useSettingStore, useUserStore } from './src/stores/stores';
import { DDS } from './src/services/device-detection';
import { eSendEvent } from './src/services/event-manager';
import Notifications from './src/services/notifications';
import SettingsService from './src/services/settings';
import { TipManager } from './src/services/tip-manager';
import { db } from './src/utils/database';
import { eDispatchAction } from './src/utils/events';
import { useAppEvents } from './src/utils/hooks/use-app-events';
import { MMKV } from './src/utils/database/mmkv';
import { ApplicationHolder } from './src/navigation';
import { useAppEvents } from './src/utils/hooks/use-app-events';
let databaseHasLoaded = false;
@@ -55,14 +54,12 @@ function checkOrientation() {
const loadMainApp = () => {
if (databaseHasLoaded) {
SettingsService.setAppLoaded();
eSendEvent('load_overlay');
initialize();
}
};
checkOrientation();
const App = () => {
const [, dispatch] = useTracked();
const setVerifyUser = useUserStore(state => state.setVerifyUser);
const appEvents = useAppEvents();
@@ -85,17 +82,6 @@ const App = () => {
})();
}, []);
const _dispatch = data => {
dispatch(data);
};
useEffect(() => {
eSubscribeEvent(eDispatchAction, _dispatch);
return () => {
eUnSubscribeEvent(eDispatchAction, _dispatch);
};
}, []);
return (
<SafeAreaProvider>
<ApplicationHolder />

View File

@@ -1,10 +1,10 @@
import React from 'react';
import { AppRegistry, LayoutAnimation, LogBox, Platform, UIManager } from 'react-native';
import { AppRegistry, LogBox, Platform, UIManager } from 'react-native';
import 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { enableScreens } from 'react-native-screens';
import { name as appName } from './app.json';
import Notifications from './src/services/Notifications';
import Notifications from './src/services/notifications';
global.Buffer = require('buffer').Buffer;
enableScreens(true);
UIManager.setLayoutAnimationEnabledExperimental &&
@@ -14,20 +14,14 @@ if (__DEV__) {
LogBox.ignoreAllLogs();
}
let Provider;
let App;
let NotesnookShare;
Notifications.init();
let QuickNoteIOS;
const AppProvider = () => {
Provider = require('./src/provider').Provider;
App = require('./App').default;
return (
<Provider>
<App />
</Provider>
);
return <App />;
};
AppRegistry.registerComponent(appName, () => AppProvider);

View File

@@ -0,0 +1,24 @@
- Add new "Move notes" button in topic properties to quickly move notes to a topic
- Overhauled Auth flows with new UI/UX
- Overhauled App lock UI
- Added new placeholders with useful tips about app features
- Added Auto search on typing in Search/Replace
- Added new walkthrough for notesnooks for new users
- Added read only mode for notes
- Added walkthroughs for pro/trial users
- Allow to opt-out of getting "Backup completed" dialogs on app launch when automatic backups are turned on
- Disable swipe gestures when selecting multiple notes
- Fixed Search/Replace does not accept spaces
- Fixed inline markdown transforms not working
- Fixed tags in editor hide/flicker on opening a note
- Fixed Home screen widget not launching on Android 12
- Fixed codeblocks are not scrollable in editor
- Fixed collapsing/expanding a heading causes cursor to jump on iOS
- Do not show title in notification pinned note
- Do not lock app if requesting fingerprint unlock for vault
- Reuse backup folder if it exists in subfolders of selected directory on android
- Fixed app hangs and becomes unusable on some phones
- Improved web clipper in widget to handle tables & codeblocks and remove invalid elements
- Disable swipe to close gesture in editor as it interferes with editing or scrolling.
Thank you for using Notesnook!

View File

@@ -25,7 +25,7 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import WebView from 'react-native-webview';
import ShareExtension from 'rn-extensions-share';
import isURL from 'validator/lib/isURL';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../src/services/EventManager';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../src/services/event-manager';
import { getElevation } from '../src/utils';
import { db } from '../src/utils/database';
import Storage from '../src/utils/database/storage';

View File

@@ -1,13 +1,12 @@
import React from 'react';
import { FlatList, View } from 'react-native';
import { useTracked } from '../../provider';
import { useMessageStore, useSelectionStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useMessageStore, useSelectionStore } from '../../stores/stores';
import { Button } from '../ui/button';
import { allowedOnPlatform, renderItem } from './functions';
export const Announcement = ({ color }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const announcements = useMessageStore(state => state.announcements);
const remove = useMessageStore(state => state.remove);
let announcement = announcements.length > 0 ? announcements[0] : null;

View File

@@ -1,11 +1,10 @@
import React from 'react';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import Paragraph from '../ui/typography/paragraph';
import { getStyle } from './functions';
export const Body = ({ text, style = {} }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<Paragraph

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { eSendEvent, presentSheet } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { eSendEvent, presentSheet } from '../../services/event-manager';
import { eCloseAnnouncementDialog } from '../../utils/events';
import { openLinkInBrowser } from '../../utils/functions';
import { SIZE } from '../../utils/size';
@@ -13,8 +13,7 @@ import { PricingPlans } from '../premium/pricing-plans';
import { allowedOnPlatform, getStyle } from './functions';
export const Cta = ({ actions, style = {}, color, inline }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
let buttons = actions.filter(item => allowedOnPlatform(item.platforms)) || [];
const onPress = async item => {

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import Paragraph from '../ui/typography/paragraph';
import { getStyle } from './functions';
export const Description = ({ text, style = {} }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<Paragraph
size={SIZE.md}

View File

@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { View } from 'react-native';
import { allowedPlatforms } from '../../provider/stores';
import { allowedPlatforms } from '../../stores/stores';
import { ProFeatures } from '../dialogs/result/pro-features';
import { Body } from './body';
import { Cta } from './cta';

View File

@@ -1,16 +1,15 @@
import React, { useEffect, useState } from 'react';
import { FlatList, View } from 'react-native';
import { useTracked } from '../../provider';
import { useMessageStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { useMessageStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { eCloseAnnouncementDialog, eOpenAnnouncementDialog } from '../../utils/events';
import BaseDialog from '../dialog/base-dialog';
import { allowedOnPlatform, renderItem } from './functions';
export const AnnouncementDialog = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [info, setInfo] = useState(null);
const remove = useMessageStore(state => state.remove);

View File

@@ -1,13 +1,12 @@
import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import Paragraph from '../ui/typography/paragraph';
import { getStyle } from './functions';
export const List = ({ items, listType, style = {} }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<View

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import Heading from '../ui/typography/heading';
import { getStyle } from './functions';
export const SubHeading = ({ text, style = {} }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<Heading

View File

@@ -1,11 +1,10 @@
import React from 'react';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import Heading from '../ui/typography/heading';
import { getStyle } from './functions';
export const Title = ({ text, style = {} }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<Heading

View File

@@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react';
import { TouchableOpacity, View } from 'react-native';
import * as Progress from 'react-native-progress';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useAttachmentStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useAttachmentStore } from '../../stores/stores';
import { db } from '../../utils/database';
import filesystem from '../../utils/filesystem';
import { SIZE } from '../../utils/size';
@@ -29,8 +29,7 @@ function getFileExtension(filename) {
}
export const AttachmentItem = ({ attachment, encryption }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const progress = useAttachmentStore(state => state.progress);
const [currentProgress, setCurrentProgress] = useState(
encryption

View File

@@ -2,8 +2,8 @@ import React, { useEffect, useRef, useState } from 'react';
import { View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { db } from '../../utils/database';
import { eCloseAttachmentDialog, eOpenAttachmentsDialog } from '../../utils/events';
import { SIZE } from '../../utils/size';
@@ -12,8 +12,7 @@ import SheetWrapper from '../ui/sheet';
import Paragraph from '../ui/typography/paragraph';
import { AttachmentItem } from './attachment-item';
export const AttachmentDialog = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [note, setNote] = useState(null);
const actionSheetRef = useRef();

View File

@@ -1,8 +1,8 @@
import React, { useRef, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
import { db } from '../../utils/database';
import { eCloseProgressDialog } from '../../utils/events';
import { Button } from '../ui/button';
@@ -12,8 +12,7 @@ import { Notice } from '../ui/notice';
import Seperator from '../ui/seperator';
export const ChangePassword = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const passwordInputRef = useRef();
const password = useRef();
const oldPasswordInputRef = useRef();

View File

@@ -1,9 +1,9 @@
import React, { useRef, useState } from 'react';
import { View } from 'react-native';
import ActionSheet from 'react-native-actions-sheet';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { ToastEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import { ToastEvent } from '../../services/event-manager';
import { db } from '../../utils/database';
import { MMKV } from '../../utils/database/mmkv';
import { IconButton } from '../ui/icon-button';
@@ -15,8 +15,7 @@ import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
export const ForgotPassword = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const email = useRef();
const emailInputRef = useRef();
const [error, setError] = useState(false);

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { useTracked } from '../../provider/index';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { eCloseLoginDialog, eOpenLoginDialog } from '../../utils/events';
import { sleep } from '../../utils/time';
import BaseDialog from '../dialog/base-dialog';
@@ -16,8 +16,7 @@ export const AuthMode = {
};
const Auth = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [currentAuthMode, setCurrentAuthMode] = useState(AuthMode.login);
const actionSheetRef = useRef();

View File

@@ -2,12 +2,12 @@ import React, { useEffect, useRef, useState } from 'react';
import { Platform, View } from 'react-native';
import { SheetManager } from 'react-native-actions-sheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
import { clearMessage } from '../../services/Message';
import PremiumService from '../../services/PremiumService';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
import { clearMessage } from '../../services/message';
import PremiumService from '../../services/premium';
import { db } from '../../utils/database';
import { eCloseLoginDialog } from '../../utils/events';
import { MMKV } from '../../utils/database/mmkv';
@@ -25,8 +25,7 @@ import { SVG } from './background';
import { ForgotPassword } from './forgot-password';
export const Login = ({ changeMode }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const email = useRef();
const emailInputRef = useRef();
const passwordInputRef = useRef();

View File

@@ -1,18 +1,18 @@
import React, { useEffect, useRef, useState } from 'react';
import { Modal, View } from 'react-native';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import BiometricService from '../../services/BiometricService';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import BiometricService from '../../services/biometrics';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
presentSheet,
ToastEvent
} from '../../services/EventManager';
import { clearMessage } from '../../services/Message';
import PremiumService from '../../services/PremiumService';
import Sync from '../../services/Sync';
} from '../../services/event-manager';
import { clearMessage } from '../../services/message';
import PremiumService from '../../services/premium';
import Sync from '../../services/sync';
import { db } from '../../utils/database';
import { MMKV } from '../../utils/database/mmkv';
import { SIZE } from '../../utils/size';
@@ -37,8 +37,7 @@ function getEmail(email) {
}
export const SessionExpired = () => {
const [state, dispatch] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const email = useRef();
const emailInputRef = useRef();
const passwordInputRef = useRef();

View File

@@ -1,12 +1,12 @@
import React, { useRef, useState } from 'react';
import { Dimensions, Platform, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent, ToastEvent } from '../../services/EventManager';
import { clearMessage, setEmailVerifyMessage } from '../../services/Message';
import PremiumService from '../../services/PremiumService';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSendEvent, ToastEvent } from '../../services/event-manager';
import { clearMessage, setEmailVerifyMessage } from '../../services/message';
import PremiumService from '../../services/premium';
import { db } from '../../utils/database';
import { eCloseLoginDialog } from '../../utils/events';
import { openLinkInBrowser } from '../../utils/functions';
@@ -24,8 +24,7 @@ import Paragraph from '../ui/typography/paragraph';
import { SVG } from './background';
export const Signup = ({ changeMode, welcome, trial }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const email = useRef();
const emailInputRef = useRef();
const passwordInputRef = useRef();

View File

@@ -1,11 +1,10 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useSelectionStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useSelectionStore } from '../../stores/stores';
export const ContainerHeader = ({ children }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const selectionMode = useSelectionStore(state => state.selectionMode);
return !selectionMode ? (

View File

@@ -4,7 +4,7 @@ import Animated, { Easing } from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../e2e/test.ids';
import { useSelectionStore, useSettingStore } from '../../provider/stores';
import { useSelectionStore, useSettingStore } from '../../stores/stores';
import { editing, getElevation, showTooltip, TOOLTIP_POSITIONS } from '../../utils';
import { normalize, SIZE } from '../../utils/size';
import { PressableButton } from '../ui/pressable';

View File

@@ -1,10 +1,9 @@
import React from 'react';
import { KeyboardAvoidingView, Platform, SafeAreaView } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import useIsFloatingKeyboard from '../../utils/hooks/use-is-floating-keyboard';
export const Container = ({ children }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const floating = useIsFloatingKeyboard();
return (
<KeyboardAvoidingView

View File

@@ -8,7 +8,7 @@ import {
TouchableOpacity,
View
} from 'react-native';
import { useSettingStore } from '../../provider/stores';
import { useSettingStore } from '../../stores/stores';
import useIsFloatingKeyboard from '../../utils/hooks/use-is-floating-keyboard';
import { BouncingView } from '../ui/transitions/bouncing-view';

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { ActivityIndicator, StyleSheet, View } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';
import Paragraph from '../ui/typography/paragraph';
@@ -16,8 +16,7 @@ const DialogButtons = ({
doneText,
positiveType
}) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return (
<View

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import { getElevation } from '../../utils';
const DialogContainer = ({ width, height, ...restProps }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<View

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Text } from 'react-native';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';
import Heading from '../ui/typography/heading';
@@ -17,8 +17,7 @@ const DialogHeader = ({
centered,
titlePart
}) => {
const [state, dispatch] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<>

View File

@@ -1,4 +1,4 @@
import { eSendEvent } from '../../services/EventManager';
import { eSendEvent } from '../../services/event-manager';
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
type DialogInfo = {

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useRef, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { getElevation } from '../../utils';
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
import { sleep } from '../../utils/time';
@@ -14,8 +14,7 @@ import DialogButtons from './dialog-buttons';
import DialogHeader from './dialog-header';
export const Dialog = ({ context = 'global' }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [inputValue, setInputValue] = useState(null);
const inputRef = useRef();

View File

@@ -1,10 +1,9 @@
import { eSendEvent } from '../../services/EventManager';
import { eSendEvent } from '../../services/event-manager';
import {
eCloseActionSheet,
eCloseAddNotebookDialog,
eCloseAddTopicDialog,
eCloseMoveNoteDialog,
eDispatchAction,
eOpenActionSheet,
eOpenAddNotebookDialog,
eOpenAddTopicDialog,
@@ -40,7 +39,3 @@ export const AddTopicEvent = topic => {
export const HideAddTopicEvent = notebook => {
eSendEvent(eCloseAddTopicDialog, notebook);
};
export const updateEvent = data => {
eSendEvent(eDispatchAction, data);
};

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { EditorSettings } from '../../screens/editor/EditorSettings';
import { AddNotebookSheet } from '../sheets/add-notebook';
import { AddTopicDialog } from '../dialogs/add-topic';
@@ -24,8 +24,7 @@ import ManageTagsSheet from '../sheets/manage-tags';
import { VaultDialog } from '../dialogs/vault';
function DialogProvider() {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return (
<>

View File

@@ -1,9 +1,9 @@
import React, { createRef } from 'react';
import { Keyboard, LayoutAnimation, UIManager, View } from 'react-native';
import { Transition, Transitioning, TransitioningView } from 'react-native-reanimated';
import { useMenuStore } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useMenuStore } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { eCloseAddTopicDialog, eOpenAddTopicDialog } from '../../../utils/events';
import { sleep } from '../../../utils/time';

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { ScrollView, View } from 'react-native';
import { useTracked } from '../../../provider';
import { useMessageStore } from '../../../provider/stores';
import { DDS } from '../../../services/DeviceDetection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { useMessageStore } from '../../../stores/stores';
import { DDS } from '../../../services/device-detection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
import { getElevation } from '../../../utils';
import { eCloseJumpToDialog, eOpenJumpToDialog, eScrollEvent } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -14,8 +14,7 @@ import Paragraph from '../../ui/typography/paragraph';
const offsets = [];
let timeout = null;
const JumpToSectionDialog = ({ scrollRef, data, type, screen }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const notes = data;
const [visible, setVisible] = useState(false);
const [currentIndex, setCurrentIndex] = useState(null);

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../../provider';
import { eSendEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { eSendEvent } from '../../../services/event-manager';
import {
eCloseProgressDialog,
eCloseResultDialog,
@@ -12,8 +12,7 @@ import { SIZE } from '../../../utils/size';
import { sleep } from '../../../utils/time';
import Paragraph from '../../ui/typography/paragraph';
export const ProFeatures = ({ count = 6 }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return (
<>

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../../provider';
import { DDS } from '../../../services/DeviceDetection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { DDS } from '../../../services/device-detection';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
import { getElevation } from '../../../utils';
import { eCloseResultDialog, eOpenResultDialog } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -14,8 +14,7 @@ import Paragraph from '../../ui/typography/paragraph';
import { ProFeatures } from './pro-features';
const ResultDialog = () => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [dialogData, setDialogData] = useState({
title: 'Thank you for signing up!',

View File

@@ -3,15 +3,15 @@ import React, { Component, createRef } from 'react';
import { InteractionManager, View } from 'react-native';
import Share from 'react-native-share';
import { notesnook } from '../../../../e2e/test.ids';
import BiometricService from '../../../services/BiometricService';
import { DDS } from '../../../services/DeviceDetection';
import BiometricService from '../../../services/biometrics';
import { DDS } from '../../../services/device-detection';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
ToastEvent
} from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
} from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { getElevation, toTXT } from '../../../utils';
import { db } from '../../../utils/database';
import {
@@ -124,7 +124,7 @@ export class VaultDialog extends Component {
/**
*
* @param {import('../../../services/EventManager').vaultType} data
* @param {import('../../../services/event-manager').vaultType} data
*/
open = async data => {
if (!Keychain) {

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useTracked } from '../../provider';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import SearchService from '../../services/SearchService';
import { useThemeStore } from '../../stores/theme';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import SearchService from '../../services/search';
import { eScrollEvent } from '../../utils/events';
import { IconButton } from '../ui/icon-button';
import { SearchInput } from '../SearchInput';
@@ -13,8 +13,7 @@ import { Title } from './title';
export const Header = React.memo(
({ root, title, screen, isBack, color, action, rightButtons, notebook }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const insets = useSafeAreaInsets();
const [hide, setHide] = useState(true);

View File

@@ -1,14 +1,13 @@
import React from 'react';
import { notesnook } from '../../../e2e/test.ids';
import { useTracked } from '../../provider';
import { useSettingStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { useSettingStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import Navigation from '../../services/navigation';
import { IconButton } from '../ui/icon-button';
export const LeftMenus = ({ currentScreen, headerMenuState }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const deviceMode = useSettingStore(state => state.deviceMode);
const onLeftButtonPress = () => {

View File

@@ -2,16 +2,15 @@ import React, { useRef } from 'react';
import { StyleSheet, View } from 'react-native';
import Menu from 'react-native-reanimated-material-menu';
import { notesnook } from '../../../e2e/test.ids';
import { useTracked } from '../../provider';
import { useSettingStore } from '../../provider/stores';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { useSettingStore } from '../../stores/stores';
import Navigation from '../../services/navigation';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';
import { IconButton } from '../ui/icon-button';
export const RightMenus = ({ currentScreen, action, rightButtons }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const deviceMode = useSettingStore(state => state.deviceMode);
const menuRef = useRef();
return (

View File

@@ -1,16 +1,15 @@
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { eOnNewTopicAdded, eScrollEvent } from '../../utils/events';
import { SIZE } from '../../utils/size';
import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
export const Title = ({ heading, headerColor, screen, notebook }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [hide, setHide] = useState(screen === 'Notebook' ? true : false);
const onScroll = data => {

View File

@@ -5,7 +5,7 @@ import RNFetchBlob from 'rn-fetch-blob';
import Storage from '../../utils/database/storage';
import { IconButton } from '../ui/icon-button';
import BaseDialog from '../dialog/base-dialog';
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../services/EventManager');
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../services/eventmanager');
const ImagePreview = () => {
const [visible, setVisible] = useState(false);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2,25 +2,25 @@ import React, { useEffect, useRef, useState } from 'react';
import { NativeModules, Platform, StatusBar, View } from 'react-native';
import RNBootSplash from 'react-native-bootsplash';
import { checkVersion } from 'react-native-check-version';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import {
useFavoriteStore,
useMessageStore,
useNoteStore,
useSettingStore,
useUserStore
} from '../../provider/stores';
import BiometricService from '../../services/BiometricService';
import { DDS } from '../../services/DeviceDetection';
} from '../../stores/stores';
import BiometricService from '../../services/biometrics';
import { DDS } from '../../services/device-detection';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
presentSheet,
ToastEvent
} from '../../services/EventManager';
import { setRateAppMessage } from '../../services/Message';
import PremiumService from '../../services/PremiumService';
} from '../../services/event-manager';
import { setRateAppMessage } from '../../services/message';
import PremiumService from '../../services/premium';
import { editing } from '../../utils';
import { db } from '../../utils/database';
import { eOpenAnnouncementDialog } from '../../utils/events';
@@ -44,8 +44,7 @@ let passwordValue = null;
let didVerifyUser = false;
const Launcher = ({ onLoad }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const setNotes = useNoteStore(state => state.setNotes);
const setFavorites = useFavoriteStore(state => state.setFavorites);
const _setLoading = useNoteStore(state => state.setLoading);

View File

@@ -1,16 +1,15 @@
import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useMessageStore, useSelectionStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useMessageStore, useSelectionStore } from '../../stores/stores';
import { hexToRGBA } from '../../utils/color-scheme/utils';
import { SIZE } from '../../utils/size';
import { PressableButton } from '../ui/pressable';
import Paragraph from '../ui/typography/paragraph';
export const Card = ({ color }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
color = color ? color : colors.accent;
const selectionMode = useSelectionStore(state => state.selectionMode);

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { ActivityIndicator, useWindowDimensions, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useTracked } from '../../provider';
import { useSettingStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useSettingStore } from '../../stores/stores';
import { useTip } from '../../services/tip-manager';
import { COLORS_NOTE } from '../../utils/color-scheme';
import { SIZE } from '../../utils/size';
@@ -14,8 +14,7 @@ import Paragraph from '../ui/typography/paragraph';
export const Empty = React.memo(
({ loading = true, placeholderData, headerProps, type, screen }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const insets = useSafeAreaInsets();
const { height } = useWindowDimensions();
const introCompleted = useSettingStore(state => state.isIntroCompleted);

View File

@@ -1,10 +1,10 @@
import React, { useEffect, useRef, useState } from 'react';
import { FlatList, RefreshControl, View } from 'react-native';
import { notesnook } from '../../../e2e/test.ids';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { eSendEvent } from '../../services/EventManager';
import Sync from '../../services/Sync';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { eSendEvent } from '../../services/event-manager';
import Sync from '../../services/sync';
import { db } from '../../utils/database';
import { eScrollEvent } from '../../utils/events';
import JumpToSectionDialog from '../dialogs/jump-to-section';
@@ -60,8 +60,7 @@ const List = ({
screen,
ListHeader
}) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const scrollRef = useRef();
const [_loading, _setLoading] = useState(true);
const syncing = useUserStore(state => state.syncing);

View File

@@ -1,15 +1,14 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../../provider';
import { useMessageStore } from '../../../provider/stores';
import { useThemeStore } from '../../../stores/theme';
import { useMessageStore } from '../../../stores/stores';
import { COLORS_NOTE } from '../../../utils/color-scheme';
import { Announcement } from '../../announcements/announcement';
import { Card } from '../../list/card';
export const Header = React.memo(
({ type, messageCard = true, color, shouldShow = false, noAnnouncement }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const announcements = useMessageStore(state => state.announcements);
return (

View File

@@ -1,8 +1,8 @@
import React, { useRef, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../../provider';
import { useMenuStore } from '../../../provider/stores';
import { ToastEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { useMenuStore } from '../../../stores/stores';
import { ToastEvent } from '../../../services/event-manager';
import { getTotalNotes } from '../../../utils';
import { db } from '../../../utils/database';
import { SIZE } from '../../../utils/size';
@@ -11,8 +11,7 @@ import Heading from '../../ui/typography/heading';
import Paragraph from '../../ui/typography/paragraph';
export const NotebookHeader = ({ notebook, onEditNotebook }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [isPinnedToMenu, setIsPinnedToMenu] = useState(db.settings.isPinned(notebook.id));
const setMenuPins = useMenuStore(state => state.setMenuPins);
const totalNotes = getTotalNotes(notebook);

View File

@@ -1,14 +1,14 @@
import React, { useEffect, useRef, useState } from 'react';
import { TouchableOpacity, useWindowDimensions, View } from 'react-native';
import { useTracked } from '../../../provider';
import { useSettingStore } from '../../../provider/stores';
import { useThemeStore } from '../../../stores/theme';
import { useSettingStore } from '../../../stores/stores';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
presentSheet
} from '../../../services/EventManager';
import SettingsService from '../../../services/SettingsService';
} from '../../../services/event-manager';
import SettingsService from '../../../services/settings';
import { GROUP } from '../../../utils/constants';
import { COLORS_NOTE } from '../../../utils/color-scheme';
import { db } from '../../../utils/database';
@@ -20,8 +20,7 @@ import Sort from '../../sheets/sort';
import Heading from '../../ui/typography/heading';
export const SectionHeader = ({ item, index, type, color, screen }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const { fontScale } = useWindowDimensions();
const [groupOptions, setGroupOptions] = useState(db.settings?.getGroupOptions(type));
let groupBy = Object.keys(GROUP).find(key => GROUP[key] === groupOptions.groupBy);

View File

@@ -3,10 +3,10 @@ import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../../e2e/test.ids';
import { useTracked } from '../../../provider';
import { useSettingStore } from '../../../provider/stores';
import { eSendEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { useSettingStore } from '../../../stores/stores';
import { eSendEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { COLORS_NOTE } from '../../../utils/color-scheme';
import { db } from '../../../utils/database';
import { refreshNotesPage } from '../../../utils/events';
@@ -52,8 +52,7 @@ const showActionSheet = item => {
};
const NoteItem = ({ item, isTrash, tags, dateBy = 'dateCreated', noOpen = false }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const settings = useSettingStore(state => state.settings);
const compactMode = settings.notesListMode === 'compact';
const attachmentCount = db.attachments?.ofNote(item.id, 'all')?.length || 0;

View File

@@ -1,10 +1,10 @@
import React from 'react';
import NoteItem from '.';
import { notesnook } from '../../../../e2e/test.ids';
import { useEditorStore, useSelectionStore, useTrashStore } from '../../../provider/stores';
import { DDS } from '../../../services/DeviceDetection';
import { eSendEvent, openVault, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useEditorStore, useSelectionStore, useTrashStore } from '../../../stores/stores';
import { DDS } from '../../../services/device-detection';
import { eSendEvent, openVault, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { history } from '../../../utils';
import { db } from '../../../utils/database';
import { eOnLoadNote, eShowMergeDialog } from '../../../utils/events';

View File

@@ -2,10 +2,10 @@ import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../../e2e/test.ids';
import { useTracked } from '../../../provider';
import { useSettingStore } from '../../../provider/stores';
import { eSendEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { useSettingStore } from '../../../stores/stores';
import { eSendEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { getTotalNotes, history } from '../../../utils';
import { refreshNotesPage } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -16,8 +16,7 @@ import Heading from '../../ui/typography/heading';
import Paragraph from '../../ui/typography/paragraph';
export const NotebookItem = ({ item, isTopic = false, notebookID, isTrash, dateBy }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const settings = useSettingStore(state => state.settings);
const compactMode = settings.notebooksListMode === 'compact';
const topics = item.topics?.slice(0, 3) || [];

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { NotebookItem } from '.';
import { useSelectionStore } from '../../../provider/stores';
import { eSendEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useSelectionStore } from '../../../stores/stores';
import { eSendEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { history } from '../../../utils';
import { eOnNewTopicAdded, refreshNotesPage } from '../../../utils/events';
import SelectionWrapper from '../selection-wrapper';

View File

@@ -2,15 +2,15 @@ import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import Animated, { useValue } from 'react-native-reanimated';
import { useTracked } from '../../../provider';
import { useThemeStore } from '../../../stores/theme';
import {
useMenuStore,
useNotebookStore,
useSelectionStore,
useTrashStore
} from '../../../provider/stores';
import { openVault, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
} from '../../../stores/stores';
import { openVault, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { dWidth, getElevation, toTXT } from '../../../utils';
import { db } from '../../../utils/database';
import { deleteItems } from '../../../utils/functions';
@@ -19,8 +19,7 @@ import { Button } from '../../ui/button';
import { presentDialog } from '../../dialog/functions';
export const ActionStrip = ({ note, setActionStrip }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const selectionMode = useSelectionStore(state => state.selectionMode);
const setNotebooks = useNotebookStore(state => state.setNotebooks);
const setMenuPins = useMenuStore(state => state.setMenuPins);

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../../provider';
import { useEditorStore } from '../../../provider/stores';
import { useThemeStore } from '../../../stores/theme';
import { useEditorStore } from '../../../stores/stores';
import { hexToRGBA } from '../../../utils/color-scheme/utils';
export const Filler = ({ item, background }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const currentEditingNote = useEditorStore(state => state.currentEditingNote);

View File

@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { useTracked } from '../../../provider';
import { useSettingStore } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { useSettingStore } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
import { history } from '../../../utils';
import { PressableButton } from '../../ui/pressable';
import { ActionStrip } from './action-strip';
@@ -9,8 +9,7 @@ import { Filler } from './back-fill';
import { SelectionIcon } from './selection';
const SelectionWrapper = ({ children, item, background, onLongPress, onPress, testID }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [actionStrip, setActionStrip] = useState(false);
const settings = useSettingStore(state => state.settings);
const listMode = item.type === 'notebook' ? settings.notebooksListMode : settings.notesListMode;

View File

@@ -1,14 +1,13 @@
import React, { useEffect, useState } from 'react';
import { TouchableOpacity, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../../provider';
import { Actions } from '../../../provider/Actions';
import { useSelectionStore } from '../../../provider/stores';
import { useThemeStore } from '../../../stores/theme';
import { Actions } from '../../../stores/Actions';
import { useSelectionStore } from '../../../stores/stores';
import { SIZE } from '../../../utils/size';
export const SelectionIcon = ({ setActionStrip, item, compactMode }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const selectionMode = useSelectionStore(state => state.selectionMode);
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);

View File

@@ -2,9 +2,9 @@ import React from 'react';
import { useWindowDimensions, View } from 'react-native';
import { notesnook } from '../../../../e2e/test.ids';
import { PressableButton } from '../../ui/pressable';
import { useTracked } from '../../../provider';
import { eSendEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { eSendEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { refreshNotesPage } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -15,8 +15,7 @@ import Paragraph from '../../ui/typography/paragraph';
const TagItem = React.memo(
({ item, index }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const { fontScale } = useWindowDimensions();
const onPress = () => {
let params = {

View File

@@ -5,16 +5,16 @@ import { Modal, Platform, SafeAreaView, Text, View } from 'react-native';
import Animated from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import WebView from 'react-native-webview';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent,
ToastEvent
} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import Sync from '../../services/Sync';
} from '../../services/event-manager';
import Navigation from '../../services/navigation';
import Sync from '../../services/sync';
import { dHeight } from '../../utils';
import { db } from '../../utils/database';
import { eApplyChanges, eShowMergeDialog, refreshNotesPage } from '../../utils/events';
@@ -50,8 +50,7 @@ function onMediaLoaded({ hash, src }) {
}
const MergeConflicts = () => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [primary, setPrimary] = useState(true);
const [secondary, setSecondary] = useState(true);

View File

@@ -2,8 +2,8 @@ import React, { useCallback, useEffect, useState } from 'react';
import { Text, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { presentSheet } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { presentSheet } from '../../services/event-manager';
import { db } from '../../utils/database';
import { openLinkInBrowser } from '../../utils/functions';
import { SIZE } from '../../utils/size';
@@ -18,8 +18,7 @@ import NotePreview from './preview';
export default function NoteHistory({ note, ref }) {
const [history, setHistory] = useState([]);
const [loading, setLoading] = useState(true);
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
useEffect(() => {
(async () => {

View File

@@ -1,10 +1,10 @@
import React, { useRef } from 'react';
import { Alert, Platform, View } from 'react-native';
import WebView from 'react-native-webview';
import { useTracked } from '../../provider';
import { useEditorStore } from '../../provider/stores';
import { eSendEvent, ToastEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { useEditorStore } from '../../stores/stores';
import { eSendEvent, ToastEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { db } from '../../utils/database';
import { eCloseProgressDialog, eOnLoadNote } from '../../utils/events';
import { openLinkInBrowser } from '../../utils/functions';
@@ -17,8 +17,7 @@ import DialogHeader from '../dialog/dialog-header';
import Paragraph from '../ui/typography/paragraph';
export default function NotePreview({ session, content }) {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const webviewRef = useRef();
const onLoad = async () => {

View File

@@ -1,11 +1,11 @@
import React, { useState } from 'react';
import { ScrollView, View } from 'react-native';
import { LAUNCH_ROCKET } from '../../assets/images/assets';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent, presentSheet } from '../../services/EventManager';
import PremiumService from '../../services/PremiumService';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSendEvent, presentSheet } from '../../services/event-manager';
import PremiumService from '../../services/premium';
import { getElevation } from '../../utils';
import { db } from '../../utils/database';
import {
@@ -32,8 +32,7 @@ import { Group } from './group';
import { PricingPlans } from './pricing-plans';
export const Component = ({ close, promo, getRef }) => {
const [state, dispatch] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const user = useUserStore(state => state.user);
const userCanRequestTrial =
user && (!user.subscription || !user.subscription.expiry) ? true : false;

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import PremiumService from '../../services/PremiumService';
import { useThemeStore } from '../../stores/theme';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import PremiumService from '../../services/premium';
import { eOpenPremiumDialog, eOpenResultDialog, eOpenTrialEndingDialog } from '../../utils/events';
import { SIZE } from '../../utils/size';
import { sleep } from '../../utils/time';
@@ -16,8 +16,7 @@ import { CompactFeatures } from './compact-features';
import { Offer } from './offer';
export const Expiring = () => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [status, setStatus] = useState({
title: 'Your trial is ending soon',

View File

@@ -1,14 +1,13 @@
import React from 'react';
import { Text, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import Paragraph from '../ui/typography/paragraph';
import { ProTag } from './pro-tag';
export const FeatureBlock = ({ vertical, highlight, content, icon, pro, proTagBg }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return vertical ? (
<View

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { ScrollView, View } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
@@ -8,8 +8,7 @@ import { FeatureBlock } from './feature';
import { ProTag } from './pro-tag';
export const Group = ({ item, index }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<View

View File

@@ -1,5 +1,5 @@
import React, { createRef } from 'react';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { eClosePremiumDialog, eOpenPremiumDialog } from '../../utils/events';
import BaseDialog from '../dialog/base-dialog';
import { Component } from './component';

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { Text } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import Paragraph from '../ui/typography/paragraph';
export const Offer = ({ off = '30', text = 'on yearly plan, offer ends soon', padding = 0 }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return (
<Paragraph

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { dWidth, editing, getElevation } from '../../utils';
import { eCloseActionSheet, eOpenPremiumDialog, eShowGetPremium } from '../../utils/events';
import { SIZE } from '../../utils/size';
@@ -22,8 +22,7 @@ let currentMsg = {
desc: ''
};
export const PremiumToast = ({ close, context = 'global', offset = 0 }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [msg, setMsg] = useState(currentMsg);
const open = event => {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { getElevation } from '../../utils';
import { SIZE } from '../../utils/size';
import { PressableButton } from '../ui/pressable';
@@ -8,8 +8,7 @@ import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
export const PricingItem = ({ product, onPress, compact }) => {
const [state, dispatch] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<PressableButton

View File

@@ -1,10 +1,10 @@
import React, { useEffect, useState } from 'react';
import { ActivityIndicator, Platform, Text, View } from 'react-native';
import * as RNIap from 'react-native-iap';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
import PremiumService from '../../services/PremiumService';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
import PremiumService from '../../services/premium';
import { db } from '../../utils/database';
import {
eClosePremiumDialog,
@@ -45,8 +45,7 @@ export const PricingPlans = ({
trial = false,
showTrialOption = true
}) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const user = useUserStore(state => state.user);
const [product, setProduct] = useState(null);
const [products, setProducts] = useState([]);

View File

@@ -1,12 +1,11 @@
import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import Paragraph from '../ui/typography/paragraph';
export const ProTag = ({ width, size, background }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
return (
<View

View File

@@ -2,10 +2,10 @@ import React, { useState } from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../e2e/test.ids';
import { useMenuStore, useSettingStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useMenuStore, useSettingStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSendEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { dWidth } from '../../utils';
import { COLORS_NOTE } from '../../utils/color-scheme';
import { db } from '../../utils/database';

View File

@@ -1,13 +1,12 @@
import React from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useThemeStore } from '../../stores/theme';
import { SIZE } from '../../utils/size';
import { timeConverter } from '../../utils/time';
import Paragraph from '../ui/typography/paragraph';
export const DateMeta = ({ item }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const getNameFromKey = key => {
switch (key) {

View File

@@ -1,8 +1,8 @@
import Clipboard from '@react-native-clipboard/clipboard';
import React from 'react';
import { View } from 'react-native';
import { useSettingStore } from '../../provider/stores';
import { ToastEvent } from '../../services/EventManager';
import { useSettingStore } from '../../stores/stores';
import { ToastEvent } from '../../services/event-manager';
import { db } from '../../utils/database';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { Platform, ScrollView, View } from 'react-native';
import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
import { presentSheet } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { DDS } from '../../services/device-detection';
import { presentSheet } from '../../services/event-manager';
import { db } from '../../utils/database';
import { SIZE } from '../../utils/size';
import Heading from '../ui/typography/heading';
@@ -17,8 +17,7 @@ import { Tags } from './tags';
import { Topics } from './topics';
export const Properties = ({ close = () => {}, item, buttons = [], getRef }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const alias = item
? item.type === 'tag'

View File

@@ -2,9 +2,9 @@ import React from 'react';
import { View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useSettingStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { useThemeStore } from '../../stores/theme';
import { useSettingStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';
import { PressableButton } from '../ui/pressable';
@@ -12,8 +12,7 @@ import Paragraph from '../ui/typography/paragraph';
import { useActions } from '../../utils/hooks/use-actions';
export const Items = ({ item, buttons, close }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const dimensions = useSettingStore(state => state.dimensions);
const actions = useActions({ item, close });
const data = actions.filter(i => buttons.indexOf(i.name) > -1 && !i.hidden);

View File

@@ -1,9 +1,9 @@
import React from 'react';
import { ScrollView, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { eSendEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { eSendEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { db } from '../../utils/database';
import { eOnNewTopicAdded, refreshNotesPage } from '../../utils/events';
import { SIZE } from '../../utils/size';
@@ -12,8 +12,7 @@ import { PressableButton } from '../ui/pressable';
import Heading from '../ui/typography/heading';
export default function Notebooks({ note, close }) {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
function getNotebooks(item) {
if (!item.notebooks || item.notebooks.length < 1) return [];

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { useUserStore } from '../../provider/stores';
import { useThemeStore } from '../../stores/theme';
import { useUserStore } from '../../stores/stores';
import { openLinkInBrowser } from '../../utils/functions';
import { SIZE } from '../../utils/size';
import { sleep } from '../../utils/time';
@@ -11,8 +11,7 @@ import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
export const Synced = ({ item, close }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const user = useUserStore(state => state.user);
const lastSynced = useUserStore(state => state.lastSynced);

View File

@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { eSendEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { eSendEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { db } from '../../utils/database';
import { eOpenTagsDialog, refreshNotesPage } from '../../utils/events';
import { SIZE } from '../../utils/size';
@@ -10,8 +10,7 @@ import { sleep } from '../../utils/time';
import { Button } from '../ui/button';
export const Tags = ({ item, close }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
return item.id ? (
<View

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { View } from 'react-native';
import { eSendEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { eSendEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { refreshNotesPage } from '../../utils/events';
import { SIZE } from '../../utils/size';
import { Button } from '../ui/button';

View File

@@ -1,10 +1,10 @@
import React, { useEffect } from 'react';
import { BackHandler, Platform, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useTracked } from '../../provider';
import { useSelectionStore } from '../../provider/stores';
import { eSendEvent, ToastEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { useSelectionStore } from '../../stores/stores';
import { eSendEvent, ToastEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { db } from '../../utils/database';
import { eOpenMoveNoteDialog, refreshNotesPage } from '../../utils/events';
import { deleteItems } from '../../utils/functions';
@@ -17,8 +17,7 @@ import { IconButton } from '../ui/icon-button';
import Heading from '../ui/typography/heading';
export const SelectionHeader = React.memo(({ screen, type, extras }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const selectionMode = useSelectionStore(state => state.selectionMode);
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useRef, useState } from 'react';
import { ActivityIndicator, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../provider';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import { useThemeStore } from '../../stores/theme';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import { editing } from '../../utils';
import { eCloseProgressDialog, eOpenProgressDialog } from '../../utils/events';
import { SIZE } from '../../utils/size';
@@ -16,8 +16,7 @@ import Heading from '../ui/typography/heading';
import Paragraph from '../ui/typography/paragraph';
const SheetProvider = ({ context = 'global' }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [dialogData, setDialogData] = useState(null);
const actionSheetRef = useRef();

View File

@@ -2,10 +2,10 @@ import React, { createRef } from 'react';
import { Keyboard, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import { notesnook } from '../../../../e2e/test.ids';
import { useMenuStore } from '../../../provider/stores';
import { DDS } from '../../../services/DeviceDetection';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useMenuStore } from '../../../stores/stores';
import { DDS } from '../../../services/device-detection';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { eCloseAddNotebookDialog, eOpenAddNotebookDialog } from '../../../utils/events';
import { ph, pv, SIZE } from '../../../utils/size';

View File

@@ -2,10 +2,10 @@ import React, { createRef, useEffect, useState } from 'react';
import { Keyboard, TouchableOpacity, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import { notesnook } from '../../../../e2e/test.ids';
import { useTracked } from '../../../provider';
import { useNotebookStore, useSelectionStore } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { useNotebookStore, useSelectionStore } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { getTotalNotes } from '../../../utils';
import { db } from '../../../utils/database';
import { eOpenMoveNoteDialog } from '../../../utils/events';
@@ -72,8 +72,7 @@ const AddToNotebookSheet = () => {
export default AddToNotebookSheet;
const MoveNoteComponent = ({ close, note, setNote }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const notebooks = useNotebookStore(state => state.notebooks.filter(n => n?.type === 'notebook'));

View File

@@ -4,9 +4,9 @@ import FileViewer from 'react-native-file-viewer';
import Share from 'react-native-share';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../../e2e/test.ids';
import { useTracked } from '../../../provider';
import { ToastEvent } from '../../../services/EventManager';
import Exporter from '../../../services/Exporter';
import { useThemeStore } from '../../../stores/theme';
import { ToastEvent } from '../../../services/event-manager';
import Exporter from '../../../services/exporter';
import { getElevation } from '../../../utils';
import { ph, pv, SIZE } from '../../../utils/size';
import { sleep } from '../../../utils/time';
@@ -18,12 +18,11 @@ import Seperator from '../../ui/seperator';
import Heading from '../../ui/typography/heading';
import Paragraph from '../../ui/typography/paragraph';
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../../services/EventManager');
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../../services/eventmanager');
const { eOpenExportDialog, eCloseExportDialog } = require('../../../utils/events');
const ExportNotesSheet = () => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const actionSheetRef = useRef();

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { View } from 'react-native';
import FileViewer from 'react-native-file-viewer';
import Share from 'react-native-share';
import { ToastEvent } from '../../../services/EventManager';
import { ToastEvent } from '../../../services/event-manager';
import { SIZE } from '../../../utils/size';
import { Button } from '../../ui/button';

View File

@@ -1,10 +1,10 @@
import Clipboard from '@react-native-clipboard/clipboard';
import React, { useRef, useState } from 'react';
import { Linking, Platform, Text, TextInput, View } from 'react-native';
import { useTracked } from '../../../provider';
import { useUserStore } from '../../../provider/stores';
import { eSendEvent, ToastEvent } from '../../../services/EventManager';
import PremiumService from '../../../services/PremiumService';
import { useThemeStore } from '../../../stores/theme';
import { useUserStore } from '../../../stores/stores';
import { eSendEvent, ToastEvent } from '../../../services/event-manager';
import PremiumService from '../../../services/premium';
import { APP_VERSION } from '../../../../version';
import { db } from '../../../utils/database';
import { eCloseProgressDialog } from '../../../utils/events';
@@ -19,8 +19,7 @@ import Paragraph from '../../ui/typography/paragraph';
import deviceInfoModule from 'react-native-device-info';
export const Issue = () => {
const [state, dispatch] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const body = useRef(null);
const title = useRef(null);
const user = useUserStore(state => state.user);

View File

@@ -1,10 +1,10 @@
import React, { useEffect, useRef, useState } from 'react';
import { ScrollView, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../../provider';
import { useTagStore } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { useTagStore } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { eCloseTagsDialog, eOpenTagsDialog } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -15,8 +15,7 @@ import SheetWrapper from '../../ui/sheet';
import Heading from '../../ui/typography/heading';
import Paragraph from '../../ui/typography/paragraph';
const ManageTagsSheet = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const [note, setNote] = useState(null);
const allTags = useTagStore(state => state.tags);
@@ -216,8 +215,7 @@ const ManageTagsSheet = () => {
export default ManageTagsSheet;
const TagItem = ({ tag, note, setNote }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const onPress = async () => {
let prevNote = { ...note };

View File

@@ -2,9 +2,9 @@ import React, { RefObject, useState } from 'react';
import { View } from 'react-native';
import ActionSheet from 'react-native-actions-sheet';
import { FlatList } from 'react-native-gesture-handler';
import { useTracked } from '../../../provider';
import { eSendEvent, presentSheet, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { eSendEvent, presentSheet, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { eCloseProgressDialog } from '../../../utils/events';
import { SIZE } from '../../../utils/size';
@@ -27,8 +27,7 @@ export const MoveNotes = ({
selectedTopic?: any;
fwdRef: RefObject<ActionSheet>;
}) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [currentNotebook, setCurrentNotebook] = useState(notebook);
let notes = db.notes?.all;

View File

@@ -2,10 +2,10 @@ import Clipboard from '@react-native-clipboard/clipboard';
import React, { useEffect, useRef, useState } from 'react';
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useTracked } from '../../../provider';
import { useAttachmentStore } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { useAttachmentStore } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { db } from '../../../utils/database';
import { eClosePublishNoteDialog, eOpenPublishNoteDialog } from '../../../utils/events';
import { openLinkInBrowser } from '../../../utils/functions';
@@ -21,8 +21,7 @@ import Paragraph from '../../ui/typography/paragraph';
let passwordValue = null;
const PublishNoteSheet = () => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [visible, setVisible] = useState(false);
const actionSheetRef = useRef();
const loading = useAttachmentStore(state => state.loading);

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { Linking, Platform, View } from 'react-native';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
import { eCloseRateDialog, eOpenRateDialog } from '../../../utils/events';
import { MMKV } from '../../../utils/database/mmkv';
import { SIZE } from '../../../utils/size';
@@ -10,7 +10,7 @@ import Seperator from '../../ui/seperator';
import Heading from '../../ui/typography/heading';
import Paragraph from '../../ui/typography/paragraph';
import { STORE_LINK } from '../../../utils/constants';
import { clearMessage } from '../../../services/Message';
import { clearMessage } from '../../../services/message';
const RateAppSheet = () => {
const [visible, setVisible] = useState(false);

View File

@@ -6,8 +6,8 @@ import QRCode from 'react-native-qrcode-svg';
import * as ScopedStorage from 'react-native-scoped-storage';
import Share from 'react-native-share';
import { LOGO_BASE64 } from '../../../assets/images/assets';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import { clearMessage } from '../../../services/Message';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import { clearMessage } from '../../../services/message';
import { db } from '../../../utils/database';
import { eOpenRecoveryKeyDialog } from '../../../utils/events';
import { MMKV } from '../../../utils/database/mmkv';

View File

@@ -3,9 +3,9 @@ import { ActivityIndicator, Platform, View } from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import { FlatList } from 'react-native-gesture-handler';
import * as ScopedStorage from 'react-native-scoped-storage';
import { useTracked } from '../../../provider';
import { initialize } from '../../../provider/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
import { useThemeStore } from '../../../stores/theme';
import { initialize } from '../../../stores/stores';
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
import { db } from '../../../utils/database';
import { MMKV } from '../../../utils/database/mmkv';
import storage from '../../../utils/database/storage';
@@ -77,8 +77,7 @@ const RestoreDataSheet = () => {
export default RestoreDataSheet;
const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [files, setFiles] = useState([]);
const [loading, setLoading] = useState(true);
const [backupDirectoryAndroid, setBackupDirectoryAndroid] = useState(false);

View File

@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../../provider';
import { eSendEvent } from '../../../services/EventManager';
import Navigation from '../../../services/Navigation';
import { useThemeStore } from '../../../stores/theme';
import { eSendEvent } from '../../../services/event-manager';
import Navigation from '../../../services/navigation';
import { GROUP, SORT } from '../../../utils/constants';
import { db } from '../../../utils/database';
import { refreshNotesPage } from '../../../utils/events';
@@ -13,8 +13,7 @@ import Seperator from '../../ui/seperator';
import Heading from '../../ui/typography/heading';
const Sort = ({ type, screen }) => {
const [state] = useTracked();
const colors = state.colors;
const colors = useThemeStore(state => state.colors);
const [groupOptions, setGroupOptions] = useState(db.settings.getGroupOptions(type));
const updateGroupOptions = async _groupOptions => {

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { useTracked } from '../../provider';
import { useMenuStore, useNoteStore } from '../../provider/stores';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { useMenuStore, useNoteStore } from '../../stores/stores';
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { COLORS_NOTE } from '../../utils/color-scheme';
import { db } from '../../utils/database';
import { refreshNotesPage } from '../../utils/events';
@@ -32,8 +32,7 @@ export const ColorSection = () => {
const ColorItem = React.memo(
({ item, index, alias }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const setColorNotes = useMenuStore(state => state.setColorNotes);
const [headerTextState, setHeaderTextState] = useState(null);
alias = db.colors.alias(item.id);

View File

@@ -2,12 +2,12 @@ import React, { useCallback } from 'react';
import { FlatList, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { notesnook } from '../../../e2e/test.ids';
import { useTracked } from '../../provider';
import { Actions } from '../../provider/Actions';
import { useSettingStore, useUserStore } from '../../provider/stores';
import { DDS } from '../../services/DeviceDetection';
import { eSendEvent } from '../../services/EventManager';
import SettingsService from '../../services/SettingsService';
import { useThemeStore } from '../../stores/theme';
import { Actions } from '../../stores/Actions';
import { useSettingStore, useUserStore } from '../../stores/stores';
import { DDS } from '../../services/device-detection';
import { eSendEvent } from '../../services/event-manager';
import SettingsService from '../../services/settings';
import {
ACCENT,
COLOR_SCHEME,
@@ -27,8 +27,7 @@ import { UserStatus } from './user-status';
export const SideMenu = React.memo(
() => {
const [state, dispatch] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const deviceMode = useSettingStore(state => state.deviceMode);
const insets = useSafeAreaInsets();
const user = useUserStore(state => state.user);
@@ -36,7 +35,7 @@ export const SideMenu = React.memo(
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
let newColors = setColorScheme(colors, accent);
dispatch({ type: Actions.THEME, colors: newColors });
useThemeStore.getState().setColors({ ...newColors });
}
const BottomItemsList = [

View File

@@ -2,9 +2,9 @@ import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import ToggleSwitch from 'toggle-switch-react-native';
import { useTracked } from '../../provider';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import { useThemeStore } from '../../stores/theme';
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
import Navigation from '../../services/navigation';
import { normalize, SIZE } from '../../utils/size';
import { Button } from '../ui/button';
import { PressableButton } from '../ui/pressable';
@@ -13,8 +13,7 @@ import Paragraph from '../ui/typography/paragraph';
export const MenuItem = React.memo(
({ item, index, testID, rightBtn }) => {
const [state] = useTracked();
const { colors } = state;
const colors = useThemeStore(state => state.colors);
const [headerTextState, setHeaderTextState] = useState(null);
let isFocused = headerTextState?.id === item.name.toLowerCase() + '_navigation';

Some files were not shown because too many files have changed in this diff Show More