mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
refactor
This commit is contained in:
@@ -2,18 +2,17 @@ import React, { useEffect } from 'react';
|
|||||||
import Orientation from 'react-native-orientation';
|
import Orientation from 'react-native-orientation';
|
||||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||||
import Launcher from './src/components/launcher';
|
import Launcher from './src/components/launcher';
|
||||||
import { useTracked } from './src/provider';
|
import { ApplicationHolder } from './src/navigation';
|
||||||
import { initialize, useSettingStore, useUserStore } from './src/provider/stores';
|
import { useThemeStore } from './src/stores/theme';
|
||||||
import { DDS } from './src/services/DeviceDetection';
|
import { initialize, useSettingStore, useUserStore } from './src/stores/stores';
|
||||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from './src/services/EventManager';
|
import { DDS } from './src/services/device-detection';
|
||||||
import Notifications from './src/services/Notifications';
|
import { eSendEvent } from './src/services/event-manager';
|
||||||
import SettingsService from './src/services/SettingsService';
|
import Notifications from './src/services/notifications';
|
||||||
|
import SettingsService from './src/services/settings';
|
||||||
import { TipManager } from './src/services/tip-manager';
|
import { TipManager } from './src/services/tip-manager';
|
||||||
import { db } from './src/utils/database';
|
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 { MMKV } from './src/utils/database/mmkv';
|
||||||
import { ApplicationHolder } from './src/navigation';
|
import { useAppEvents } from './src/utils/hooks/use-app-events';
|
||||||
|
|
||||||
let databaseHasLoaded = false;
|
let databaseHasLoaded = false;
|
||||||
|
|
||||||
@@ -55,14 +54,12 @@ function checkOrientation() {
|
|||||||
|
|
||||||
const loadMainApp = () => {
|
const loadMainApp = () => {
|
||||||
if (databaseHasLoaded) {
|
if (databaseHasLoaded) {
|
||||||
SettingsService.setAppLoaded();
|
|
||||||
eSendEvent('load_overlay');
|
eSendEvent('load_overlay');
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
checkOrientation();
|
checkOrientation();
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const [, dispatch] = useTracked();
|
|
||||||
const setVerifyUser = useUserStore(state => state.setVerifyUser);
|
const setVerifyUser = useUserStore(state => state.setVerifyUser);
|
||||||
const appEvents = useAppEvents();
|
const appEvents = useAppEvents();
|
||||||
|
|
||||||
@@ -85,17 +82,6 @@ const App = () => {
|
|||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const _dispatch = data => {
|
|
||||||
dispatch(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
eSubscribeEvent(eDispatchAction, _dispatch);
|
|
||||||
return () => {
|
|
||||||
eUnSubscribeEvent(eDispatchAction, _dispatch);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaProvider>
|
<SafeAreaProvider>
|
||||||
<ApplicationHolder />
|
<ApplicationHolder />
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
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 'react-native-gesture-handler';
|
||||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||||
import { enableScreens } from 'react-native-screens';
|
import { enableScreens } from 'react-native-screens';
|
||||||
import { name as appName } from './app.json';
|
import { name as appName } from './app.json';
|
||||||
import Notifications from './src/services/Notifications';
|
import Notifications from './src/services/notifications';
|
||||||
global.Buffer = require('buffer').Buffer;
|
global.Buffer = require('buffer').Buffer;
|
||||||
enableScreens(true);
|
enableScreens(true);
|
||||||
UIManager.setLayoutAnimationEnabledExperimental &&
|
UIManager.setLayoutAnimationEnabledExperimental &&
|
||||||
@@ -14,20 +14,14 @@ if (__DEV__) {
|
|||||||
LogBox.ignoreAllLogs();
|
LogBox.ignoreAllLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
let Provider;
|
|
||||||
let App;
|
let App;
|
||||||
let NotesnookShare;
|
let NotesnookShare;
|
||||||
Notifications.init();
|
Notifications.init();
|
||||||
let QuickNoteIOS;
|
let QuickNoteIOS;
|
||||||
|
|
||||||
const AppProvider = () => {
|
const AppProvider = () => {
|
||||||
Provider = require('./src/provider').Provider;
|
|
||||||
App = require('./App').default;
|
App = require('./App').default;
|
||||||
return (
|
return <App />;
|
||||||
<Provider>
|
|
||||||
<App />
|
|
||||||
</Provider>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AppRegistry.registerComponent(appName, () => AppProvider);
|
AppRegistry.registerComponent(appName, () => AppProvider);
|
||||||
|
|||||||
24
apps/mobile/releasenotes.md
Normal file
24
apps/mobile/releasenotes.md
Normal 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!
|
||||||
@@ -25,7 +25,7 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|||||||
import WebView from 'react-native-webview';
|
import WebView from 'react-native-webview';
|
||||||
import ShareExtension from 'rn-extensions-share';
|
import ShareExtension from 'rn-extensions-share';
|
||||||
import isURL from 'validator/lib/isURL';
|
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 { getElevation } from '../src/utils';
|
||||||
import { db } from '../src/utils/database';
|
import { db } from '../src/utils/database';
|
||||||
import Storage from '../src/utils/database/storage';
|
import Storage from '../src/utils/database/storage';
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FlatList, View } from 'react-native';
|
import { FlatList, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useMessageStore, useSelectionStore } from '../../provider/stores';
|
import { useMessageStore, useSelectionStore } from '../../stores/stores';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { allowedOnPlatform, renderItem } from './functions';
|
import { allowedOnPlatform, renderItem } from './functions';
|
||||||
|
|
||||||
export const Announcement = ({ color }) => {
|
export const Announcement = ({ color }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const announcements = useMessageStore(state => state.announcements);
|
const announcements = useMessageStore(state => state.announcements);
|
||||||
const remove = useMessageStore(state => state.remove);
|
const remove = useMessageStore(state => state.remove);
|
||||||
let announcement = announcements.length > 0 ? announcements[0] : null;
|
let announcement = announcements.length > 0 ? announcements[0] : null;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
import { getStyle } from './functions';
|
import { getStyle } from './functions';
|
||||||
|
|
||||||
export const Body = ({ text, style = {} }) => {
|
export const Body = ({ text, style = {} }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paragraph
|
<Paragraph
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSendEvent, presentSheet } from '../../services/EventManager';
|
import { eSendEvent, presentSheet } from '../../services/event-manager';
|
||||||
import { eCloseAnnouncementDialog } from '../../utils/events';
|
import { eCloseAnnouncementDialog } from '../../utils/events';
|
||||||
import { openLinkInBrowser } from '../../utils/functions';
|
import { openLinkInBrowser } from '../../utils/functions';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -13,8 +13,7 @@ import { PricingPlans } from '../premium/pricing-plans';
|
|||||||
import { allowedOnPlatform, getStyle } from './functions';
|
import { allowedOnPlatform, getStyle } from './functions';
|
||||||
|
|
||||||
export const Cta = ({ actions, style = {}, color, inline }) => {
|
export const Cta = ({ actions, style = {}, color, inline }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
let buttons = actions.filter(item => allowedOnPlatform(item.platforms)) || [];
|
let buttons = actions.filter(item => allowedOnPlatform(item.platforms)) || [];
|
||||||
|
|
||||||
const onPress = async item => {
|
const onPress = async item => {
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
import { getStyle } from './functions';
|
import { getStyle } from './functions';
|
||||||
|
|
||||||
export const Description = ({ text, style = {} }) => {
|
export const Description = ({ text, style = {} }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
return (
|
return (
|
||||||
<Paragraph
|
<Paragraph
|
||||||
size={SIZE.md}
|
size={SIZE.md}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { allowedPlatforms } from '../../provider/stores';
|
import { allowedPlatforms } from '../../stores/stores';
|
||||||
import { ProFeatures } from '../dialogs/result/pro-features';
|
import { ProFeatures } from '../dialogs/result/pro-features';
|
||||||
import { Body } from './body';
|
import { Body } from './body';
|
||||||
import { Cta } from './cta';
|
import { Cta } from './cta';
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { FlatList, View } from 'react-native';
|
import { FlatList, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useMessageStore } from '../../provider/stores';
|
import { useMessageStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { eCloseAnnouncementDialog, eOpenAnnouncementDialog } from '../../utils/events';
|
import { eCloseAnnouncementDialog, eOpenAnnouncementDialog } from '../../utils/events';
|
||||||
import BaseDialog from '../dialog/base-dialog';
|
import BaseDialog from '../dialog/base-dialog';
|
||||||
import { allowedOnPlatform, renderItem } from './functions';
|
import { allowedOnPlatform, renderItem } from './functions';
|
||||||
|
|
||||||
export const AnnouncementDialog = () => {
|
export const AnnouncementDialog = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [info, setInfo] = useState(null);
|
const [info, setInfo] = useState(null);
|
||||||
const remove = useMessageStore(state => state.remove);
|
const remove = useMessageStore(state => state.remove);
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
import { getStyle } from './functions';
|
import { getStyle } from './functions';
|
||||||
|
|
||||||
export const List = ({ items, listType, style = {} }) => {
|
export const List = ({ items, listType, style = {} }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
import { getStyle } from './functions';
|
import { getStyle } from './functions';
|
||||||
|
|
||||||
export const SubHeading = ({ text, style = {} }) => {
|
export const SubHeading = ({ text, style = {} }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading
|
<Heading
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
import { getStyle } from './functions';
|
import { getStyle } from './functions';
|
||||||
|
|
||||||
export const Title = ({ text, style = {} }) => {
|
export const Title = ({ text, style = {} }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading
|
<Heading
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { TouchableOpacity, View } from 'react-native';
|
import { TouchableOpacity, View } from 'react-native';
|
||||||
import * as Progress from 'react-native-progress';
|
import * as Progress from 'react-native-progress';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useAttachmentStore } from '../../provider/stores';
|
import { useAttachmentStore } from '../../stores/stores';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import filesystem from '../../utils/filesystem';
|
import filesystem from '../../utils/filesystem';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -29,8 +29,7 @@ function getFileExtension(filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const AttachmentItem = ({ attachment, encryption }) => {
|
export const AttachmentItem = ({ attachment, encryption }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const progress = useAttachmentStore(state => state.progress);
|
const progress = useAttachmentStore(state => state.progress);
|
||||||
const [currentProgress, setCurrentProgress] = useState(
|
const [currentProgress, setCurrentProgress] = useState(
|
||||||
encryption
|
encryption
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eCloseAttachmentDialog, eOpenAttachmentsDialog } from '../../utils/events';
|
import { eCloseAttachmentDialog, eOpenAttachmentsDialog } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -12,8 +12,7 @@ import SheetWrapper from '../ui/sheet';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
import { AttachmentItem } from './attachment-item';
|
import { AttachmentItem } from './attachment-item';
|
||||||
export const AttachmentDialog = () => {
|
export const AttachmentDialog = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [note, setNote] = useState(null);
|
const [note, setNote] = useState(null);
|
||||||
const actionSheetRef = useRef();
|
const actionSheetRef = useRef();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eCloseProgressDialog } from '../../utils/events';
|
import { eCloseProgressDialog } from '../../utils/events';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
@@ -12,8 +12,7 @@ import { Notice } from '../ui/notice';
|
|||||||
import Seperator from '../ui/seperator';
|
import Seperator from '../ui/seperator';
|
||||||
|
|
||||||
export const ChangePassword = () => {
|
export const ChangePassword = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const passwordInputRef = useRef();
|
const passwordInputRef = useRef();
|
||||||
const password = useRef();
|
const password = useRef();
|
||||||
const oldPasswordInputRef = useRef();
|
const oldPasswordInputRef = useRef();
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import ActionSheet from 'react-native-actions-sheet';
|
import ActionSheet from 'react-native-actions-sheet';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { ToastEvent } from '../../services/EventManager';
|
import { ToastEvent } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { MMKV } from '../../utils/database/mmkv';
|
import { MMKV } from '../../utils/database/mmkv';
|
||||||
import { IconButton } from '../ui/icon-button';
|
import { IconButton } from '../ui/icon-button';
|
||||||
@@ -15,8 +15,7 @@ import Heading from '../ui/typography/heading';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const ForgotPassword = () => {
|
export const ForgotPassword = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const email = useRef();
|
const email = useRef();
|
||||||
const emailInputRef = useRef();
|
const emailInputRef = useRef();
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { useTracked } from '../../provider/index';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { eCloseLoginDialog, eOpenLoginDialog } from '../../utils/events';
|
import { eCloseLoginDialog, eOpenLoginDialog } from '../../utils/events';
|
||||||
import { sleep } from '../../utils/time';
|
import { sleep } from '../../utils/time';
|
||||||
import BaseDialog from '../dialog/base-dialog';
|
import BaseDialog from '../dialog/base-dialog';
|
||||||
@@ -16,8 +16,7 @@ export const AuthMode = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Auth = () => {
|
const Auth = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [currentAuthMode, setCurrentAuthMode] = useState(AuthMode.login);
|
const [currentAuthMode, setCurrentAuthMode] = useState(AuthMode.login);
|
||||||
const actionSheetRef = useRef();
|
const actionSheetRef = useRef();
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import React, { useEffect, useRef, useState } from 'react';
|
|||||||
import { Platform, View } from 'react-native';
|
import { Platform, View } from 'react-native';
|
||||||
import { SheetManager } from 'react-native-actions-sheet';
|
import { SheetManager } from 'react-native-actions-sheet';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
|
||||||
import { clearMessage } from '../../services/Message';
|
import { clearMessage } from '../../services/message';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eCloseLoginDialog } from '../../utils/events';
|
import { eCloseLoginDialog } from '../../utils/events';
|
||||||
import { MMKV } from '../../utils/database/mmkv';
|
import { MMKV } from '../../utils/database/mmkv';
|
||||||
@@ -25,8 +25,7 @@ import { SVG } from './background';
|
|||||||
import { ForgotPassword } from './forgot-password';
|
import { ForgotPassword } from './forgot-password';
|
||||||
|
|
||||||
export const Login = ({ changeMode }) => {
|
export const Login = ({ changeMode }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const email = useRef();
|
const email = useRef();
|
||||||
const emailInputRef = useRef();
|
const emailInputRef = useRef();
|
||||||
const passwordInputRef = useRef();
|
const passwordInputRef = useRef();
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { Modal, View } from 'react-native';
|
import { Modal, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import BiometricService from '../../services/BiometricService';
|
import BiometricService from '../../services/biometrics';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
presentSheet,
|
presentSheet,
|
||||||
ToastEvent
|
ToastEvent
|
||||||
} from '../../services/EventManager';
|
} from '../../services/event-manager';
|
||||||
import { clearMessage } from '../../services/Message';
|
import { clearMessage } from '../../services/message';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import Sync from '../../services/Sync';
|
import Sync from '../../services/sync';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { MMKV } from '../../utils/database/mmkv';
|
import { MMKV } from '../../utils/database/mmkv';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -37,8 +37,7 @@ function getEmail(email) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const SessionExpired = () => {
|
export const SessionExpired = () => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const email = useRef();
|
const email = useRef();
|
||||||
const emailInputRef = useRef();
|
const emailInputRef = useRef();
|
||||||
const passwordInputRef = useRef();
|
const passwordInputRef = useRef();
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { Dimensions, Platform, View } from 'react-native';
|
import { Dimensions, Platform, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, ToastEvent } from '../../services/event-manager';
|
||||||
import { clearMessage, setEmailVerifyMessage } from '../../services/Message';
|
import { clearMessage, setEmailVerifyMessage } from '../../services/message';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eCloseLoginDialog } from '../../utils/events';
|
import { eCloseLoginDialog } from '../../utils/events';
|
||||||
import { openLinkInBrowser } from '../../utils/functions';
|
import { openLinkInBrowser } from '../../utils/functions';
|
||||||
@@ -24,8 +24,7 @@ import Paragraph from '../ui/typography/paragraph';
|
|||||||
import { SVG } from './background';
|
import { SVG } from './background';
|
||||||
|
|
||||||
export const Signup = ({ changeMode, welcome, trial }) => {
|
export const Signup = ({ changeMode, welcome, trial }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const email = useRef();
|
const email = useRef();
|
||||||
const emailInputRef = useRef();
|
const emailInputRef = useRef();
|
||||||
const passwordInputRef = useRef();
|
const passwordInputRef = useRef();
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSelectionStore } from '../../provider/stores';
|
import { useSelectionStore } from '../../stores/stores';
|
||||||
|
|
||||||
export const ContainerHeader = ({ children }) => {
|
export const ContainerHeader = ({ children }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const selectionMode = useSelectionStore(state => state.selectionMode);
|
const selectionMode = useSelectionStore(state => state.selectionMode);
|
||||||
|
|
||||||
return !selectionMode ? (
|
return !selectionMode ? (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Animated, { Easing } from 'react-native-reanimated';
|
|||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
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 { editing, getElevation, showTooltip, TOOLTIP_POSITIONS } from '../../utils';
|
||||||
import { normalize, SIZE } from '../../utils/size';
|
import { normalize, SIZE } from '../../utils/size';
|
||||||
import { PressableButton } from '../ui/pressable';
|
import { PressableButton } from '../ui/pressable';
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { KeyboardAvoidingView, Platform, SafeAreaView } from 'react-native';
|
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';
|
import useIsFloatingKeyboard from '../../utils/hooks/use-is-floating-keyboard';
|
||||||
export const Container = ({ children }) => {
|
export const Container = ({ children }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const floating = useIsFloatingKeyboard();
|
const floating = useIsFloatingKeyboard();
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import useIsFloatingKeyboard from '../../utils/hooks/use-is-floating-keyboard';
|
import useIsFloatingKeyboard from '../../utils/hooks/use-is-floating-keyboard';
|
||||||
import { BouncingView } from '../ui/transitions/bouncing-view';
|
import { BouncingView } from '../ui/transitions/bouncing-view';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
@@ -16,8 +16,7 @@ const DialogButtons = ({
|
|||||||
doneText,
|
doneText,
|
||||||
positiveType
|
positiveType
|
||||||
}) => {
|
}) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { getElevation } from '../../utils';
|
import { getElevation } from '../../utils';
|
||||||
|
|
||||||
const DialogContainer = ({ width, height, ...restProps }) => {
|
const DialogContainer = ({ width, height, ...restProps }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
@@ -17,8 +17,7 @@ const DialogHeader = ({
|
|||||||
centered,
|
centered,
|
||||||
titlePart
|
titlePart
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
|
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
|
||||||
|
|
||||||
type DialogInfo = {
|
type DialogInfo = {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { getElevation } from '../../utils';
|
import { getElevation } from '../../utils';
|
||||||
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
|
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/events';
|
||||||
import { sleep } from '../../utils/time';
|
import { sleep } from '../../utils/time';
|
||||||
@@ -14,8 +14,7 @@ import DialogButtons from './dialog-buttons';
|
|||||||
import DialogHeader from './dialog-header';
|
import DialogHeader from './dialog-header';
|
||||||
|
|
||||||
export const Dialog = ({ context = 'global' }) => {
|
export const Dialog = ({ context = 'global' }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [inputValue, setInputValue] = useState(null);
|
const [inputValue, setInputValue] = useState(null);
|
||||||
const inputRef = useRef();
|
const inputRef = useRef();
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import {
|
import {
|
||||||
eCloseActionSheet,
|
eCloseActionSheet,
|
||||||
eCloseAddNotebookDialog,
|
eCloseAddNotebookDialog,
|
||||||
eCloseAddTopicDialog,
|
eCloseAddTopicDialog,
|
||||||
eCloseMoveNoteDialog,
|
eCloseMoveNoteDialog,
|
||||||
eDispatchAction,
|
|
||||||
eOpenActionSheet,
|
eOpenActionSheet,
|
||||||
eOpenAddNotebookDialog,
|
eOpenAddNotebookDialog,
|
||||||
eOpenAddTopicDialog,
|
eOpenAddTopicDialog,
|
||||||
@@ -40,7 +39,3 @@ export const AddTopicEvent = topic => {
|
|||||||
export const HideAddTopicEvent = notebook => {
|
export const HideAddTopicEvent = notebook => {
|
||||||
eSendEvent(eCloseAddTopicDialog, notebook);
|
eSendEvent(eCloseAddTopicDialog, notebook);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateEvent = data => {
|
|
||||||
eSendEvent(eDispatchAction, data);
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { EditorSettings } from '../../screens/editor/EditorSettings';
|
import { EditorSettings } from '../../screens/editor/EditorSettings';
|
||||||
import { AddNotebookSheet } from '../sheets/add-notebook';
|
import { AddNotebookSheet } from '../sheets/add-notebook';
|
||||||
import { AddTopicDialog } from '../dialogs/add-topic';
|
import { AddTopicDialog } from '../dialogs/add-topic';
|
||||||
@@ -24,8 +24,7 @@ import ManageTagsSheet from '../sheets/manage-tags';
|
|||||||
import { VaultDialog } from '../dialogs/vault';
|
import { VaultDialog } from '../dialogs/vault';
|
||||||
|
|
||||||
function DialogProvider() {
|
function DialogProvider() {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { createRef } from 'react';
|
import React, { createRef } from 'react';
|
||||||
import { Keyboard, LayoutAnimation, UIManager, View } from 'react-native';
|
import { Keyboard, LayoutAnimation, UIManager, View } from 'react-native';
|
||||||
import { Transition, Transitioning, TransitioningView } from 'react-native-reanimated';
|
import { Transition, Transitioning, TransitioningView } from 'react-native-reanimated';
|
||||||
import { useMenuStore } from '../../../provider/stores';
|
import { useMenuStore } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eCloseAddTopicDialog, eOpenAddTopicDialog } from '../../../utils/events';
|
import { eCloseAddTopicDialog, eOpenAddTopicDialog } from '../../../utils/events';
|
||||||
import { sleep } from '../../../utils/time';
|
import { sleep } from '../../../utils/time';
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { ScrollView, View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useMessageStore } from '../../../provider/stores';
|
import { useMessageStore } from '../../../stores/stores';
|
||||||
import { DDS } from '../../../services/DeviceDetection';
|
import { DDS } from '../../../services/device-detection';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
|
||||||
import { getElevation } from '../../../utils';
|
import { getElevation } from '../../../utils';
|
||||||
import { eCloseJumpToDialog, eOpenJumpToDialog, eScrollEvent } from '../../../utils/events';
|
import { eCloseJumpToDialog, eOpenJumpToDialog, eScrollEvent } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -14,8 +14,7 @@ import Paragraph from '../../ui/typography/paragraph';
|
|||||||
const offsets = [];
|
const offsets = [];
|
||||||
let timeout = null;
|
let timeout = null;
|
||||||
const JumpToSectionDialog = ({ scrollRef, data, type, screen }) => {
|
const JumpToSectionDialog = ({ scrollRef, data, type, screen }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const notes = data;
|
const notes = data;
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [currentIndex, setCurrentIndex] = useState(null);
|
const [currentIndex, setCurrentIndex] = useState(null);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import {
|
import {
|
||||||
eCloseProgressDialog,
|
eCloseProgressDialog,
|
||||||
eCloseResultDialog,
|
eCloseResultDialog,
|
||||||
@@ -12,8 +12,7 @@ import { SIZE } from '../../../utils/size';
|
|||||||
import { sleep } from '../../../utils/time';
|
import { sleep } from '../../../utils/time';
|
||||||
import Paragraph from '../../ui/typography/paragraph';
|
import Paragraph from '../../ui/typography/paragraph';
|
||||||
export const ProFeatures = ({ count = 6 }) => {
|
export const ProFeatures = ({ count = 6 }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { DDS } from '../../../services/DeviceDetection';
|
import { DDS } from '../../../services/device-detection';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
|
||||||
import { getElevation } from '../../../utils';
|
import { getElevation } from '../../../utils';
|
||||||
import { eCloseResultDialog, eOpenResultDialog } from '../../../utils/events';
|
import { eCloseResultDialog, eOpenResultDialog } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -14,8 +14,7 @@ import Paragraph from '../../ui/typography/paragraph';
|
|||||||
import { ProFeatures } from './pro-features';
|
import { ProFeatures } from './pro-features';
|
||||||
|
|
||||||
const ResultDialog = () => {
|
const ResultDialog = () => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [dialogData, setDialogData] = useState({
|
const [dialogData, setDialogData] = useState({
|
||||||
title: 'Thank you for signing up!',
|
title: 'Thank you for signing up!',
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ import React, { Component, createRef } from 'react';
|
|||||||
import { InteractionManager, View } from 'react-native';
|
import { InteractionManager, View } from 'react-native';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import BiometricService from '../../../services/BiometricService';
|
import BiometricService from '../../../services/biometrics';
|
||||||
import { DDS } from '../../../services/DeviceDetection';
|
import { DDS } from '../../../services/device-detection';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
ToastEvent
|
ToastEvent
|
||||||
} from '../../../services/EventManager';
|
} from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { getElevation, toTXT } from '../../../utils';
|
import { getElevation, toTXT } from '../../../utils';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import {
|
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 => {
|
open = async data => {
|
||||||
if (!Keychain) {
|
if (!Keychain) {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Platform, StyleSheet, View } from 'react-native';
|
import { Platform, StyleSheet, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import SearchService from '../../services/SearchService';
|
import SearchService from '../../services/search';
|
||||||
import { eScrollEvent } from '../../utils/events';
|
import { eScrollEvent } from '../../utils/events';
|
||||||
import { IconButton } from '../ui/icon-button';
|
import { IconButton } from '../ui/icon-button';
|
||||||
import { SearchInput } from '../SearchInput';
|
import { SearchInput } from '../SearchInput';
|
||||||
@@ -13,8 +13,7 @@ import { Title } from './title';
|
|||||||
|
|
||||||
export const Header = React.memo(
|
export const Header = React.memo(
|
||||||
({ root, title, screen, isBack, color, action, rightButtons, notebook }) => {
|
({ root, title, screen, isBack, color, action, rightButtons, notebook }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const [hide, setHide] = useState(true);
|
const [hide, setHide] = useState(true);
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { IconButton } from '../ui/icon-button';
|
import { IconButton } from '../ui/icon-button';
|
||||||
|
|
||||||
export const LeftMenus = ({ currentScreen, headerMenuState }) => {
|
export const LeftMenus = ({ currentScreen, headerMenuState }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const deviceMode = useSettingStore(state => state.deviceMode);
|
const deviceMode = useSettingStore(state => state.deviceMode);
|
||||||
|
|
||||||
const onLeftButtonPress = () => {
|
const onLeftButtonPress = () => {
|
||||||
|
|||||||
@@ -2,16 +2,15 @@ import React, { useRef } from 'react';
|
|||||||
import { StyleSheet, View } from 'react-native';
|
import { StyleSheet, View } from 'react-native';
|
||||||
import Menu from 'react-native-reanimated-material-menu';
|
import Menu from 'react-native-reanimated-material-menu';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { IconButton } from '../ui/icon-button';
|
import { IconButton } from '../ui/icon-button';
|
||||||
|
|
||||||
export const RightMenus = ({ currentScreen, action, rightButtons }) => {
|
export const RightMenus = ({ currentScreen, action, rightButtons }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const deviceMode = useSettingStore(state => state.deviceMode);
|
const deviceMode = useSettingStore(state => state.deviceMode);
|
||||||
const menuRef = useRef();
|
const menuRef = useRef();
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { eOnNewTopicAdded, eScrollEvent } from '../../utils/events';
|
import { eOnNewTopicAdded, eScrollEvent } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const Title = ({ heading, headerColor, screen, notebook }) => {
|
export const Title = ({ heading, headerColor, screen, notebook }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [hide, setHide] = useState(screen === 'Notebook' ? true : false);
|
const [hide, setHide] = useState(screen === 'Notebook' ? true : false);
|
||||||
|
|
||||||
const onScroll = data => {
|
const onScroll = data => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import RNFetchBlob from 'rn-fetch-blob';
|
|||||||
import Storage from '../../utils/database/storage';
|
import Storage from '../../utils/database/storage';
|
||||||
import { IconButton } from '../ui/icon-button';
|
import { IconButton } from '../ui/icon-button';
|
||||||
import BaseDialog from '../dialog/base-dialog';
|
import BaseDialog from '../dialog/base-dialog';
|
||||||
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../services/EventManager');
|
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../services/eventmanager');
|
||||||
|
|
||||||
const ImagePreview = () => {
|
const ImagePreview = () => {
|
||||||
const [visible, setVisible] = useState(false);
|
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
@@ -2,25 +2,25 @@ import React, { useEffect, useRef, useState } from 'react';
|
|||||||
import { NativeModules, Platform, StatusBar, View } from 'react-native';
|
import { NativeModules, Platform, StatusBar, View } from 'react-native';
|
||||||
import RNBootSplash from 'react-native-bootsplash';
|
import RNBootSplash from 'react-native-bootsplash';
|
||||||
import { checkVersion } from 'react-native-check-version';
|
import { checkVersion } from 'react-native-check-version';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import {
|
import {
|
||||||
useFavoriteStore,
|
useFavoriteStore,
|
||||||
useMessageStore,
|
useMessageStore,
|
||||||
useNoteStore,
|
useNoteStore,
|
||||||
useSettingStore,
|
useSettingStore,
|
||||||
useUserStore
|
useUserStore
|
||||||
} from '../../provider/stores';
|
} from '../../stores/stores';
|
||||||
import BiometricService from '../../services/BiometricService';
|
import BiometricService from '../../services/biometrics';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
presentSheet,
|
presentSheet,
|
||||||
ToastEvent
|
ToastEvent
|
||||||
} from '../../services/EventManager';
|
} from '../../services/event-manager';
|
||||||
import { setRateAppMessage } from '../../services/Message';
|
import { setRateAppMessage } from '../../services/message';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { editing } from '../../utils';
|
import { editing } from '../../utils';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eOpenAnnouncementDialog } from '../../utils/events';
|
import { eOpenAnnouncementDialog } from '../../utils/events';
|
||||||
@@ -44,8 +44,7 @@ let passwordValue = null;
|
|||||||
let didVerifyUser = false;
|
let didVerifyUser = false;
|
||||||
|
|
||||||
const Launcher = ({ onLoad }) => {
|
const Launcher = ({ onLoad }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const setNotes = useNoteStore(state => state.setNotes);
|
const setNotes = useNoteStore(state => state.setNotes);
|
||||||
const setFavorites = useFavoriteStore(state => state.setFavorites);
|
const setFavorites = useFavoriteStore(state => state.setFavorites);
|
||||||
const _setLoading = useNoteStore(state => state.setLoading);
|
const _setLoading = useNoteStore(state => state.setLoading);
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useMessageStore, useSelectionStore } from '../../provider/stores';
|
import { useMessageStore, useSelectionStore } from '../../stores/stores';
|
||||||
import { hexToRGBA } from '../../utils/color-scheme/utils';
|
import { hexToRGBA } from '../../utils/color-scheme/utils';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { PressableButton } from '../ui/pressable';
|
import { PressableButton } from '../ui/pressable';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const Card = ({ color }) => {
|
export const Card = ({ color }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
color = color ? color : colors.accent;
|
color = color ? color : colors.accent;
|
||||||
|
|
||||||
const selectionMode = useSelectionStore(state => state.selectionMode);
|
const selectionMode = useSelectionStore(state => state.selectionMode);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, useWindowDimensions, View } from 'react-native';
|
import { ActivityIndicator, useWindowDimensions, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import { useTip } from '../../services/tip-manager';
|
import { useTip } from '../../services/tip-manager';
|
||||||
import { COLORS_NOTE } from '../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../utils/color-scheme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -14,8 +14,7 @@ import Paragraph from '../ui/typography/paragraph';
|
|||||||
|
|
||||||
export const Empty = React.memo(
|
export const Empty = React.memo(
|
||||||
({ loading = true, placeholderData, headerProps, type, screen }) => {
|
({ loading = true, placeholderData, headerProps, type, screen }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const { height } = useWindowDimensions();
|
const { height } = useWindowDimensions();
|
||||||
const introCompleted = useSettingStore(state => state.isIntroCompleted);
|
const introCompleted = useSettingStore(state => state.isIntroCompleted);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { FlatList, RefreshControl, View } from 'react-native';
|
import { FlatList, RefreshControl, View } from 'react-native';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import Sync from '../../services/Sync';
|
import Sync from '../../services/sync';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eScrollEvent } from '../../utils/events';
|
import { eScrollEvent } from '../../utils/events';
|
||||||
import JumpToSectionDialog from '../dialogs/jump-to-section';
|
import JumpToSectionDialog from '../dialogs/jump-to-section';
|
||||||
@@ -60,8 +60,7 @@ const List = ({
|
|||||||
screen,
|
screen,
|
||||||
ListHeader
|
ListHeader
|
||||||
}) => {
|
}) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const scrollRef = useRef();
|
const scrollRef = useRef();
|
||||||
const [_loading, _setLoading] = useState(true);
|
const [_loading, _setLoading] = useState(true);
|
||||||
const syncing = useUserStore(state => state.syncing);
|
const syncing = useUserStore(state => state.syncing);
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useMessageStore } from '../../../provider/stores';
|
import { useMessageStore } from '../../../stores/stores';
|
||||||
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
||||||
import { Announcement } from '../../announcements/announcement';
|
import { Announcement } from '../../announcements/announcement';
|
||||||
import { Card } from '../../list/card';
|
import { Card } from '../../list/card';
|
||||||
|
|
||||||
export const Header = React.memo(
|
export const Header = React.memo(
|
||||||
({ type, messageCard = true, color, shouldShow = false, noAnnouncement }) => {
|
({ type, messageCard = true, color, shouldShow = false, noAnnouncement }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const announcements = useMessageStore(state => state.announcements);
|
const announcements = useMessageStore(state => state.announcements);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useMenuStore } from '../../../provider/stores';
|
import { useMenuStore } from '../../../stores/stores';
|
||||||
import { ToastEvent } from '../../../services/EventManager';
|
import { ToastEvent } from '../../../services/event-manager';
|
||||||
import { getTotalNotes } from '../../../utils';
|
import { getTotalNotes } from '../../../utils';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -11,8 +11,7 @@ import Heading from '../../ui/typography/heading';
|
|||||||
import Paragraph from '../../ui/typography/paragraph';
|
import Paragraph from '../../ui/typography/paragraph';
|
||||||
|
|
||||||
export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
export const NotebookHeader = ({ notebook, onEditNotebook }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [isPinnedToMenu, setIsPinnedToMenu] = useState(db.settings.isPinned(notebook.id));
|
const [isPinnedToMenu, setIsPinnedToMenu] = useState(db.settings.isPinned(notebook.id));
|
||||||
const setMenuPins = useMenuStore(state => state.setMenuPins);
|
const setMenuPins = useMenuStore(state => state.setMenuPins);
|
||||||
const totalNotes = getTotalNotes(notebook);
|
const totalNotes = getTotalNotes(notebook);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { TouchableOpacity, useWindowDimensions, View } from 'react-native';
|
import { TouchableOpacity, useWindowDimensions, View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useSettingStore } from '../../../provider/stores';
|
import { useSettingStore } from '../../../stores/stores';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
presentSheet
|
presentSheet
|
||||||
} from '../../../services/EventManager';
|
} from '../../../services/event-manager';
|
||||||
import SettingsService from '../../../services/SettingsService';
|
import SettingsService from '../../../services/settings';
|
||||||
import { GROUP } from '../../../utils/constants';
|
import { GROUP } from '../../../utils/constants';
|
||||||
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
@@ -20,8 +20,7 @@ import Sort from '../../sheets/sort';
|
|||||||
import Heading from '../../ui/typography/heading';
|
import Heading from '../../ui/typography/heading';
|
||||||
|
|
||||||
export const SectionHeader = ({ item, index, type, color, screen }) => {
|
export const SectionHeader = ({ item, index, type, color, screen }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const { fontScale } = useWindowDimensions();
|
const { fontScale } = useWindowDimensions();
|
||||||
const [groupOptions, setGroupOptions] = useState(db.settings?.getGroupOptions(type));
|
const [groupOptions, setGroupOptions] = useState(db.settings?.getGroupOptions(type));
|
||||||
let groupBy = Object.keys(GROUP).find(key => GROUP[key] === groupOptions.groupBy);
|
let groupBy = Object.keys(GROUP).find(key => GROUP[key] === groupOptions.groupBy);
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import React from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useSettingStore } from '../../../provider/stores';
|
import { useSettingStore } from '../../../stores/stores';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { refreshNotesPage } from '../../../utils/events';
|
import { refreshNotesPage } from '../../../utils/events';
|
||||||
@@ -52,8 +52,7 @@ const showActionSheet = item => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const NoteItem = ({ item, isTrash, tags, dateBy = 'dateCreated', noOpen = false }) => {
|
const NoteItem = ({ item, isTrash, tags, dateBy = 'dateCreated', noOpen = false }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const settings = useSettingStore(state => state.settings);
|
const settings = useSettingStore(state => state.settings);
|
||||||
const compactMode = settings.notesListMode === 'compact';
|
const compactMode = settings.notesListMode === 'compact';
|
||||||
const attachmentCount = db.attachments?.ofNote(item.id, 'all')?.length || 0;
|
const attachmentCount = db.attachments?.ofNote(item.id, 'all')?.length || 0;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import NoteItem from '.';
|
import NoteItem from '.';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useEditorStore, useSelectionStore, useTrashStore } from '../../../provider/stores';
|
import { useEditorStore, useSelectionStore, useTrashStore } from '../../../stores/stores';
|
||||||
import { DDS } from '../../../services/DeviceDetection';
|
import { DDS } from '../../../services/device-detection';
|
||||||
import { eSendEvent, openVault, ToastEvent } from '../../../services/EventManager';
|
import { eSendEvent, openVault, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { history } from '../../../utils';
|
import { history } from '../../../utils';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eOnLoadNote, eShowMergeDialog } from '../../../utils/events';
|
import { eOnLoadNote, eShowMergeDialog } from '../../../utils/events';
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useSettingStore } from '../../../provider/stores';
|
import { useSettingStore } from '../../../stores/stores';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { getTotalNotes, history } from '../../../utils';
|
import { getTotalNotes, history } from '../../../utils';
|
||||||
import { refreshNotesPage } from '../../../utils/events';
|
import { refreshNotesPage } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -16,8 +16,7 @@ import Heading from '../../ui/typography/heading';
|
|||||||
import Paragraph from '../../ui/typography/paragraph';
|
import Paragraph from '../../ui/typography/paragraph';
|
||||||
|
|
||||||
export const NotebookItem = ({ item, isTopic = false, notebookID, isTrash, dateBy }) => {
|
export const NotebookItem = ({ item, isTopic = false, notebookID, isTrash, dateBy }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const settings = useSettingStore(state => state.settings);
|
const settings = useSettingStore(state => state.settings);
|
||||||
const compactMode = settings.notebooksListMode === 'compact';
|
const compactMode = settings.notebooksListMode === 'compact';
|
||||||
const topics = item.topics?.slice(0, 3) || [];
|
const topics = item.topics?.slice(0, 3) || [];
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NotebookItem } from '.';
|
import { NotebookItem } from '.';
|
||||||
import { useSelectionStore } from '../../../provider/stores';
|
import { useSelectionStore } from '../../../stores/stores';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { history } from '../../../utils';
|
import { history } from '../../../utils';
|
||||||
import { eOnNewTopicAdded, refreshNotesPage } from '../../../utils/events';
|
import { eOnNewTopicAdded, refreshNotesPage } from '../../../utils/events';
|
||||||
import SelectionWrapper from '../selection-wrapper';
|
import SelectionWrapper from '../selection-wrapper';
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Clipboard from '@react-native-clipboard/clipboard';
|
import Clipboard from '@react-native-clipboard/clipboard';
|
||||||
import Animated, { useValue } from 'react-native-reanimated';
|
import Animated, { useValue } from 'react-native-reanimated';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import {
|
import {
|
||||||
useMenuStore,
|
useMenuStore,
|
||||||
useNotebookStore,
|
useNotebookStore,
|
||||||
useSelectionStore,
|
useSelectionStore,
|
||||||
useTrashStore
|
useTrashStore
|
||||||
} from '../../../provider/stores';
|
} from '../../../stores/stores';
|
||||||
import { openVault, ToastEvent } from '../../../services/EventManager';
|
import { openVault, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { dWidth, getElevation, toTXT } from '../../../utils';
|
import { dWidth, getElevation, toTXT } from '../../../utils';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { deleteItems } from '../../../utils/functions';
|
import { deleteItems } from '../../../utils/functions';
|
||||||
@@ -19,8 +19,7 @@ import { Button } from '../../ui/button';
|
|||||||
import { presentDialog } from '../../dialog/functions';
|
import { presentDialog } from '../../dialog/functions';
|
||||||
|
|
||||||
export const ActionStrip = ({ note, setActionStrip }) => {
|
export const ActionStrip = ({ note, setActionStrip }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const selectionMode = useSelectionStore(state => state.selectionMode);
|
const selectionMode = useSelectionStore(state => state.selectionMode);
|
||||||
const setNotebooks = useNotebookStore(state => state.setNotebooks);
|
const setNotebooks = useNotebookStore(state => state.setNotebooks);
|
||||||
const setMenuPins = useMenuStore(state => state.setMenuPins);
|
const setMenuPins = useMenuStore(state => state.setMenuPins);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useEditorStore } from '../../../provider/stores';
|
import { useEditorStore } from '../../../stores/stores';
|
||||||
import { hexToRGBA } from '../../../utils/color-scheme/utils';
|
import { hexToRGBA } from '../../../utils/color-scheme/utils';
|
||||||
|
|
||||||
export const Filler = ({ item, background }) => {
|
export const Filler = ({ item, background }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const currentEditingNote = useEditorStore(state => state.currentEditingNote);
|
const currentEditingNote = useEditorStore(state => state.currentEditingNote);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useSettingStore } from '../../../provider/stores';
|
import { useSettingStore } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/event-manager';
|
||||||
import { history } from '../../../utils';
|
import { history } from '../../../utils';
|
||||||
import { PressableButton } from '../../ui/pressable';
|
import { PressableButton } from '../../ui/pressable';
|
||||||
import { ActionStrip } from './action-strip';
|
import { ActionStrip } from './action-strip';
|
||||||
@@ -9,8 +9,7 @@ import { Filler } from './back-fill';
|
|||||||
import { SelectionIcon } from './selection';
|
import { SelectionIcon } from './selection';
|
||||||
|
|
||||||
const SelectionWrapper = ({ children, item, background, onLongPress, onPress, testID }) => {
|
const SelectionWrapper = ({ children, item, background, onLongPress, onPress, testID }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [actionStrip, setActionStrip] = useState(false);
|
const [actionStrip, setActionStrip] = useState(false);
|
||||||
const settings = useSettingStore(state => state.settings);
|
const settings = useSettingStore(state => state.settings);
|
||||||
const listMode = item.type === 'notebook' ? settings.notebooksListMode : settings.notesListMode;
|
const listMode = item.type === 'notebook' ? settings.notebooksListMode : settings.notesListMode;
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { TouchableOpacity, View } from 'react-native';
|
import { TouchableOpacity, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { Actions } from '../../../provider/Actions';
|
import { Actions } from '../../../stores/Actions';
|
||||||
import { useSelectionStore } from '../../../provider/stores';
|
import { useSelectionStore } from '../../../stores/stores';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
|
|
||||||
export const SelectionIcon = ({ setActionStrip, item, compactMode }) => {
|
export const SelectionIcon = ({ setActionStrip, item, compactMode }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const selectionMode = useSelectionStore(state => state.selectionMode);
|
const selectionMode = useSelectionStore(state => state.selectionMode);
|
||||||
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);
|
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React from 'react';
|
|||||||
import { useWindowDimensions, View } from 'react-native';
|
import { useWindowDimensions, View } from 'react-native';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { PressableButton } from '../../ui/pressable';
|
import { PressableButton } from '../../ui/pressable';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { refreshNotesPage } from '../../../utils/events';
|
import { refreshNotesPage } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -15,8 +15,7 @@ import Paragraph from '../../ui/typography/paragraph';
|
|||||||
|
|
||||||
const TagItem = React.memo(
|
const TagItem = React.memo(
|
||||||
({ item, index }) => {
|
({ item, index }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const { fontScale } = useWindowDimensions();
|
const { fontScale } = useWindowDimensions();
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
let params = {
|
let params = {
|
||||||
|
|||||||
@@ -5,16 +5,16 @@ import { Modal, Platform, SafeAreaView, Text, View } from 'react-native';
|
|||||||
import Animated from 'react-native-reanimated';
|
import Animated from 'react-native-reanimated';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import WebView from 'react-native-webview';
|
import WebView from 'react-native-webview';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
ToastEvent
|
ToastEvent
|
||||||
} from '../../services/EventManager';
|
} from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import Sync from '../../services/Sync';
|
import Sync from '../../services/sync';
|
||||||
import { dHeight } from '../../utils';
|
import { dHeight } from '../../utils';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eApplyChanges, eShowMergeDialog, refreshNotesPage } from '../../utils/events';
|
import { eApplyChanges, eShowMergeDialog, refreshNotesPage } from '../../utils/events';
|
||||||
@@ -50,8 +50,7 @@ function onMediaLoaded({ hash, src }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MergeConflicts = () => {
|
const MergeConflicts = () => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [primary, setPrimary] = useState(true);
|
const [primary, setPrimary] = useState(true);
|
||||||
const [secondary, setSecondary] = useState(true);
|
const [secondary, setSecondary] = useState(true);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||||||
import { Text, View } from 'react-native';
|
import { Text, View } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { presentSheet } from '../../services/EventManager';
|
import { presentSheet } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { openLinkInBrowser } from '../../utils/functions';
|
import { openLinkInBrowser } from '../../utils/functions';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -18,8 +18,7 @@ import NotePreview from './preview';
|
|||||||
export default function NoteHistory({ note, ref }) {
|
export default function NoteHistory({ note, ref }) {
|
||||||
const [history, setHistory] = useState([]);
|
const [history, setHistory] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
import { Alert, Platform, View } from 'react-native';
|
import { Alert, Platform, View } from 'react-native';
|
||||||
import WebView from 'react-native-webview';
|
import WebView from 'react-native-webview';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useEditorStore } from '../../provider/stores';
|
import { useEditorStore } from '../../stores/stores';
|
||||||
import { eSendEvent, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, ToastEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eCloseProgressDialog, eOnLoadNote } from '../../utils/events';
|
import { eCloseProgressDialog, eOnLoadNote } from '../../utils/events';
|
||||||
import { openLinkInBrowser } from '../../utils/functions';
|
import { openLinkInBrowser } from '../../utils/functions';
|
||||||
@@ -17,8 +17,7 @@ import DialogHeader from '../dialog/dialog-header';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export default function NotePreview({ session, content }) {
|
export default function NotePreview({ session, content }) {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const webviewRef = useRef();
|
const webviewRef = useRef();
|
||||||
|
|
||||||
const onLoad = async () => {
|
const onLoad = async () => {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { ScrollView, View } from 'react-native';
|
||||||
import { LAUNCH_ROCKET } from '../../assets/images/assets';
|
import { LAUNCH_ROCKET } from '../../assets/images/assets';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent, presentSheet } from '../../services/EventManager';
|
import { eSendEvent, presentSheet } from '../../services/event-manager';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { getElevation } from '../../utils';
|
import { getElevation } from '../../utils';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import {
|
import {
|
||||||
@@ -32,8 +32,7 @@ import { Group } from './group';
|
|||||||
import { PricingPlans } from './pricing-plans';
|
import { PricingPlans } from './pricing-plans';
|
||||||
|
|
||||||
export const Component = ({ close, promo, getRef }) => {
|
export const Component = ({ close, promo, getRef }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const user = useUserStore(state => state.user);
|
const user = useUserStore(state => state.user);
|
||||||
const userCanRequestTrial =
|
const userCanRequestTrial =
|
||||||
user && (!user.subscription || !user.subscription.expiry) ? true : false;
|
user && (!user.subscription || !user.subscription.expiry) ? true : false;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { eOpenPremiumDialog, eOpenResultDialog, eOpenTrialEndingDialog } from '../../utils/events';
|
import { eOpenPremiumDialog, eOpenResultDialog, eOpenTrialEndingDialog } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { sleep } from '../../utils/time';
|
import { sleep } from '../../utils/time';
|
||||||
@@ -16,8 +16,7 @@ import { CompactFeatures } from './compact-features';
|
|||||||
import { Offer } from './offer';
|
import { Offer } from './offer';
|
||||||
|
|
||||||
export const Expiring = () => {
|
export const Expiring = () => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [status, setStatus] = useState({
|
const [status, setStatus] = useState({
|
||||||
title: 'Your trial is ending soon',
|
title: 'Your trial is ending soon',
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, View } from 'react-native';
|
import { Text, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
import { ProTag } from './pro-tag';
|
import { ProTag } from './pro-tag';
|
||||||
|
|
||||||
export const FeatureBlock = ({ vertical, highlight, content, icon, pro, proTagBg }) => {
|
export const FeatureBlock = ({ vertical, highlight, content, icon, pro, proTagBg }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return vertical ? (
|
return vertical ? (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { ScrollView, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
@@ -8,8 +8,7 @@ import { FeatureBlock } from './feature';
|
|||||||
import { ProTag } from './pro-tag';
|
import { ProTag } from './pro-tag';
|
||||||
|
|
||||||
export const Group = ({ item, index }) => {
|
export const Group = ({ item, index }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { createRef } from 'react';
|
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 { eClosePremiumDialog, eOpenPremiumDialog } from '../../utils/events';
|
||||||
import BaseDialog from '../dialog/base-dialog';
|
import BaseDialog from '../dialog/base-dialog';
|
||||||
import { Component } from './component';
|
import { Component } from './component';
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const Offer = ({ off = '30', text = 'on yearly plan, offer ends soon', padding = 0 }) => {
|
export const Offer = ({ off = '30', text = 'on yearly plan, offer ends soon', padding = 0 }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paragraph
|
<Paragraph
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Animated, { Easing } from 'react-native-reanimated';
|
import Animated, { Easing } from 'react-native-reanimated';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { dWidth, editing, getElevation } from '../../utils';
|
import { dWidth, editing, getElevation } from '../../utils';
|
||||||
import { eCloseActionSheet, eOpenPremiumDialog, eShowGetPremium } from '../../utils/events';
|
import { eCloseActionSheet, eOpenPremiumDialog, eShowGetPremium } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -22,8 +22,7 @@ let currentMsg = {
|
|||||||
desc: ''
|
desc: ''
|
||||||
};
|
};
|
||||||
export const PremiumToast = ({ close, context = 'global', offset = 0 }) => {
|
export const PremiumToast = ({ close, context = 'global', offset = 0 }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [msg, setMsg] = useState(currentMsg);
|
const [msg, setMsg] = useState(currentMsg);
|
||||||
|
|
||||||
const open = event => {
|
const open = event => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { getElevation } from '../../utils';
|
import { getElevation } from '../../utils';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { PressableButton } from '../ui/pressable';
|
import { PressableButton } from '../ui/pressable';
|
||||||
@@ -8,8 +8,7 @@ import Heading from '../ui/typography/heading';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const PricingItem = ({ product, onPress, compact }) => {
|
export const PricingItem = ({ product, onPress, compact }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { ActivityIndicator, Platform, Text, View } from 'react-native';
|
import { ActivityIndicator, Platform, Text, View } from 'react-native';
|
||||||
import * as RNIap from 'react-native-iap';
|
import * as RNIap from 'react-native-iap';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
|
||||||
import PremiumService from '../../services/PremiumService';
|
import PremiumService from '../../services/premium';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import {
|
import {
|
||||||
eClosePremiumDialog,
|
eClosePremiumDialog,
|
||||||
@@ -45,8 +45,7 @@ export const PricingPlans = ({
|
|||||||
trial = false,
|
trial = false,
|
||||||
showTrialOption = true
|
showTrialOption = true
|
||||||
}) => {
|
}) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const user = useUserStore(state => state.user);
|
const user = useUserStore(state => state.user);
|
||||||
const [product, setProduct] = useState(null);
|
const [product, setProduct] = useState(null);
|
||||||
const [products, setProducts] = useState([]);
|
const [products, setProducts] = useState([]);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const ProTag = ({ width, size, background }) => {
|
export const ProTag = ({ width, size, background }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React, { useState } from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import { useMenuStore, useSettingStore } from '../../provider/stores';
|
import { useMenuStore, useSettingStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { dWidth } from '../../utils';
|
import { dWidth } from '../../utils';
|
||||||
import { COLORS_NOTE } from '../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../utils/color-scheme';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { timeConverter } from '../../utils/time';
|
import { timeConverter } from '../../utils/time';
|
||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const DateMeta = ({ item }) => {
|
export const DateMeta = ({ item }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const getNameFromKey = key => {
|
const getNameFromKey = key => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import Clipboard from '@react-native-clipboard/clipboard';
|
import Clipboard from '@react-native-clipboard/clipboard';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import { ToastEvent } from '../../services/EventManager';
|
import { ToastEvent } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, ScrollView, View } from 'react-native';
|
import { Platform, ScrollView, View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { presentSheet } from '../../services/EventManager';
|
import { presentSheet } from '../../services/event-manager';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
@@ -17,8 +17,7 @@ import { Tags } from './tags';
|
|||||||
import { Topics } from './topics';
|
import { Topics } from './topics';
|
||||||
|
|
||||||
export const Properties = ({ close = () => {}, item, buttons = [], getRef }) => {
|
export const Properties = ({ close = () => {}, item, buttons = [], getRef }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const alias = item
|
const alias = item
|
||||||
? item.type === 'tag'
|
? item.type === 'tag'
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import { useSettingStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { PressableButton } from '../ui/pressable';
|
import { PressableButton } from '../ui/pressable';
|
||||||
@@ -12,8 +12,7 @@ import Paragraph from '../ui/typography/paragraph';
|
|||||||
import { useActions } from '../../utils/hooks/use-actions';
|
import { useActions } from '../../utils/hooks/use-actions';
|
||||||
|
|
||||||
export const Items = ({ item, buttons, close }) => {
|
export const Items = ({ item, buttons, close }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const dimensions = useSettingStore(state => state.dimensions);
|
const dimensions = useSettingStore(state => state.dimensions);
|
||||||
const actions = useActions({ item, close });
|
const actions = useActions({ item, close });
|
||||||
const data = actions.filter(i => buttons.indexOf(i.name) > -1 && !i.hidden);
|
const data = actions.filter(i => buttons.indexOf(i.name) > -1 && !i.hidden);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { ScrollView, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eOnNewTopicAdded, refreshNotesPage } from '../../utils/events';
|
import { eOnNewTopicAdded, refreshNotesPage } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -12,8 +12,7 @@ import { PressableButton } from '../ui/pressable';
|
|||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
|
|
||||||
export default function Notebooks({ note, close }) {
|
export default function Notebooks({ note, close }) {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
function getNotebooks(item) {
|
function getNotebooks(item) {
|
||||||
if (!item.notebooks || item.notebooks.length < 1) return [];
|
if (!item.notebooks || item.notebooks.length < 1) return [];
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useUserStore } from '../../provider/stores';
|
import { useUserStore } from '../../stores/stores';
|
||||||
import { openLinkInBrowser } from '../../utils/functions';
|
import { openLinkInBrowser } from '../../utils/functions';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { sleep } from '../../utils/time';
|
import { sleep } from '../../utils/time';
|
||||||
@@ -11,8 +11,7 @@ import Heading from '../ui/typography/heading';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
export const Synced = ({ item, close }) => {
|
export const Synced = ({ item, close }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const user = useUserStore(state => state.user);
|
const user = useUserStore(state => state.user);
|
||||||
const lastSynced = useUserStore(state => state.lastSynced);
|
const lastSynced = useUserStore(state => state.lastSynced);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eOpenTagsDialog, refreshNotesPage } from '../../utils/events';
|
import { eOpenTagsDialog, refreshNotesPage } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -10,8 +10,7 @@ import { sleep } from '../../utils/time';
|
|||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
|
|
||||||
export const Tags = ({ item, close }) => {
|
export const Tags = ({ item, close }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
return item.id ? (
|
return item.id ? (
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { refreshNotesPage } from '../../utils/events';
|
import { refreshNotesPage } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { BackHandler, Platform, View } from 'react-native';
|
import { BackHandler, Platform, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useSelectionStore } from '../../provider/stores';
|
import { useSelectionStore } from '../../stores/stores';
|
||||||
import { eSendEvent, ToastEvent } from '../../services/EventManager';
|
import { eSendEvent, ToastEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { eOpenMoveNoteDialog, refreshNotesPage } from '../../utils/events';
|
import { eOpenMoveNoteDialog, refreshNotesPage } from '../../utils/events';
|
||||||
import { deleteItems } from '../../utils/functions';
|
import { deleteItems } from '../../utils/functions';
|
||||||
@@ -17,8 +17,7 @@ import { IconButton } from '../ui/icon-button';
|
|||||||
import Heading from '../ui/typography/heading';
|
import Heading from '../ui/typography/heading';
|
||||||
|
|
||||||
export const SelectionHeader = React.memo(({ screen, type, extras }) => {
|
export const SelectionHeader = React.memo(({ screen, type, extras }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const selectionMode = useSelectionStore(state => state.selectionMode);
|
const selectionMode = useSelectionStore(state => state.selectionMode);
|
||||||
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);
|
const selectedItemsList = useSelectionStore(state => state.selectedItemsList);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { ActivityIndicator, View } from 'react-native';
|
import { ActivityIndicator, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import { editing } from '../../utils';
|
import { editing } from '../../utils';
|
||||||
import { eCloseProgressDialog, eOpenProgressDialog } from '../../utils/events';
|
import { eCloseProgressDialog, eOpenProgressDialog } from '../../utils/events';
|
||||||
import { SIZE } from '../../utils/size';
|
import { SIZE } from '../../utils/size';
|
||||||
@@ -16,8 +16,7 @@ import Heading from '../ui/typography/heading';
|
|||||||
import Paragraph from '../ui/typography/paragraph';
|
import Paragraph from '../ui/typography/paragraph';
|
||||||
|
|
||||||
const SheetProvider = ({ context = 'global' }) => {
|
const SheetProvider = ({ context = 'global' }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [dialogData, setDialogData] = useState(null);
|
const [dialogData, setDialogData] = useState(null);
|
||||||
const actionSheetRef = useRef();
|
const actionSheetRef = useRef();
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React, { createRef } from 'react';
|
|||||||
import { Keyboard, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
import { Keyboard, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useMenuStore } from '../../../provider/stores';
|
import { useMenuStore } from '../../../stores/stores';
|
||||||
import { DDS } from '../../../services/DeviceDetection';
|
import { DDS } from '../../../services/device-detection';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eCloseAddNotebookDialog, eOpenAddNotebookDialog } from '../../../utils/events';
|
import { eCloseAddNotebookDialog, eOpenAddNotebookDialog } from '../../../utils/events';
|
||||||
import { ph, pv, SIZE } from '../../../utils/size';
|
import { ph, pv, SIZE } from '../../../utils/size';
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React, { createRef, useEffect, useState } from 'react';
|
|||||||
import { Keyboard, TouchableOpacity, View } from 'react-native';
|
import { Keyboard, TouchableOpacity, View } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useNotebookStore, useSelectionStore } from '../../../provider/stores';
|
import { useNotebookStore, useSelectionStore } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { getTotalNotes } from '../../../utils';
|
import { getTotalNotes } from '../../../utils';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eOpenMoveNoteDialog } from '../../../utils/events';
|
import { eOpenMoveNoteDialog } from '../../../utils/events';
|
||||||
@@ -72,8 +72,7 @@ const AddToNotebookSheet = () => {
|
|||||||
export default AddToNotebookSheet;
|
export default AddToNotebookSheet;
|
||||||
|
|
||||||
const MoveNoteComponent = ({ close, note, setNote }) => {
|
const MoveNoteComponent = ({ close, note, setNote }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const notebooks = useNotebookStore(state => state.notebooks.filter(n => n?.type === 'notebook'));
|
const notebooks = useNotebookStore(state => state.notebooks.filter(n => n?.type === 'notebook'));
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import FileViewer from 'react-native-file-viewer';
|
|||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { notesnook } from '../../../../e2e/test.ids';
|
import { notesnook } from '../../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { ToastEvent } from '../../../services/EventManager';
|
import { ToastEvent } from '../../../services/event-manager';
|
||||||
import Exporter from '../../../services/Exporter';
|
import Exporter from '../../../services/exporter';
|
||||||
import { getElevation } from '../../../utils';
|
import { getElevation } from '../../../utils';
|
||||||
import { ph, pv, SIZE } from '../../../utils/size';
|
import { ph, pv, SIZE } from '../../../utils/size';
|
||||||
import { sleep } from '../../../utils/time';
|
import { sleep } from '../../../utils/time';
|
||||||
@@ -18,12 +18,11 @@ import Seperator from '../../ui/seperator';
|
|||||||
import Heading from '../../ui/typography/heading';
|
import Heading from '../../ui/typography/heading';
|
||||||
import Paragraph from '../../ui/typography/paragraph';
|
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 { eOpenExportDialog, eCloseExportDialog } = require('../../../utils/events');
|
||||||
|
|
||||||
const ExportNotesSheet = () => {
|
const ExportNotesSheet = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const actionSheetRef = useRef();
|
const actionSheetRef = useRef();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import FileViewer from 'react-native-file-viewer';
|
import FileViewer from 'react-native-file-viewer';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import { ToastEvent } from '../../../services/EventManager';
|
import { ToastEvent } from '../../../services/event-manager';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
import { Button } from '../../ui/button';
|
import { Button } from '../../ui/button';
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import Clipboard from '@react-native-clipboard/clipboard';
|
import Clipboard from '@react-native-clipboard/clipboard';
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { Linking, Platform, Text, TextInput, View } from 'react-native';
|
import { Linking, Platform, Text, TextInput, View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useUserStore } from '../../../provider/stores';
|
import { useUserStore } from '../../../stores/stores';
|
||||||
import { eSendEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSendEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import PremiumService from '../../../services/PremiumService';
|
import PremiumService from '../../../services/premium';
|
||||||
import { APP_VERSION } from '../../../../version';
|
import { APP_VERSION } from '../../../../version';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eCloseProgressDialog } from '../../../utils/events';
|
import { eCloseProgressDialog } from '../../../utils/events';
|
||||||
@@ -19,8 +19,7 @@ import Paragraph from '../../ui/typography/paragraph';
|
|||||||
import deviceInfoModule from 'react-native-device-info';
|
import deviceInfoModule from 'react-native-device-info';
|
||||||
|
|
||||||
export const Issue = () => {
|
export const Issue = () => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const body = useRef(null);
|
const body = useRef(null);
|
||||||
const title = useRef(null);
|
const title = useRef(null);
|
||||||
const user = useUserStore(state => state.user);
|
const user = useUserStore(state => state.user);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { ScrollView, View } from 'react-native';
|
import { ScrollView, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useTagStore } from '../../../provider/stores';
|
import { useTagStore } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eCloseTagsDialog, eOpenTagsDialog } from '../../../utils/events';
|
import { eCloseTagsDialog, eOpenTagsDialog } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -15,8 +15,7 @@ import SheetWrapper from '../../ui/sheet';
|
|||||||
import Heading from '../../ui/typography/heading';
|
import Heading from '../../ui/typography/heading';
|
||||||
import Paragraph from '../../ui/typography/paragraph';
|
import Paragraph from '../../ui/typography/paragraph';
|
||||||
const ManageTagsSheet = () => {
|
const ManageTagsSheet = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const [note, setNote] = useState(null);
|
const [note, setNote] = useState(null);
|
||||||
const allTags = useTagStore(state => state.tags);
|
const allTags = useTagStore(state => state.tags);
|
||||||
@@ -216,8 +215,7 @@ const ManageTagsSheet = () => {
|
|||||||
export default ManageTagsSheet;
|
export default ManageTagsSheet;
|
||||||
|
|
||||||
const TagItem = ({ tag, note, setNote }) => {
|
const TagItem = ({ tag, note, setNote }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
|
|
||||||
const onPress = async () => {
|
const onPress = async () => {
|
||||||
let prevNote = { ...note };
|
let prevNote = { ...note };
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React, { RefObject, useState } from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import ActionSheet from 'react-native-actions-sheet';
|
import ActionSheet from 'react-native-actions-sheet';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { eSendEvent, presentSheet, ToastEvent } from '../../../services/EventManager';
|
import { eSendEvent, presentSheet, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eCloseProgressDialog } from '../../../utils/events';
|
import { eCloseProgressDialog } from '../../../utils/events';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -27,8 +27,7 @@ export const MoveNotes = ({
|
|||||||
selectedTopic?: any;
|
selectedTopic?: any;
|
||||||
fwdRef: RefObject<ActionSheet>;
|
fwdRef: RefObject<ActionSheet>;
|
||||||
}) => {
|
}) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [currentNotebook, setCurrentNotebook] = useState(notebook);
|
const [currentNotebook, setCurrentNotebook] = useState(notebook);
|
||||||
|
|
||||||
let notes = db.notes?.all;
|
let notes = db.notes?.all;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import Clipboard from '@react-native-clipboard/clipboard';
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { useAttachmentStore } from '../../../provider/stores';
|
import { useAttachmentStore } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eClosePublishNoteDialog, eOpenPublishNoteDialog } from '../../../utils/events';
|
import { eClosePublishNoteDialog, eOpenPublishNoteDialog } from '../../../utils/events';
|
||||||
import { openLinkInBrowser } from '../../../utils/functions';
|
import { openLinkInBrowser } from '../../../utils/functions';
|
||||||
@@ -21,8 +21,7 @@ import Paragraph from '../../ui/typography/paragraph';
|
|||||||
|
|
||||||
let passwordValue = null;
|
let passwordValue = null;
|
||||||
const PublishNoteSheet = () => {
|
const PublishNoteSheet = () => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const actionSheetRef = useRef();
|
const actionSheetRef = useRef();
|
||||||
const loading = useAttachmentStore(state => state.loading);
|
const loading = useAttachmentStore(state => state.loading);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { Linking, Platform, View } from 'react-native';
|
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 { eCloseRateDialog, eOpenRateDialog } from '../../../utils/events';
|
||||||
import { MMKV } from '../../../utils/database/mmkv';
|
import { MMKV } from '../../../utils/database/mmkv';
|
||||||
import { SIZE } from '../../../utils/size';
|
import { SIZE } from '../../../utils/size';
|
||||||
@@ -10,7 +10,7 @@ import Seperator from '../../ui/seperator';
|
|||||||
import Heading from '../../ui/typography/heading';
|
import Heading from '../../ui/typography/heading';
|
||||||
import Paragraph from '../../ui/typography/paragraph';
|
import Paragraph from '../../ui/typography/paragraph';
|
||||||
import { STORE_LINK } from '../../../utils/constants';
|
import { STORE_LINK } from '../../../utils/constants';
|
||||||
import { clearMessage } from '../../../services/Message';
|
import { clearMessage } from '../../../services/message';
|
||||||
|
|
||||||
const RateAppSheet = () => {
|
const RateAppSheet = () => {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import QRCode from 'react-native-qrcode-svg';
|
|||||||
import * as ScopedStorage from 'react-native-scoped-storage';
|
import * as ScopedStorage from 'react-native-scoped-storage';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import { LOGO_BASE64 } from '../../../assets/images/assets';
|
import { LOGO_BASE64 } from '../../../assets/images/assets';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import { clearMessage } from '../../../services/Message';
|
import { clearMessage } from '../../../services/message';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { eOpenRecoveryKeyDialog } from '../../../utils/events';
|
import { eOpenRecoveryKeyDialog } from '../../../utils/events';
|
||||||
import { MMKV } from '../../../utils/database/mmkv';
|
import { MMKV } from '../../../utils/database/mmkv';
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { ActivityIndicator, Platform, View } from 'react-native';
|
|||||||
import DocumentPicker from 'react-native-document-picker';
|
import DocumentPicker from 'react-native-document-picker';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList } from 'react-native-gesture-handler';
|
||||||
import * as ScopedStorage from 'react-native-scoped-storage';
|
import * as ScopedStorage from 'react-native-scoped-storage';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { initialize } from '../../../provider/stores';
|
import { initialize } from '../../../stores/stores';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/event-manager';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { MMKV } from '../../../utils/database/mmkv';
|
import { MMKV } from '../../../utils/database/mmkv';
|
||||||
import storage from '../../../utils/database/storage';
|
import storage from '../../../utils/database/storage';
|
||||||
@@ -77,8 +77,7 @@ const RestoreDataSheet = () => {
|
|||||||
export default RestoreDataSheet;
|
export default RestoreDataSheet;
|
||||||
|
|
||||||
const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [files, setFiles] = useState([]);
|
const [files, setFiles] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [backupDirectoryAndroid, setBackupDirectoryAndroid] = useState(false);
|
const [backupDirectoryAndroid, setBackupDirectoryAndroid] = useState(false);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../../provider';
|
import { useThemeStore } from '../../../stores/theme';
|
||||||
import { eSendEvent } from '../../../services/EventManager';
|
import { eSendEvent } from '../../../services/event-manager';
|
||||||
import Navigation from '../../../services/Navigation';
|
import Navigation from '../../../services/navigation';
|
||||||
import { GROUP, SORT } from '../../../utils/constants';
|
import { GROUP, SORT } from '../../../utils/constants';
|
||||||
import { db } from '../../../utils/database';
|
import { db } from '../../../utils/database';
|
||||||
import { refreshNotesPage } from '../../../utils/events';
|
import { refreshNotesPage } from '../../../utils/events';
|
||||||
@@ -13,8 +13,7 @@ import Seperator from '../../ui/seperator';
|
|||||||
import Heading from '../../ui/typography/heading';
|
import Heading from '../../ui/typography/heading';
|
||||||
|
|
||||||
const Sort = ({ type, screen }) => {
|
const Sort = ({ type, screen }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const colors = state.colors;
|
|
||||||
const [groupOptions, setGroupOptions] = useState(db.settings.getGroupOptions(type));
|
const [groupOptions, setGroupOptions] = useState(db.settings.getGroupOptions(type));
|
||||||
|
|
||||||
const updateGroupOptions = async _groupOptions => {
|
const updateGroupOptions = async _groupOptions => {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { useMenuStore, useNoteStore } from '../../provider/stores';
|
import { useMenuStore, useNoteStore } from '../../stores/stores';
|
||||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { COLORS_NOTE } from '../../utils/color-scheme';
|
import { COLORS_NOTE } from '../../utils/color-scheme';
|
||||||
import { db } from '../../utils/database';
|
import { db } from '../../utils/database';
|
||||||
import { refreshNotesPage } from '../../utils/events';
|
import { refreshNotesPage } from '../../utils/events';
|
||||||
@@ -32,8 +32,7 @@ export const ColorSection = () => {
|
|||||||
|
|
||||||
const ColorItem = React.memo(
|
const ColorItem = React.memo(
|
||||||
({ item, index, alias }) => {
|
({ item, index, alias }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const setColorNotes = useMenuStore(state => state.setColorNotes);
|
const setColorNotes = useMenuStore(state => state.setColorNotes);
|
||||||
const [headerTextState, setHeaderTextState] = useState(null);
|
const [headerTextState, setHeaderTextState] = useState(null);
|
||||||
alias = db.colors.alias(item.id);
|
alias = db.colors.alias(item.id);
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import React, { useCallback } from 'react';
|
|||||||
import { FlatList, View } from 'react-native';
|
import { FlatList, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { notesnook } from '../../../e2e/test.ids';
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { Actions } from '../../provider/Actions';
|
import { Actions } from '../../stores/Actions';
|
||||||
import { useSettingStore, useUserStore } from '../../provider/stores';
|
import { useSettingStore, useUserStore } from '../../stores/stores';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/device-detection';
|
||||||
import { eSendEvent } from '../../services/EventManager';
|
import { eSendEvent } from '../../services/event-manager';
|
||||||
import SettingsService from '../../services/SettingsService';
|
import SettingsService from '../../services/settings';
|
||||||
import {
|
import {
|
||||||
ACCENT,
|
ACCENT,
|
||||||
COLOR_SCHEME,
|
COLOR_SCHEME,
|
||||||
@@ -27,8 +27,7 @@ import { UserStatus } from './user-status';
|
|||||||
|
|
||||||
export const SideMenu = React.memo(
|
export const SideMenu = React.memo(
|
||||||
() => {
|
() => {
|
||||||
const [state, dispatch] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const deviceMode = useSettingStore(state => state.deviceMode);
|
const deviceMode = useSettingStore(state => state.deviceMode);
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const user = useUserStore(state => state.user);
|
const user = useUserStore(state => state.user);
|
||||||
@@ -36,7 +35,7 @@ export const SideMenu = React.memo(
|
|||||||
|
|
||||||
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
|
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
|
||||||
let newColors = setColorScheme(colors, accent);
|
let newColors = setColorScheme(colors, accent);
|
||||||
dispatch({ type: Actions.THEME, colors: newColors });
|
useThemeStore.getState().setColors({ ...newColors });
|
||||||
}
|
}
|
||||||
|
|
||||||
const BottomItemsList = [
|
const BottomItemsList = [
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import ToggleSwitch from 'toggle-switch-react-native';
|
import ToggleSwitch from 'toggle-switch-react-native';
|
||||||
import { useTracked } from '../../provider';
|
import { useThemeStore } from '../../stores/theme';
|
||||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/event-manager';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/navigation';
|
||||||
import { normalize, SIZE } from '../../utils/size';
|
import { normalize, SIZE } from '../../utils/size';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { PressableButton } from '../ui/pressable';
|
import { PressableButton } from '../ui/pressable';
|
||||||
@@ -13,8 +13,7 @@ import Paragraph from '../ui/typography/paragraph';
|
|||||||
|
|
||||||
export const MenuItem = React.memo(
|
export const MenuItem = React.memo(
|
||||||
({ item, index, testID, rightBtn }) => {
|
({ item, index, testID, rightBtn }) => {
|
||||||
const [state] = useTracked();
|
const colors = useThemeStore(state => state.colors);
|
||||||
const { colors } = state;
|
|
||||||
const [headerTextState, setHeaderTextState] = useState(null);
|
const [headerTextState, setHeaderTextState] = useState(null);
|
||||||
let isFocused = headerTextState?.id === item.name.toLowerCase() + '_navigation';
|
let isFocused = headerTextState?.id === item.name.toLowerCase() + '_navigation';
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user