mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
refactor
This commit is contained in:
@@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
|
||||
import Orientation from 'react-native-orientation';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
import Launcher from './src/components/launcher';
|
||||
import { RootView } from './src/navigation/RootView';
|
||||
import { useTracked } from './src/provider';
|
||||
import { initialize, useSettingStore, useUserStore } from './src/provider/stores';
|
||||
import { DDS } from './src/services/DeviceDetection';
|
||||
@@ -14,6 +13,7 @@ import { db } from './src/utils/database';
|
||||
import { eDispatchAction } from './src/utils/events';
|
||||
import { useAppEvents } from './src/utils/hooks/use-app-events';
|
||||
import { MMKV } from './src/utils/database/mmkv';
|
||||
import { ApplicationHolder } from './src/navigation';
|
||||
|
||||
let databaseHasLoaded = false;
|
||||
|
||||
@@ -98,7 +98,7 @@ const App = () => {
|
||||
|
||||
return (
|
||||
<SafeAreaProvider>
|
||||
<RootView />
|
||||
<ApplicationHolder />
|
||||
<Launcher onLoad={loadMainApp} />
|
||||
</SafeAreaProvider>
|
||||
);
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useMenuStore, useNoteStore } from '../../provider/stores';
|
||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { COLORS_NOTE } from '../../utils/color-scheme';
|
||||
import { db } from '../../utils/database';
|
||||
import { refreshNotesPage } from '../../utils/events';
|
||||
import { normalize, SIZE } from '../../utils/size';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
|
||||
export const ColorSection = () => {
|
||||
const colorNotes = useMenuStore(state => state.colorNotes);
|
||||
const loading = useNoteStore(state => state.loading);
|
||||
const setColorNotes = useMenuStore(state => state.setColorNotes);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading) {
|
||||
setColorNotes();
|
||||
}
|
||||
}, [loading]);
|
||||
|
||||
return colorNotes.map((item, index) => {
|
||||
let alias = db.colors.alias(item.id);
|
||||
return <ColorItem key={item.id} alias={alias} item={item} index={index} />;
|
||||
});
|
||||
};
|
||||
|
||||
const ColorItem = React.memo(
|
||||
({ item, index, alias }) => {
|
||||
const [state] = useTracked();
|
||||
const { colors } = state;
|
||||
const setColorNotes = useMenuStore(state => state.setColorNotes);
|
||||
const [headerTextState, setHeaderTextState] = useState(null);
|
||||
alias = db.colors.alias(item.id);
|
||||
|
||||
const onHeaderStateChange = event => {
|
||||
setTimeout(() => {
|
||||
if (event.id === item.id) {
|
||||
setHeaderTextState(event);
|
||||
} else {
|
||||
if (headerTextState !== null) {
|
||||
setHeaderTextState(null);
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
eSubscribeEvent('onHeaderStateChange', onHeaderStateChange);
|
||||
return () => {
|
||||
eUnSubscribeEvent('onHeaderStateChange', onHeaderStateChange);
|
||||
};
|
||||
}, [headerTextState]);
|
||||
|
||||
const onPress = item => {
|
||||
let params = {
|
||||
...item,
|
||||
type: 'color',
|
||||
menu: true,
|
||||
get: 'colored'
|
||||
};
|
||||
|
||||
eSendEvent(refreshNotesPage, params);
|
||||
Navigation.navigate('NotesPage', params, {
|
||||
heading: alias.slice(0, 1).toUpperCase() + alias.slice(1),
|
||||
id: item.id,
|
||||
type: 'color'
|
||||
});
|
||||
Navigation.closeDrawer();
|
||||
};
|
||||
|
||||
const onLongPress = () => {
|
||||
presentDialog({
|
||||
title: 'Rename color',
|
||||
input: true,
|
||||
inputPlaceholder: 'Enter name for this color',
|
||||
defaultValue: alias,
|
||||
paragraph: 'You are renaming the color ' + item.title,
|
||||
positivePress: async value => {
|
||||
if (!value || value.trim().length === 0) return;
|
||||
await db.colors.rename(item.id, value);
|
||||
setColorNotes();
|
||||
console.log('color updated');
|
||||
},
|
||||
positiveText: 'Rename'
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<PressableButton
|
||||
customColor={headerTextState?.id === item.id ? 'rgba(0,0,0,0.04)' : 'transparent'}
|
||||
onLongPress={onLongPress}
|
||||
customSelectedColor={COLORS_NOTE[item.title.toLowerCase()]}
|
||||
customAlpha={!colors.night ? -0.02 : 0.02}
|
||||
customOpacity={0.12}
|
||||
onPress={() => onPress(item)}
|
||||
customStyle={{
|
||||
width: '100%',
|
||||
alignSelf: 'center',
|
||||
borderRadius: 5,
|
||||
flexDirection: 'row',
|
||||
paddingHorizontal: 8,
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
height: normalize(50),
|
||||
marginBottom: 5
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center'
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
width: 30,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'flex-start'
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
width: SIZE.lg - 2,
|
||||
height: SIZE.lg - 2,
|
||||
backgroundColor: COLORS_NOTE[item.title.toLowerCase()],
|
||||
borderRadius: 100,
|
||||
justifyContent: 'center',
|
||||
marginRight: 10
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
{headerTextState?.id === item.id ? (
|
||||
<Heading color={colors.heading} size={SIZE.md}>
|
||||
{alias.slice(0, 1).toUpperCase() + alias.slice(1)}
|
||||
</Heading>
|
||||
) : (
|
||||
<Paragraph color={colors.pri} size={SIZE.md}>
|
||||
{alias.slice(0, 1).toUpperCase() + alias.slice(1)}
|
||||
</Paragraph>
|
||||
)}
|
||||
</View>
|
||||
</PressableButton>
|
||||
);
|
||||
},
|
||||
(prev, next) => {
|
||||
if (prev.item?.dateModified !== next.item?.dateModified) return false;
|
||||
if (prev.alias !== next.alias) return false;
|
||||
if (prev.item?.id !== next.item?.id) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
);
|
||||
@@ -1,303 +0,0 @@
|
||||
import { decode, EntityLevel } from 'entities';
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useSettingStore } from '../../provider/stores';
|
||||
import { eSendEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { COLORS_NOTE } from '../../utils/color-scheme';
|
||||
import { db } from '../../utils/database';
|
||||
import { refreshNotesPage } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import { TimeSince } from '../side-menu/TimeSince';
|
||||
import { Properties } from '../properties';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
|
||||
const navigateToTopic = topic => {
|
||||
let routeName = 'NotesPage';
|
||||
let params = { ...topic, menu: false, get: 'topics' };
|
||||
let headerState = {
|
||||
heading: topic.title,
|
||||
id: topic.id,
|
||||
type: topic.type
|
||||
};
|
||||
eSendEvent(refreshNotesPage, params);
|
||||
Navigation.navigate(routeName, params, headerState);
|
||||
};
|
||||
|
||||
function navigateToTag(item) {
|
||||
let _tag = db.tags.tag(item.id);
|
||||
if (!_tag) return;
|
||||
let params = {
|
||||
..._tag,
|
||||
type: 'tag',
|
||||
get: 'tagged'
|
||||
};
|
||||
|
||||
eSendEvent(refreshNotesPage, params);
|
||||
Navigation.navigate('NotesPage', params, {
|
||||
heading: '#' + _tag.title,
|
||||
id: _tag.id,
|
||||
type: _tag.type
|
||||
});
|
||||
}
|
||||
|
||||
const showActionSheet = item => {
|
||||
Properties.present(item);
|
||||
};
|
||||
|
||||
const NoteItem = ({ item, isTrash, tags, dateBy = 'dateCreated', noOpen = false }) => {
|
||||
const [state] = useTracked();
|
||||
const { colors } = state;
|
||||
const settings = useSettingStore(state => state.settings);
|
||||
const compactMode = settings.notesListMode === 'compact';
|
||||
const attachmentCount = db.attachments?.ofNote(item.id, 'all')?.length || 0;
|
||||
|
||||
function getNotebook() {
|
||||
if (isTrash || !item.notebooks || item.notebooks.length < 1) return [];
|
||||
let item_notebook = item.notebooks?.slice(0, 1)[0];
|
||||
let notebook = db.notebooks.notebook(item_notebook.id);
|
||||
|
||||
if (!notebook) return [];
|
||||
let topic = notebook.topics.topic(item_notebook.topics[0])?._topic;
|
||||
|
||||
if (!topic) return [];
|
||||
|
||||
notebook = notebook.data;
|
||||
|
||||
return [
|
||||
{
|
||||
title: `${notebook?.title} › ${topic?.title}`,
|
||||
notebook: notebook,
|
||||
topic: topic
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: 1,
|
||||
flexShrink: 1
|
||||
}}
|
||||
>
|
||||
{!compactMode ? (
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
zIndex: 10,
|
||||
elevation: 10,
|
||||
marginBottom: 2.5
|
||||
}}
|
||||
>
|
||||
{getNotebook().map(_item => (
|
||||
<Button
|
||||
title={_item.title}
|
||||
key={_item}
|
||||
height={20}
|
||||
icon="book-outline"
|
||||
type="grayBg"
|
||||
fontSize={SIZE.xs}
|
||||
iconSize={SIZE.sm}
|
||||
textStyle={{
|
||||
marginRight: 0
|
||||
}}
|
||||
style={{
|
||||
borderRadius: 5,
|
||||
marginRight: 5,
|
||||
borderWidth: 0.5,
|
||||
borderColor: colors.icon,
|
||||
paddingHorizontal: 6
|
||||
}}
|
||||
onPress={() => navigateToTopic(_item.topic)}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
<Heading
|
||||
numberOfLines={1}
|
||||
color={COLORS_NOTE[item.color?.toLowerCase()] || colors.heading}
|
||||
style={{
|
||||
flexWrap: 'wrap'
|
||||
}}
|
||||
size={SIZE.md}
|
||||
>
|
||||
{item.title}
|
||||
</Heading>
|
||||
|
||||
{item.headline && !compactMode ? (
|
||||
<Paragraph
|
||||
style={{
|
||||
flexWrap: 'wrap'
|
||||
}}
|
||||
numberOfLines={2}
|
||||
>
|
||||
{decode(item.headline, {
|
||||
level: EntityLevel.HTML
|
||||
})}
|
||||
</Paragraph>
|
||||
) : null}
|
||||
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-start',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
marginTop: 5,
|
||||
height: SIZE.md + 2
|
||||
}}
|
||||
>
|
||||
{!isTrash ? (
|
||||
<>
|
||||
{item.conflicted ? (
|
||||
<Icon
|
||||
name="alert-circle"
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
size={SIZE.sm}
|
||||
color={colors.red}
|
||||
/>
|
||||
) : null}
|
||||
<TimeSince
|
||||
style={{
|
||||
fontSize: SIZE.xs,
|
||||
color: colors.icon,
|
||||
marginRight: 6
|
||||
}}
|
||||
time={item[dateBy]}
|
||||
updateFrequency={Date.now() - item[dateBy] < 60000 ? 2000 : 60000}
|
||||
/>
|
||||
|
||||
{attachmentCount > 0 ? (
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginRight: 6
|
||||
}}
|
||||
>
|
||||
<Icon name="attachment" size={SIZE.md} color={colors.icon} />
|
||||
<Paragraph color={colors.icon} size={SIZE.xs}>
|
||||
{attachmentCount}
|
||||
</Paragraph>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{item.pinned ? (
|
||||
<Icon
|
||||
testID="icon-pinned"
|
||||
name="pin-outline"
|
||||
size={SIZE.sm}
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
color={COLORS_NOTE[item.color?.toLowerCase()] || colors.accent}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{item.locked ? (
|
||||
<Icon
|
||||
name="lock"
|
||||
size={SIZE.sm}
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
color={colors.icon}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{item.favorite ? (
|
||||
<Icon
|
||||
testID="icon-star"
|
||||
name="star"
|
||||
size={SIZE.md}
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
color="orange"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{!isTrash && !compactMode && tags
|
||||
? tags.map(item =>
|
||||
item.id ? (
|
||||
<Button
|
||||
title={'#' + item.alias}
|
||||
key={item.id}
|
||||
height={23}
|
||||
type="gray"
|
||||
textStyle={{
|
||||
textDecorationLine: 'underline'
|
||||
}}
|
||||
hitSlop={{ top: 8, bottom: 12, left: 0, right: 0 }}
|
||||
fontSize={SIZE.xs}
|
||||
style={{
|
||||
borderRadius: 5,
|
||||
paddingHorizontal: 6,
|
||||
marginRight: 4,
|
||||
zIndex: 10,
|
||||
maxWidth: tags.length > 1 ? 130 : null
|
||||
}}
|
||||
onPress={() => navigateToTag(item)}
|
||||
/>
|
||||
) : null
|
||||
)
|
||||
: null}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Paragraph
|
||||
color={colors.icon}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
>
|
||||
Deleted on{' '}
|
||||
{item && item.dateDeleted
|
||||
? new Date(item.dateDeleted).toISOString().slice(0, 10)
|
||||
: null}
|
||||
</Paragraph>
|
||||
|
||||
<Paragraph
|
||||
color={colors.accent}
|
||||
size={SIZE.xs}
|
||||
style={{
|
||||
marginRight: 6
|
||||
}}
|
||||
>
|
||||
{item.itemType[0].toUpperCase() + item.itemType.slice(1)}
|
||||
</Paragraph>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<IconButton
|
||||
testID={notesnook.listitem.menu}
|
||||
color={colors.pri}
|
||||
name="dots-horizontal"
|
||||
size={SIZE.xl}
|
||||
onPress={() => !noOpen && showActionSheet(item, isTrash)}
|
||||
customStyle={{
|
||||
justifyContent: 'center',
|
||||
height: 35,
|
||||
width: 35,
|
||||
borderRadius: 100,
|
||||
alignItems: 'center'
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default NoteItem;
|
||||
@@ -1,680 +0,0 @@
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Platform } from 'react-native';
|
||||
import Share from 'react-native-share';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useTracked } from '../../provider';
|
||||
import { Actions } from '../../provider/Actions';
|
||||
import {
|
||||
useEditorStore,
|
||||
useMenuStore,
|
||||
useSelectionStore,
|
||||
useTagStore,
|
||||
useUserStore
|
||||
} from '../../provider/stores';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent,
|
||||
openVault,
|
||||
presentSheet,
|
||||
ToastEvent
|
||||
} from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import Notifications from '../../services/Notifications';
|
||||
import SettingsService from '../../services/SettingsService';
|
||||
import { editing, toTXT } from '../../utils';
|
||||
import {
|
||||
ACCENT,
|
||||
COLOR_SCHEME,
|
||||
COLOR_SCHEME_DARK,
|
||||
COLOR_SCHEME_LIGHT,
|
||||
COLOR_SCHEME_PITCH_BLACK,
|
||||
setColorScheme
|
||||
} from '../../utils/color-scheme';
|
||||
import { db } from '../../utils/database';
|
||||
import {
|
||||
eOpenAddNotebookDialog,
|
||||
eOpenAddTopicDialog,
|
||||
eOpenAttachmentsDialog,
|
||||
eOpenExportDialog,
|
||||
eOpenLoginDialog,
|
||||
eOpenMoveNoteDialog,
|
||||
eOpenPublishNoteDialog
|
||||
} from '../../utils/events';
|
||||
import { deleteItems } from '../../utils/functions';
|
||||
import { MMKV } from '../../utils/database/mmkv';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import { MoveNotes } from '../MoveNoteDialog/movenote';
|
||||
import NoteHistory from '../NoteHistory';
|
||||
import tiny from '../../views/Editor/tiny/tiny.js';
|
||||
import { EditorWebView } from '../../views/Editor/Functions';
|
||||
|
||||
export const useActions = ({ close = () => {}, item }) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const { colors } = state;
|
||||
const clearSelection = useSelectionStore(state => state.clearSelection);
|
||||
const setSelectedItem = useSelectionStore(state => state.setSelectedItem);
|
||||
const setMenuPins = useMenuStore(state => state.setMenuPins);
|
||||
const [isPinnedToMenu, setIsPinnedToMenu] = useState(db.settings.isPinned(item.id));
|
||||
console.log(item.readonly, 'readonly');
|
||||
const user = useUserStore(state => state.user);
|
||||
const [notifPinned, setNotifPinned] = useState(null);
|
||||
const alias =
|
||||
item.type === 'tag'
|
||||
? db.tags.alias(item.id)
|
||||
: item.type === 'color'
|
||||
? db.colors.alias(item.id)
|
||||
: item.title;
|
||||
|
||||
const isPublished = item.type === 'note' && db.monographs.isPublished(item.id);
|
||||
const noteInTopic =
|
||||
item.type === 'note' &&
|
||||
editing.actionAfterFirstSave.type === 'topic' &&
|
||||
db.notebooks
|
||||
.notebook(editing.actionAfterFirstSave.notebook)
|
||||
.topics.topic(editing.actionAfterFirstSave.id)
|
||||
.has(item.id);
|
||||
|
||||
useEffect(() => {
|
||||
if (item.id === null) return;
|
||||
checkNotifPinned();
|
||||
if (item.type !== 'note') {
|
||||
setIsPinnedToMenu(db.settings.isPinned(item.id));
|
||||
}
|
||||
}, [item]);
|
||||
|
||||
function checkNotifPinned() {
|
||||
let pinned = Notifications.getPinnedNotes();
|
||||
if (!pinned) {
|
||||
setNotifPinned(null);
|
||||
return;
|
||||
}
|
||||
|
||||
let index = pinned.findIndex(notif => notif.tag === item.id);
|
||||
if (index !== -1) {
|
||||
setNotifPinned(pinned[index]);
|
||||
} else {
|
||||
setNotifPinned(null);
|
||||
}
|
||||
}
|
||||
|
||||
const onUpdate = async type => {
|
||||
if (type === 'unpin') {
|
||||
await sleep(1000);
|
||||
await Notifications.get();
|
||||
checkNotifPinned();
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
eSubscribeEvent('onUpdate', onUpdate);
|
||||
|
||||
return () => {
|
||||
eUnSubscribeEvent('onUpdate', onUpdate);
|
||||
};
|
||||
}, [item]);
|
||||
|
||||
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
|
||||
let newColors = setColorScheme(colors, accent);
|
||||
dispatch({ type: Actions.THEME, colors: newColors });
|
||||
}
|
||||
|
||||
function switchTheme() {
|
||||
if (!colors.night) {
|
||||
MMKV.setStringAsync('theme', JSON.stringify({ night: true }));
|
||||
let nextTheme = SettingsService.get().pitchBlack
|
||||
? COLOR_SCHEME_PITCH_BLACK
|
||||
: COLOR_SCHEME_DARK;
|
||||
changeColorScheme(nextTheme);
|
||||
return;
|
||||
}
|
||||
MMKV.setStringAsync('theme', JSON.stringify({ night: false }));
|
||||
changeColorScheme(COLOR_SCHEME_LIGHT);
|
||||
}
|
||||
|
||||
function addTo() {
|
||||
close();
|
||||
clearSelection(true);
|
||||
setSelectedItem(item);
|
||||
setTimeout(() => {
|
||||
eSendEvent(eOpenMoveNoteDialog, item);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
async function addToFavorites() {
|
||||
if (!item.id) return;
|
||||
close();
|
||||
await db.notes.note(item.id).favorite();
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Favorites,
|
||||
Navigation.routeNames.Notes
|
||||
]);
|
||||
}
|
||||
|
||||
async function pinItem() {
|
||||
if (!item.id) return;
|
||||
close();
|
||||
let type = item.type;
|
||||
if (db[`${type}s`].pinned.length === 3 && !item.pinned) {
|
||||
ToastEvent.show({
|
||||
heading: `Cannot pin more than 3 ${type}s`,
|
||||
type: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
await db[`${type}s`][type](item.id).pin();
|
||||
Navigation.setRoutesToUpdate([Navigation.routeNames.Notebooks, Navigation.routeNames.Notes]);
|
||||
}
|
||||
|
||||
async function pinToNotifications() {
|
||||
if (Platform.OS === 'ios') return;
|
||||
if (notifPinned !== null) {
|
||||
Notifications.remove(item.id, notifPinned.identifier);
|
||||
await sleep(1000);
|
||||
await Notifications.get();
|
||||
checkNotifPinned();
|
||||
return;
|
||||
}
|
||||
if (item.locked) return;
|
||||
Notifications.present({
|
||||
title: item.title,
|
||||
message: item.headline,
|
||||
subtitle: item.headline,
|
||||
bigText: await toTXT(item, true),
|
||||
ongoing: true,
|
||||
actions: ['UNPIN'],
|
||||
tag: item.id
|
||||
});
|
||||
await sleep(1000);
|
||||
await Notifications.get();
|
||||
checkNotifPinned();
|
||||
}
|
||||
|
||||
async function restoreTrashItem() {
|
||||
close();
|
||||
await db.trash.restore(item.id);
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.Tags,
|
||||
Navigation.routeNames.Notes,
|
||||
Navigation.routeNames.Notebooks,
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Favorites,
|
||||
Navigation.routeNames.Trash
|
||||
]);
|
||||
let type = item.type === 'trash' ? item.itemType : item.type;
|
||||
ToastEvent.show({
|
||||
heading: type === 'note' ? 'Note restored from trash' : 'Notebook restored from trash',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
|
||||
async function copyContent() {
|
||||
if (item.locked) {
|
||||
close();
|
||||
await sleep(300);
|
||||
openVault({
|
||||
copyNote: true,
|
||||
novault: true,
|
||||
locked: true,
|
||||
item: item,
|
||||
title: 'Copy note',
|
||||
description: 'Unlock note to copy to clipboard.'
|
||||
});
|
||||
} else {
|
||||
Clipboard.setString(await toTXT(item));
|
||||
ToastEvent.show({
|
||||
heading: 'Note copied to clipboard',
|
||||
type: 'success',
|
||||
context: 'local'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function publishNote() {
|
||||
if (!user) {
|
||||
ToastEvent.show({
|
||||
heading: 'Login required',
|
||||
message: 'Login to publish note',
|
||||
context: 'local',
|
||||
func: () => {
|
||||
eSendEvent(eOpenLoginDialog);
|
||||
},
|
||||
actionText: 'Login'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.isEmailConfirmed) {
|
||||
ToastEvent.show({
|
||||
heading: 'Email is not verified',
|
||||
message: 'Please verify your email first.',
|
||||
context: 'local'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.locked) {
|
||||
ToastEvent.show({
|
||||
heading: 'Locked notes cannot be published',
|
||||
type: 'error',
|
||||
context: 'local'
|
||||
});
|
||||
return;
|
||||
}
|
||||
close();
|
||||
await sleep(300);
|
||||
eSendEvent(eOpenPublishNoteDialog, item);
|
||||
}
|
||||
|
||||
async function addToVault() {
|
||||
if (!item.id) return;
|
||||
if (item.locked) {
|
||||
close();
|
||||
await sleep(300);
|
||||
openVault({
|
||||
item: item,
|
||||
novault: true,
|
||||
locked: true,
|
||||
permanant: true,
|
||||
title: 'Unlock note',
|
||||
description: 'Remove note from the vault.'
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await db.vault.add(item.id);
|
||||
let note = db.notes.note(item.id).data;
|
||||
if (note.locked) {
|
||||
close();
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Favorites,
|
||||
Navigation.routeNames.Notes
|
||||
]);
|
||||
}
|
||||
} catch (e) {
|
||||
close();
|
||||
await sleep(300);
|
||||
switch (e.message) {
|
||||
case db.vault.ERRORS.noVault:
|
||||
openVault({
|
||||
item: item,
|
||||
novault: false,
|
||||
title: 'Create vault',
|
||||
description: 'Set a password to create a vault and lock note.'
|
||||
});
|
||||
break;
|
||||
case db.vault.ERRORS.vaultLocked:
|
||||
openVault({
|
||||
item: item,
|
||||
novault: true,
|
||||
locked: true,
|
||||
title: 'Lock note',
|
||||
description: 'Give access to vault to lock this note.'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function createMenuShortcut() {
|
||||
close();
|
||||
try {
|
||||
if (isPinnedToMenu) {
|
||||
await db.settings.unpin(item.id);
|
||||
return;
|
||||
} else {
|
||||
if (item.type === 'topic') {
|
||||
await db.settings.pin(item.type, {
|
||||
id: item.id,
|
||||
notebookId: item.notebookId
|
||||
});
|
||||
} else {
|
||||
await db.settings.pin(item.type, { id: item.id });
|
||||
}
|
||||
}
|
||||
setIsPinnedToMenu(db.settings.isPinned(item.id));
|
||||
setMenuPins();
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
async function renameTag() {
|
||||
close();
|
||||
await sleep(300);
|
||||
presentDialog({
|
||||
title: 'Rename tag',
|
||||
paragraph: 'Change the title of the tag ' + alias,
|
||||
positivePress: async value => {
|
||||
if (!value || value === '' || value.trimStart().length == 0) return;
|
||||
await db.tags.rename(item.id, db.tags.sanitize(value));
|
||||
useTagStore.getState().setTags();
|
||||
useMenuStore.getState().setMenuPins();
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.Notes,
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Tags
|
||||
]);
|
||||
},
|
||||
input: true,
|
||||
defaultValue: alias,
|
||||
inputPlaceholder: 'Enter title of tag',
|
||||
positiveText: 'Save'
|
||||
});
|
||||
}
|
||||
|
||||
async function shareNote() {
|
||||
if (item.locked) {
|
||||
close();
|
||||
await sleep(300);
|
||||
openVault({
|
||||
item: item,
|
||||
novault: true,
|
||||
locked: true,
|
||||
share: true,
|
||||
title: 'Share note',
|
||||
description: 'Unlock note to share it.'
|
||||
});
|
||||
} else {
|
||||
Share.open({
|
||||
title: 'Share note to',
|
||||
failOnCancel: false,
|
||||
message: await toTXT(item)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteItem() {
|
||||
close();
|
||||
if (item.type === 'tag') {
|
||||
await sleep(300);
|
||||
presentDialog({
|
||||
title: 'Delete tag',
|
||||
paragraph: 'This tag will be removed from all notes.',
|
||||
positivePress: async value => {
|
||||
await db.tags.remove(item.id);
|
||||
useTagStore.getState().setTags();
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.Notes,
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Tags
|
||||
]);
|
||||
},
|
||||
positiveText: 'Delete',
|
||||
positiveType: 'errorShade'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.locked) {
|
||||
await sleep(300);
|
||||
openVault({
|
||||
deleteNote: true,
|
||||
novault: true,
|
||||
locked: true,
|
||||
item: item,
|
||||
title: 'Delete note',
|
||||
description: 'Unlock note to delete it.'
|
||||
});
|
||||
} else {
|
||||
try {
|
||||
close();
|
||||
await deleteItems(item);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
async function removeNoteFromTopic() {
|
||||
await db.notebooks
|
||||
.notebook(editing.actionAfterFirstSave.notebook)
|
||||
.topics.topic(editing.actionAfterFirstSave.id)
|
||||
.delete(item.id);
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.Notebooks,
|
||||
Navigation.routeNames.Notes,
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Notebook
|
||||
]);
|
||||
close();
|
||||
}
|
||||
|
||||
async function deleteTrashItem() {
|
||||
close();
|
||||
await sleep(300);
|
||||
presentDialog({
|
||||
title: `Permanent delete`,
|
||||
paragraph: `Are you sure you want to delete this ${item.itemType} permanantly from trash?`,
|
||||
positiveText: 'Delete',
|
||||
negativeText: 'Cancel',
|
||||
positivePress: async () => {
|
||||
await db.trash.delete(item.id);
|
||||
Navigation.setRoutesToUpdate([Navigation.routeNames.Trash]);
|
||||
useSelectionStore.getState().setSelectionMode(false);
|
||||
ToastEvent.show({
|
||||
heading: 'Permanantly deleted items',
|
||||
type: 'success',
|
||||
context: 'local'
|
||||
});
|
||||
},
|
||||
positiveType: 'errorShade'
|
||||
});
|
||||
}
|
||||
|
||||
async function openHistory() {
|
||||
close();
|
||||
await sleep(300);
|
||||
presentSheet({
|
||||
component: ref => <NoteHistory ref={ref} note={item} />
|
||||
});
|
||||
}
|
||||
|
||||
async function showAttachments() {
|
||||
close();
|
||||
await sleep(300);
|
||||
eSendEvent(eOpenAttachmentsDialog, item);
|
||||
}
|
||||
|
||||
async function exportNote() {
|
||||
close();
|
||||
await sleep(300);
|
||||
eSendEvent(eOpenExportDialog, [item]);
|
||||
}
|
||||
|
||||
const toggleReadyOnlyMode = async () => {
|
||||
await db.notes.note(item.id).readonly();
|
||||
let current = db.notes.note(item.id).data.readonly;
|
||||
if (useEditorStore.getState().currentEditingNote === item.id) {
|
||||
useEditorStore.getState().setReadonly(current);
|
||||
tiny.call(EditorWebView, tiny.toogleReadMode(current ? 'readonly' : 'design'));
|
||||
}
|
||||
Navigation.setRoutesToUpdate([
|
||||
Navigation.routeNames.NotesPage,
|
||||
Navigation.routeNames.Favorites,
|
||||
Navigation.routeNames.Notes
|
||||
]);
|
||||
close();
|
||||
};
|
||||
|
||||
const actions = [
|
||||
{
|
||||
name: 'Add to notebook',
|
||||
title: 'Add to notebook',
|
||||
icon: 'book-outline',
|
||||
func: addTo
|
||||
},
|
||||
{
|
||||
name: 'Move notes',
|
||||
title: 'Add notes',
|
||||
icon: 'plus',
|
||||
func: async () => {
|
||||
close();
|
||||
await sleep(300);
|
||||
MoveNotes.present(db.notebooks.notebook(item.notebookId).data, item);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Pin',
|
||||
title: item.pinned ? 'Unpin' : 'Pin to top',
|
||||
icon: item.pinned ? 'pin-off-outline' : 'pin-outline',
|
||||
func: pinItem,
|
||||
close: false,
|
||||
check: true,
|
||||
on: item.pinned,
|
||||
nopremium: true,
|
||||
id: notesnook.ids.dialogs.actionsheet.pin
|
||||
},
|
||||
{
|
||||
name: 'Favorite',
|
||||
title: !item.favorite ? 'Favorite' : 'Unfavorite',
|
||||
icon: item.favorite ? 'star-off' : 'star-outline',
|
||||
func: addToFavorites,
|
||||
close: false,
|
||||
check: true,
|
||||
on: item.favorite,
|
||||
nopremium: true,
|
||||
id: notesnook.ids.dialogs.actionsheet.favorite,
|
||||
color: 'orange'
|
||||
},
|
||||
{
|
||||
name: 'PinToNotif',
|
||||
title: notifPinned !== null ? 'Unpin from Notifications' : 'Pin to Notifications',
|
||||
icon: 'bell',
|
||||
on: notifPinned !== null,
|
||||
func: pinToNotifications
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Edit Notebook',
|
||||
title: 'Edit notebook',
|
||||
icon: 'square-edit-outline',
|
||||
func: async () => {
|
||||
close();
|
||||
await sleep(300);
|
||||
eSendEvent(eOpenAddNotebookDialog, item);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Edit Topic',
|
||||
title: 'Edit topic',
|
||||
icon: 'square-edit-outline',
|
||||
func: async () => {
|
||||
close();
|
||||
await sleep(300);
|
||||
eSendEvent(eOpenAddTopicDialog, {
|
||||
notebookId: item.notebookId,
|
||||
toEdit: item
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Copy',
|
||||
title: 'Copy',
|
||||
icon: 'content-copy',
|
||||
func: copyContent
|
||||
},
|
||||
{
|
||||
name: 'Restore',
|
||||
title: 'Restore ' + item.itemType,
|
||||
icon: 'delete-restore',
|
||||
func: restoreTrashItem
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Publish',
|
||||
title: isPublished ? 'Published' : 'Publish',
|
||||
icon: 'cloud-upload-outline',
|
||||
on: isPublished,
|
||||
func: publishNote
|
||||
},
|
||||
{
|
||||
name: 'Vault',
|
||||
title: item.locked ? 'Remove from vault' : 'Add to vault',
|
||||
icon: item.locked ? 'shield-off-outline' : 'shield-outline',
|
||||
func: addToVault,
|
||||
on: item.locked
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Add Shortcut',
|
||||
title: isPinnedToMenu ? 'Remove Shortcut' : 'Add Shortcut',
|
||||
icon: isPinnedToMenu ? 'link-variant-remove' : 'link-variant',
|
||||
func: createMenuShortcut,
|
||||
close: false,
|
||||
check: true,
|
||||
on: isPinnedToMenu,
|
||||
nopremium: true,
|
||||
id: notesnook.ids.dialogs.actionsheet.pinMenu
|
||||
},
|
||||
{
|
||||
name: 'Rename Tag',
|
||||
title: 'Rename tag',
|
||||
icon: 'square-edit-outline',
|
||||
func: renameTag
|
||||
},
|
||||
{
|
||||
name: 'Share',
|
||||
title: 'Share',
|
||||
icon: 'share-variant',
|
||||
func: shareNote
|
||||
},
|
||||
{
|
||||
name: 'Attachments',
|
||||
title: 'Attachments',
|
||||
icon: 'attachment',
|
||||
func: showAttachments
|
||||
},
|
||||
{
|
||||
name: 'Export',
|
||||
title: 'Export',
|
||||
icon: 'export',
|
||||
func: exportNote
|
||||
},
|
||||
{
|
||||
name: 'RemoveTopic',
|
||||
title: 'Remove from topic',
|
||||
hidden: !noteInTopic,
|
||||
icon: 'minus-circle-outline',
|
||||
func: removeNoteFromTopic
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
title:
|
||||
item.type !== 'notebook' && item.type !== 'note' ? 'Delete ' + item.type : 'Move to trash',
|
||||
icon: 'delete-outline',
|
||||
type: 'error',
|
||||
func: deleteItem
|
||||
},
|
||||
{
|
||||
name: 'PermDelete',
|
||||
title: 'Delete ' + item.itemType,
|
||||
icon: 'delete',
|
||||
func: deleteTrashItem
|
||||
},
|
||||
{
|
||||
name: 'ReadOnly',
|
||||
title: 'Read only',
|
||||
icon: 'pencil-lock',
|
||||
func: toggleReadyOnlyMode,
|
||||
on: item.readonly
|
||||
},
|
||||
{
|
||||
name: 'History',
|
||||
title: 'History',
|
||||
icon: 'history',
|
||||
func: openHistory
|
||||
},
|
||||
{
|
||||
name: 'Dark Mode',
|
||||
title: 'Dark mode',
|
||||
icon: 'theme-light-dark',
|
||||
func: switchTheme,
|
||||
switch: true,
|
||||
on: colors.night ? true : false,
|
||||
close: false,
|
||||
nopremium: true,
|
||||
id: notesnook.ids.dialogs.actionsheet.night
|
||||
}
|
||||
];
|
||||
|
||||
return actions;
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { eCloseAnnouncementDialog } from '../../utils/events';
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import SettingsBackupAndRestore from '../../views/Settings/backup-restore';
|
||||
import SettingsBackupAndRestore from '../../screens/settings/backup-restore';
|
||||
import { Button } from '../ui/button';
|
||||
import SheetProvider from '../sheet-provider';
|
||||
import { PricingPlans } from '../premium/pricing-plans';
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { allowedPlatforms } from '../../provider/stores';
|
||||
import { ProFeatures } from '../ResultDialog/pro-features';
|
||||
import { ProFeatures } from '../dialogs/result/pro-features';
|
||||
import { Body } from './body';
|
||||
import { Cta } from './cta';
|
||||
import { Description } from './description';
|
||||
@@ -1,27 +1,27 @@
|
||||
import React from 'react';
|
||||
import { useTracked } from '../../provider';
|
||||
import { EditorSettings } from '../../views/Editor/EditorSettings';
|
||||
import { AddNotebookDialog } from '../AddNotebookDialog';
|
||||
import { AddTopicDialog } from '../AddTopicDialog';
|
||||
import { AnnouncementDialog } from '../Announcements';
|
||||
import { AttachmentDialog } from '../AttachmentDialog';
|
||||
import { EditorSettings } from '../../screens/editor/EditorSettings';
|
||||
import { AddNotebookSheet } from '../sheets/add-notebook';
|
||||
import { AddTopicDialog } from '../dialogs/add-topic';
|
||||
import { AnnouncementDialog } from '../announcements';
|
||||
import { AttachmentDialog } from '../attachments';
|
||||
import Auth from '../auth';
|
||||
import { SessionExpired } from '../auth/session-expired';
|
||||
import { Dialog } from '../dialog';
|
||||
import ExportDialog from '../ExportDialog';
|
||||
import ExportNotesSheet from '../sheets/export-notes';
|
||||
import ImagePreview from '../image-preview';
|
||||
import MergeEditor from '../MergeEditor';
|
||||
import MoveNoteDialog from '../MoveNoteDialog';
|
||||
import MergeConflicts from '../merge-conflicts';
|
||||
import AddToNotebookSheet from '../sheets/add-to';
|
||||
import PremiumDialog from '../premium';
|
||||
import { Expiring } from '../premium/expiring';
|
||||
import PublishNoteDialog from '../PublishNoteDialog';
|
||||
import RateDialog from '../RateDialog';
|
||||
import RecoveryKeyDialog from '../RecoveryKeyDialog';
|
||||
import RestoreDialog from '../RestoreDialog';
|
||||
import ResultDialog from '../ResultDialog';
|
||||
import PublishNoteSheet from '../sheets/publish-note';
|
||||
import RateAppSheet from '../sheets/rate-app';
|
||||
import RecoveryKeySheet from '../sheets/recovery-key';
|
||||
import RestoreDataSheet from '../sheets/restore-data';
|
||||
import ResultDialog from '../dialogs/result';
|
||||
import SheetProvider from '../sheet-provider';
|
||||
import TagsDialog from '../TagsDialog';
|
||||
import { VaultDialog } from '../VaultDialog';
|
||||
import ManageTagsSheet from '../sheets/manage-tags';
|
||||
import { VaultDialog } from '../dialogs/vault';
|
||||
|
||||
function DialogProvider() {
|
||||
const [state] = useTracked();
|
||||
@@ -31,22 +31,22 @@ function DialogProvider() {
|
||||
<>
|
||||
<Dialog context="global" />
|
||||
<AddTopicDialog colors={colors} />
|
||||
<AddNotebookDialog colors={colors} />
|
||||
<AddNotebookSheet colors={colors} />
|
||||
<PremiumDialog colors={colors} />
|
||||
<Auth colors={colors} />
|
||||
<MergeEditor />
|
||||
<ExportDialog />
|
||||
<RecoveryKeyDialog colors={colors} />
|
||||
<MergeConflicts />
|
||||
<ExportNotesSheet />
|
||||
<RecoveryKeySheet colors={colors} />
|
||||
<SheetProvider />
|
||||
<RestoreDialog />
|
||||
<RestoreDataSheet />
|
||||
<ResultDialog />
|
||||
<VaultDialog colors={colors} />
|
||||
<MoveNoteDialog colors={colors} />
|
||||
<RateDialog />
|
||||
<AddToNotebookSheet colors={colors} />
|
||||
<RateAppSheet />
|
||||
<ImagePreview />
|
||||
<EditorSettings />
|
||||
<PublishNoteDialog />
|
||||
<TagsDialog />
|
||||
<PublishNoteSheet />
|
||||
<ManageTagsSheet />
|
||||
<AttachmentDialog />
|
||||
<Expiring />
|
||||
<AnnouncementDialog />
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import React, { createRef } from 'react';
|
||||
import { Keyboard, LayoutAnimation, UIManager, View } from 'react-native';
|
||||
import { Transition, Transitioning, TransitioningView } from 'react-native-reanimated';
|
||||
import { useMenuStore } from '../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseAddTopicDialog, eOpenAddTopicDialog } from '../../utils/events';
|
||||
import { sleep } from '../../utils/time';
|
||||
import BaseDialog from '../dialog/base-dialog';
|
||||
import DialogButtons from '../dialog/dialog-buttons';
|
||||
import DialogContainer from '../dialog/dialog-container';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Input from '../ui/input';
|
||||
import Seperator from '../ui/seperator';
|
||||
import { Toast } from '../toast';
|
||||
import { useMenuStore } from '../../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eCloseAddTopicDialog, eOpenAddTopicDialog } from '../../../utils/events';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import BaseDialog from '../../dialog/base-dialog';
|
||||
import DialogButtons from '../../dialog/dialog-buttons';
|
||||
import DialogContainer from '../../dialog/dialog-container';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import Input from '../../ui/input';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import { Toast } from '../../toast';
|
||||
|
||||
export class AddTopicDialog extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -1,21 +1,19 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { ScrollView, View } from 'react-native';
|
||||
import BaseDialog from '../dialog/base-dialog';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import Seperator from '../ui/seperator';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useMessageStore } from '../../provider/stores';
|
||||
import { DDS } from '../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
||||
import { getElevation } from '../../utils';
|
||||
import { eCloseJumpToDialog, eOpenJumpToDialog, eScrollEvent } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useMessageStore } from '../../../provider/stores';
|
||||
import { DDS } from '../../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
||||
import { getElevation } from '../../../utils';
|
||||
import { eCloseJumpToDialog, eOpenJumpToDialog, eScrollEvent } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import BaseDialog from '../../dialog/base-dialog';
|
||||
import { PressableButton } from '../../ui/pressable';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
const offsets = [];
|
||||
let timeout = null;
|
||||
const JumpToDialog = ({ scrollRef, data, type, screen }) => {
|
||||
const JumpToSectionDialog = ({ scrollRef, data, type, screen }) => {
|
||||
const [state] = useTracked();
|
||||
const { colors } = state;
|
||||
const notes = data;
|
||||
@@ -157,4 +155,4 @@ const JumpToDialog = ({ scrollRef, data, type, screen }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default JumpToDialog;
|
||||
export default JumpToSectionDialog;
|
||||
@@ -1,12 +1,16 @@
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { useTracked } from '../../provider';
|
||||
import { eSendEvent } from '../../services/EventManager';
|
||||
import { eCloseProgressDialog, eCloseResultDialog, eOpenPremiumDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { eSendEvent } from '../../../services/EventManager';
|
||||
import {
|
||||
eCloseProgressDialog,
|
||||
eCloseResultDialog,
|
||||
eOpenPremiumDialog
|
||||
} from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
export const ProFeatures = ({ count = 6 }) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const { colors } = state;
|
||||
@@ -1,16 +1,16 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { useTracked } from '../../provider';
|
||||
import { DDS } from '../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
||||
import { getElevation } from '../../utils';
|
||||
import { eCloseResultDialog, eOpenResultDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { Button } from '../ui/button';
|
||||
import BaseDialog from '../dialog/base-dialog';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { DDS } from '../../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
||||
import { getElevation } from '../../../utils';
|
||||
import { eCloseResultDialog, eOpenResultDialog } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { Button } from '../../ui/button';
|
||||
import BaseDialog from '../../dialog/base-dialog';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
import { ProFeatures } from './pro-features';
|
||||
|
||||
const ResultDialog = () => {
|
||||
@@ -2,37 +2,37 @@ import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import React, { Component, createRef } from 'react';
|
||||
import { InteractionManager, View } from 'react-native';
|
||||
import Share from 'react-native-share';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import BiometricService from '../../services/BiometricService';
|
||||
import { DDS } from '../../services/DeviceDetection';
|
||||
import { notesnook } from '../../../../e2e/test.ids';
|
||||
import BiometricService from '../../../services/BiometricService';
|
||||
import { DDS } from '../../../services/DeviceDetection';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent,
|
||||
ToastEvent
|
||||
} from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { getElevation, toTXT } from '../../utils';
|
||||
import { db } from '../../utils/database';
|
||||
} from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { getElevation, toTXT } from '../../../utils';
|
||||
import { db } from '../../../utils/database';
|
||||
import {
|
||||
eClearEditor,
|
||||
eCloseActionSheet,
|
||||
eCloseVaultDialog,
|
||||
eOnLoadNote,
|
||||
eOpenVaultDialog
|
||||
} from '../../utils/events';
|
||||
import { deleteItems } from '../../utils/functions';
|
||||
import { tabBarRef } from '../../utils/global-refs';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { getNote } from '../../views/Editor/Functions';
|
||||
import { Button } from '../ui/button';
|
||||
import BaseDialog from '../dialog/base-dialog';
|
||||
import DialogButtons from '../dialog/dialog-buttons';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Input from '../ui/input';
|
||||
import Seperator from '../ui/seperator';
|
||||
import { Toast } from '../toast';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
} from '../../../utils/events';
|
||||
import { deleteItems } from '../../../utils/functions';
|
||||
import { tabBarRef } from '../../../utils/global-refs';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import { getNote } from '../../../screens/editor/Functions';
|
||||
import { Button } from '../../ui/button';
|
||||
import BaseDialog from '../../dialog/base-dialog';
|
||||
import DialogButtons from '../../dialog/dialog-buttons';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import Input from '../../ui/input';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import { Toast } from '../../toast';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
let Keychain;
|
||||
const passInputRef = createRef();
|
||||
@@ -124,7 +124,7 @@ export class VaultDialog extends Component {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {import('../../services/EventManager').vaultType} data
|
||||
* @param {import('../../../services/EventManager').vaultType} data
|
||||
*/
|
||||
open = async data => {
|
||||
if (!Keychain) {
|
||||
@@ -11,7 +11,7 @@ import umami from '../../utils/analytics';
|
||||
import { MMKV } from '../../utils/database/mmkv';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import AppLock from '../../views/Settings/app-lock';
|
||||
import AppLock from '../../screens/settings/app-lock';
|
||||
import { Button } from '../ui/button';
|
||||
import { SvgView } from '../ui/svg';
|
||||
import { BouncingView } from '../ui/transitions/bouncing-view';
|
||||
|
||||
@@ -28,7 +28,7 @@ import { MMKV } from '../../utils/database/mmkv';
|
||||
import { tabBarRef } from '../../utils/global-refs';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import SettingsBackupAndRestore from '../../views/Settings/backup-restore';
|
||||
import SettingsBackupAndRestore from '../../screens/settings/backup-restore';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import Input from '../ui/input';
|
||||
@@ -38,7 +38,7 @@ import Seperator from '../ui/seperator';
|
||||
import Intro from '../intro';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { Update } from '../update';
|
||||
import { Update } from '../sheets/update';
|
||||
|
||||
let passwordValue = null;
|
||||
let didVerifyUser = false;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { eSendEvent } from '../../services/EventManager';
|
||||
import Sync from '../../services/Sync';
|
||||
import { db } from '../../utils/database';
|
||||
import { eScrollEvent } from '../../utils/events';
|
||||
import JumpToDialog from '../JumpToDialog';
|
||||
import JumpToSectionDialog from '../dialogs/jump-to-section';
|
||||
import { NotebookWrapper } from '../list-items/notebook/wrapper';
|
||||
import { NoteWrapper } from '../list-items/note/wrapper';
|
||||
import TagItem from '../list-items/tag';
|
||||
@@ -176,7 +176,7 @@ const List = ({
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<JumpToDialog
|
||||
<JumpToSectionDialog
|
||||
screen={screen}
|
||||
data={listData}
|
||||
type={screen === 'Notes' ? 'home' : type}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { View } from 'react-native';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useMessageStore } from '../../../provider/stores';
|
||||
import { COLORS_NOTE } from '../../../utils/color-scheme';
|
||||
import { Announcement } from '../../Announcements/announcement';
|
||||
import { Announcement } from '../../announcements/announcement';
|
||||
import { Card } from '../../list/card';
|
||||
|
||||
export const Header = React.memo(
|
||||
|
||||
@@ -16,7 +16,7 @@ import { eOpenJumpToDialog } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { IconButton } from '../../ui/icon-button';
|
||||
import { Button } from '../../ui/button';
|
||||
import Sort from '../../sort';
|
||||
import Sort from '../../sheets/sort';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
|
||||
export const SectionHeader = ({ item, index, type, color, screen }) => {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { eApplyChanges, eShowMergeDialog, refreshNotesPage } from '../../utils/e
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { normalize, SIZE } from '../../utils/size';
|
||||
import { timeConverter } from '../../utils/time';
|
||||
import { getNote, sourceUri, updateNoteInEditor } from '../../views/Editor/Functions';
|
||||
import { getNote, sourceUri, updateNoteInEditor } from '../../screens/editor/Functions';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import BaseDialog from '../dialog/base-dialog';
|
||||
@@ -49,7 +49,7 @@ function onMediaLoaded({ hash, src }) {
|
||||
secondaryWebView.current?.injectJavaScript(inject);
|
||||
}
|
||||
|
||||
const MergeEditor = () => {
|
||||
const MergeConflicts = () => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const { colors } = state;
|
||||
const [visible, setVisible] = useState(false);
|
||||
@@ -574,4 +574,4 @@ const MergeEditor = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default MergeEditor;
|
||||
export default MergeConflicts;
|
||||
@@ -9,8 +9,8 @@ import { db } from '../../utils/database';
|
||||
import { eCloseProgressDialog, eOnLoadNote } from '../../utils/events';
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { normalize } from '../../utils/size';
|
||||
import { getNote, sourceUri } from '../../views/Editor/Functions';
|
||||
import tiny from '../../views/Editor/tiny/tiny';
|
||||
import { getNote, sourceUri } from '../../screens/editor/Functions';
|
||||
import tiny from '../../screens/editor/tiny/tiny';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
@@ -8,8 +8,8 @@ import { dWidth, editing, getElevation } from '../../utils';
|
||||
import { eCloseActionSheet, eOpenPremiumDialog, eShowGetPremium } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { EditorWebView } from '../../views/Editor/Functions';
|
||||
import tiny from '../../views/Editor/tiny/tiny';
|
||||
import { EditorWebView } from '../../screens/editor/Functions';
|
||||
import tiny from '../../screens/editor/tiny/tiny';
|
||||
import { Button } from '../ui/button';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
|
||||
@@ -7,9 +7,9 @@ import { editing } from '../../utils';
|
||||
import { eCloseProgressDialog, eOpenProgressDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { EditorWebView } from '../../views/Editor/Functions';
|
||||
import tiny from '../../views/Editor/tiny/tiny';
|
||||
import { reFocusEditor } from '../../views/Editor/tiny/toolbar/constants';
|
||||
import { EditorWebView } from '../../screens/editor/Functions';
|
||||
import tiny from '../../screens/editor/tiny/tiny';
|
||||
import { reFocusEditor } from '../../screens/editor/tiny/toolbar/constants';
|
||||
import { Button } from '../ui/button';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import Heading from '../ui/typography/heading';
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import React, { createRef } from 'react';
|
||||
import { Keyboard, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { FlatList } from 'react-native-gesture-handler';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useMenuStore } from '../../provider/stores';
|
||||
import { DDS } from '../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseAddNotebookDialog, eOpenAddNotebookDialog } from '../../utils/events';
|
||||
import { ph, pv, SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Input from '../ui/input';
|
||||
import { MoveNotes } from '../MoveNoteDialog/movenote';
|
||||
import Seperator from '../ui/seperator';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import { Toast } from '../toast';
|
||||
import { notesnook } from '../../../../e2e/test.ids';
|
||||
import { useMenuStore } from '../../../provider/stores';
|
||||
import { DDS } from '../../../services/DeviceDetection';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eCloseAddNotebookDialog, eOpenAddNotebookDialog } from '../../../utils/events';
|
||||
import { ph, pv, SIZE } from '../../../utils/size';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import { IconButton } from '../../ui/icon-button';
|
||||
import { Button } from '../../ui/button';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import Input from '../../ui/input';
|
||||
import { MoveNotes } from '../move-notes/movenote';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import { Toast } from '../../toast';
|
||||
|
||||
let refs = [];
|
||||
|
||||
export class AddNotebookDialog extends React.Component {
|
||||
export class AddNotebookSheet extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -1,31 +1,31 @@
|
||||
import React, { createRef, useEffect, useState } from 'react';
|
||||
import { Keyboard, TouchableOpacity, View } from 'react-native';
|
||||
import { FlatList } from 'react-native-gesture-handler';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useNotebookStore, useSelectionStore } from '../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { getTotalNotes } from '../../utils';
|
||||
import { db } from '../../utils/database';
|
||||
import { eOpenMoveNoteDialog } from '../../utils/events';
|
||||
import layoutmanager from '../../utils/layout-manager';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import { Dialog } from '../dialog';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import Input from '../ui/input';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { notesnook } from '../../../../e2e/test.ids';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useNotebookStore, useSelectionStore } from '../../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { getTotalNotes } from '../../../utils';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eOpenMoveNoteDialog } from '../../../utils/events';
|
||||
import layoutmanager from '../../../utils/layout-manager';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { IconButton } from '../../ui/icon-button';
|
||||
import { Button } from '../../ui/button';
|
||||
import { Dialog } from '../../dialog';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { presentDialog } from '../../dialog/functions';
|
||||
import Input from '../../ui/input';
|
||||
import { PressableButton } from '../../ui/pressable';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
let newNotebookTitle = null;
|
||||
const notebookInput = createRef();
|
||||
const actionSheetRef = createRef();
|
||||
const MoveNoteDialog = () => {
|
||||
const AddToNotebookSheet = () => {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [note, setNote] = useState(null);
|
||||
|
||||
@@ -69,7 +69,7 @@ const MoveNoteDialog = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default MoveNoteDialog;
|
||||
export default AddToNotebookSheet;
|
||||
|
||||
const MoveNoteComponent = ({ close, note, setNote }) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
@@ -3,25 +3,25 @@ import { Platform, StyleSheet, View } from 'react-native';
|
||||
import FileViewer from 'react-native-file-viewer';
|
||||
import Share from 'react-native-share';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useTracked } from '../../provider';
|
||||
import { ToastEvent } from '../../services/EventManager';
|
||||
import Exporter from '../../services/Exporter';
|
||||
import { getElevation } from '../../utils';
|
||||
import { ph, pv, SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { notesnook } from '../../../../e2e/test.ids';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { ToastEvent } from '../../../services/EventManager';
|
||||
import Exporter from '../../../services/Exporter';
|
||||
import { getElevation } from '../../../utils';
|
||||
import { ph, pv, SIZE } from '../../../utils/size';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import { Button } from '../../ui/button';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { PressableButton } from '../../ui/pressable';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../services/EventManager');
|
||||
const { eOpenExportDialog, eCloseExportDialog } = require('../../utils/events');
|
||||
const { eSubscribeEvent, eUnSubscribeEvent } = require('../../../services/EventManager');
|
||||
const { eOpenExportDialog, eCloseExportDialog } = require('../../../utils/events');
|
||||
|
||||
const ExportDialog = () => {
|
||||
const ExportNotesSheet = () => {
|
||||
const [state] = useTracked();
|
||||
const { colors } = state;
|
||||
|
||||
@@ -294,4 +294,4 @@ const styles = StyleSheet.create({
|
||||
}
|
||||
});
|
||||
|
||||
export default ExportDialog;
|
||||
export default ExportNotesSheet;
|
||||
@@ -2,9 +2,9 @@ import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import FileViewer from 'react-native-file-viewer';
|
||||
import Share from 'react-native-share';
|
||||
import { ToastEvent } from '../../services/EventManager';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { Button } from '../ui/button';
|
||||
import { ToastEvent } from '../../../services/EventManager';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { Button } from '../../ui/button';
|
||||
|
||||
export const ShareComponent = ({ uri, name, padding }) => {
|
||||
return (
|
||||
@@ -1,21 +1,21 @@
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { Linking, Platform, Text, TextInput, View } from 'react-native';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useUserStore } from '../../provider/stores';
|
||||
import { eSendEvent, ToastEvent } from '../../services/EventManager';
|
||||
import PremiumService from '../../services/PremiumService';
|
||||
import { APP_VERSION } from '../../../version';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseProgressDialog } from '../../utils/events';
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useUserStore } from '../../../provider/stores';
|
||||
import { eSendEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import PremiumService from '../../../services/PremiumService';
|
||||
import { APP_VERSION } from '../../../../version';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eCloseProgressDialog } from '../../../utils/events';
|
||||
import { openLinkInBrowser } from '../../../utils/functions';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import { Button } from '../../ui/button';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { presentDialog } from '../../dialog/functions';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
import deviceInfoModule from 'react-native-device-info';
|
||||
|
||||
export const Issue = () => {
|
||||
@@ -1,20 +1,20 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { ScrollView, View } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { useTracked } from '../../provider';
|
||||
import { useTagStore } from '../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseTagsDialog, eOpenTagsDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { sleep } from '../../utils/time';
|
||||
import Input from '../ui/input';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
const TagsDialog = () => {
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useTagStore } from '../../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eCloseTagsDialog, eOpenTagsDialog } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import Input from '../../ui/input';
|
||||
import { PressableButton } from '../../ui/pressable';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
const ManageTagsSheet = () => {
|
||||
const [state] = useTracked();
|
||||
const colors = state.colors;
|
||||
const [visible, setVisible] = useState(false);
|
||||
@@ -213,7 +213,7 @@ const TagsDialog = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default TagsDialog;
|
||||
export default ManageTagsSheet;
|
||||
|
||||
const TagItem = ({ tag, note, setNote }) => {
|
||||
const [state] = useTracked();
|
||||
@@ -2,21 +2,21 @@ import React, { RefObject, useState } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ActionSheet from 'react-native-actions-sheet';
|
||||
import { FlatList } from 'react-native-gesture-handler';
|
||||
import { useTracked } from '../../provider';
|
||||
import { eSendEvent, presentSheet, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseProgressDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import { Button } from '../ui/button';
|
||||
import { Dialog } from '../dialog';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import { PressableButton } from '../ui/pressable';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { eSendEvent, presentSheet, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eCloseProgressDialog } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { IconButton } from '../../ui/icon-button';
|
||||
import { Button } from '../../ui/button';
|
||||
import { Dialog } from '../../dialog';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { presentDialog } from '../../dialog/functions';
|
||||
import { PressableButton } from '../../ui/pressable';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
export const MoveNotes = ({
|
||||
notebook,
|
||||
@@ -1,27 +1,26 @@
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import { useTracked } from '../../provider';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { db } from '../../utils/database';
|
||||
import { eClosePublishNoteDialog, eOpenPublishNoteDialog } from '../../utils/events';
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { IconButton } from '../ui/icon-button';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Input from '../ui/input';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { useAttachmentStore } from '../../provider/stores';
|
||||
import { editing } from '../../utils';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { useAttachmentStore } from '../../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eClosePublishNoteDialog, eOpenPublishNoteDialog } from '../../../utils/events';
|
||||
import { openLinkInBrowser } from '../../../utils/functions';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { Button } from '../../ui/button';
|
||||
import { IconButton } from '../../ui/icon-button';
|
||||
import Input from '../../ui/input';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
let passwordValue = null;
|
||||
const PublishNoteDialog = () => {
|
||||
const PublishNoteSheet = () => {
|
||||
const [state] = useTracked();
|
||||
const colors = state.colors;
|
||||
const [visible, setVisible] = useState(false);
|
||||
@@ -358,4 +357,4 @@ const PublishNoteDialog = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default PublishNoteDialog;
|
||||
export default PublishNoteSheet;
|
||||
@@ -1,18 +1,18 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { Linking, Platform, View } from 'react-native';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
|
||||
import { eCloseRateDialog, eOpenRateDialog } from '../../utils/events';
|
||||
import { MMKV } from '../../utils/database/mmkv';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import { Button } from '../ui/button';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { STORE_LINK } from '../../utils/constants';
|
||||
import { clearMessage } from '../../services/Message';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent } from '../../../services/EventManager';
|
||||
import { eCloseRateDialog, eOpenRateDialog } from '../../../utils/events';
|
||||
import { MMKV } from '../../../utils/database/mmkv';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import { Button } from '../../ui/button';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
import { STORE_LINK } from '../../../utils/constants';
|
||||
import { clearMessage } from '../../../services/Message';
|
||||
|
||||
const RateDialog = () => {
|
||||
const RateAppSheet = () => {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const actionSheetRef = useRef();
|
||||
|
||||
@@ -125,4 +125,4 @@ const RateDialog = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default RateDialog;
|
||||
export default RateAppSheet;
|
||||
@@ -5,25 +5,25 @@ import FileViewer from 'react-native-file-viewer';
|
||||
import QRCode from 'react-native-qrcode-svg';
|
||||
import * as ScopedStorage from 'react-native-scoped-storage';
|
||||
import Share from 'react-native-share';
|
||||
import { LOGO_BASE64 } from '../../assets/images/assets';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import { clearMessage } from '../../services/Message';
|
||||
import { db } from '../../utils/database';
|
||||
import { eOpenRecoveryKeyDialog } from '../../utils/events';
|
||||
import { MMKV } from '../../utils/database/mmkv';
|
||||
import { sanitizeFilename } from '../../utils/sanitizer';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import Storage from '../../utils/database/storage';
|
||||
import { sleep } from '../../utils/time';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Seperator from '../ui/seperator';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import { LOGO_BASE64 } from '../../../assets/images/assets';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import { clearMessage } from '../../../services/Message';
|
||||
import { db } from '../../../utils/database';
|
||||
import { eOpenRecoveryKeyDialog } from '../../../utils/events';
|
||||
import { MMKV } from '../../../utils/database/mmkv';
|
||||
import { sanitizeFilename } from '../../../utils/sanitizer';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import Storage from '../../../utils/database/storage';
|
||||
import { sleep } from '../../../utils/time';
|
||||
import { Button } from '../../ui/button';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
let RNFetchBlob;
|
||||
|
||||
class RecoveryKeyDialog extends React.Component {
|
||||
class RecoveryKeySheet extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -325,4 +325,4 @@ class RecoveryKeyDialog extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default RecoveryKeyDialog;
|
||||
export default RecoveryKeySheet;
|
||||
@@ -2,29 +2,28 @@ import React, { createRef, useEffect, useState } from 'react';
|
||||
import { ActivityIndicator, Platform, View } from 'react-native';
|
||||
import DocumentPicker from 'react-native-document-picker';
|
||||
import { FlatList } from 'react-native-gesture-handler';
|
||||
import { useTracked } from '../../provider';
|
||||
import { initialize } from '../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../services/EventManager';
|
||||
import { db } from '../../utils/database';
|
||||
import { eCloseRestoreDialog, eOpenRestoreDialog } from '../../utils/events';
|
||||
import { MMKV } from '../../utils/database/mmkv';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import storage from '../../utils/database/storage';
|
||||
import { sleep, timeConverter } from '../../utils/time';
|
||||
import SheetWrapper from '../ui/sheet';
|
||||
import { Button } from '../ui/button';
|
||||
import DialogHeader from '../dialog/dialog-header';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Paragraph from '../ui/typography/paragraph';
|
||||
import * as ScopedStorage from 'react-native-scoped-storage';
|
||||
import { Dialog } from '../dialog';
|
||||
import { verifyUser } from '../../views/Settings/functions';
|
||||
import { presentDialog } from '../dialog/functions';
|
||||
import { Toast } from '../toast';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { initialize } from '../../../provider/stores';
|
||||
import { eSubscribeEvent, eUnSubscribeEvent, ToastEvent } from '../../../services/EventManager';
|
||||
import { db } from '../../../utils/database';
|
||||
import { MMKV } from '../../../utils/database/mmkv';
|
||||
import storage from '../../../utils/database/storage';
|
||||
import { eCloseRestoreDialog, eOpenRestoreDialog } from '../../../utils/events';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { sleep, timeConverter } from '../../../utils/time';
|
||||
import { Dialog } from '../../dialog';
|
||||
import DialogHeader from '../../dialog/dialog-header';
|
||||
import { presentDialog } from '../../dialog/functions';
|
||||
import { Toast } from '../../toast';
|
||||
import { Button } from '../../ui/button';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import SheetWrapper from '../../ui/sheet';
|
||||
import Paragraph from '../../ui/typography/paragraph';
|
||||
|
||||
const actionSheetRef = createRef();
|
||||
let RNFetchBlob;
|
||||
const RestoreDialog = () => {
|
||||
const RestoreDataSheet = () => {
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [restoring, setRestoring] = useState(false);
|
||||
useEffect(() => {
|
||||
@@ -75,7 +74,7 @@ const RestoreDialog = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default RestoreDialog;
|
||||
export default RestoreDataSheet;
|
||||
|
||||
const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
@@ -1,16 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { useTracked } from '../../provider';
|
||||
import { eSendEvent } from '../../services/EventManager';
|
||||
import Navigation from '../../services/Navigation';
|
||||
import { GROUP, SORT } from '../../utils/constants';
|
||||
import { db } from '../../utils/database';
|
||||
import { refreshNotesPage } from '../../utils/events';
|
||||
import layoutmanager from '../../utils/layout-manager';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import { Button } from '../ui/button';
|
||||
import Seperator from '../ui/seperator';
|
||||
import Heading from '../ui/typography/heading';
|
||||
import { useTracked } from '../../../provider';
|
||||
import { eSendEvent } from '../../../services/EventManager';
|
||||
import Navigation from '../../../services/Navigation';
|
||||
import { GROUP, SORT } from '../../../utils/constants';
|
||||
import { db } from '../../../utils/database';
|
||||
import { refreshNotesPage } from '../../../utils/events';
|
||||
import layoutmanager from '../../../utils/layout-manager';
|
||||
import { SIZE } from '../../../utils/size';
|
||||
import { Button } from '../../ui/button';
|
||||
import Seperator from '../../ui/seperator';
|
||||
import Heading from '../../ui/typography/heading';
|
||||
|
||||
const Sort = ({ type, screen }) => {
|
||||
const [state] = useTracked();
|
||||
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@ import { getElevation } from '../../utils';
|
||||
import { eOpenAddNotebookDialog } from '../../utils/events';
|
||||
import { SIZE } from '../../utils/size';
|
||||
import useRotator from '../../utils/hooks/use-rotator';
|
||||
import { AccentColorPicker } from '../../views/Settings/appearance';
|
||||
import { AccentColorPicker } from '../../screens/settings/appearance';
|
||||
import { Button } from '../ui/button';
|
||||
import { SvgView } from '../ui/svg';
|
||||
import { PinItem } from '../side-menu/pinned-section';
|
||||
|
||||
17
apps/mobile/src/navigation/index.js
Normal file
17
apps/mobile/src/navigation/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { TabsHolder } from './tabs-holder';
|
||||
import DialogProvider from '../components/dialog-provider';
|
||||
import { Toast } from '../components/toast';
|
||||
|
||||
export const ApplicationHolder = React.memo(
|
||||
() => {
|
||||
return (
|
||||
<>
|
||||
<TabsHolder />
|
||||
<Toast />
|
||||
<DialogProvider />
|
||||
</>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
);
|
||||
@@ -10,18 +10,18 @@ import { history } from '../utils';
|
||||
import { hideAllTooltips } from '../utils/hooks/use-tooltip';
|
||||
import { MMKV } from '../utils/database/mmkv';
|
||||
import { rootNavigatorRef } from '../utils/global-refs';
|
||||
import Favorites from '../views/Favorites';
|
||||
import Folders from '../views/Folders';
|
||||
import Home from '../views/Home';
|
||||
import Notebook from '../views/Notebook';
|
||||
import Notes from '../views/Notes';
|
||||
import { Search } from '../views/Search';
|
||||
import Settings from '../views/Settings';
|
||||
import Tags from '../views/Tags';
|
||||
import Trash from '../views/Trash';
|
||||
import Favorites from '../screens/favorites';
|
||||
import Notebooks from '../screens/notebooks';
|
||||
import Home from '../screens/home';
|
||||
import Notebook from '../screens/notebook';
|
||||
import Notes from '../screens/notes';
|
||||
import { Search } from '../screens/search';
|
||||
import Settings from '../screens/settings';
|
||||
import Tags from '../screens/tags';
|
||||
import Trash from '../screens/trash';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
export const NavigatorStack = React.memo(
|
||||
export const NavigationStack = React.memo(
|
||||
() => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const { colors } = state;
|
||||
@@ -78,7 +78,7 @@ export const NavigatorStack = React.memo(
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="Notes" component={Home} />
|
||||
<Stack.Screen name="Notebooks" component={Folders} />
|
||||
<Stack.Screen name="Notebooks" component={Notebooks} />
|
||||
<Stack.Screen name="Favorites" component={Favorites} />
|
||||
<Stack.Screen name="Trash" component={Trash} />
|
||||
<Stack.Screen name="NotesPage" component={Notes} />
|
||||
@@ -5,12 +5,13 @@ import { StatusBar } from 'react-native-bars';
|
||||
import Animated, { useValue } from 'react-native-reanimated';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { notesnook } from '../../e2e/test.ids';
|
||||
import Tabs from '../components/tabs';
|
||||
import DialogProvider from '../components/dialog-provider';
|
||||
import { SideMenu } from '../components/side-menu';
|
||||
import { Toast } from '../components/toast';
|
||||
import Tabs from '../components/tabs';
|
||||
import { useTracked } from '../provider';
|
||||
import { useEditorStore, useSettingStore } from '../provider/stores';
|
||||
import { EditorWrapper } from '../screens/editor/EditorWrapper';
|
||||
import { checkStatus, EditorWebView, getNote } from '../screens/editor/Functions';
|
||||
import tiny from '../screens/editor/tiny/tiny';
|
||||
import { DDS } from '../services/DeviceDetection';
|
||||
import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent } from '../services/EventManager';
|
||||
import { editing, setWidthHeight } from '../utils';
|
||||
@@ -21,13 +22,10 @@ import {
|
||||
eOnLoadNote,
|
||||
eOpenFullscreenEditor
|
||||
} from '../utils/events';
|
||||
import { hideAllTooltips } from '../utils/hooks/use-tooltip';
|
||||
import { editorRef, tabBarRef } from '../utils/global-refs';
|
||||
import { hideAllTooltips } from '../utils/hooks/use-tooltip';
|
||||
import { sleep } from '../utils/time';
|
||||
import { EditorWrapper } from '../views/Editor/EditorWrapper';
|
||||
import { checkStatus, EditorWebView, getNote } from '../views/Editor/Functions';
|
||||
import tiny from '../views/Editor/tiny/tiny';
|
||||
import { NavigatorStack } from './NavigatorStack';
|
||||
import { NavigationStack } from './navigation-stack';
|
||||
|
||||
let layoutTimer = null;
|
||||
|
||||
@@ -70,20 +68,7 @@ const onChangeTab = async obj => {
|
||||
}
|
||||
};
|
||||
|
||||
export const RootView = React.memo(
|
||||
() => {
|
||||
return (
|
||||
<>
|
||||
<NativeStack />
|
||||
<Toast />
|
||||
<DialogProvider />
|
||||
</>
|
||||
);
|
||||
},
|
||||
() => true
|
||||
);
|
||||
|
||||
const NativeStack = React.memo(
|
||||
export const TabsHolder = React.memo(
|
||||
() => {
|
||||
const [state] = useTracked();
|
||||
const { colors } = state;
|
||||
@@ -333,7 +318,7 @@ const NativeStack = React.memo(
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<NavigatorStack />
|
||||
<NavigationStack />
|
||||
</View>,
|
||||
<EditorWrapper key="3" width={widths} dimensions={dimensions} />
|
||||
];
|
||||
@@ -10,9 +10,9 @@ import { SUBSCRIPTION_STATUS } from '../utils/constants';
|
||||
import { db } from '../utils/database';
|
||||
import { MMKV } from '../utils/database/mmkv';
|
||||
import layoutmanager from '../utils/layout-manager';
|
||||
import { EditorWebView } from '../views/Editor/Functions';
|
||||
import tiny from '../views/Editor/tiny/tiny';
|
||||
import { endSearch } from '../views/Editor/tiny/toolbar/commands';
|
||||
import { EditorWebView } from '../screens/editor/Functions';
|
||||
import tiny from '../screens/editor/tiny/tiny';
|
||||
import { endSearch } from '../screens/editor/tiny/toolbar/commands';
|
||||
import {
|
||||
Announcement,
|
||||
EditorStore,
|
||||
|
||||
@@ -4,7 +4,7 @@ import DocumentPicker from 'react-native-document-picker';
|
||||
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
|
||||
import Sodium from 'react-native-sodium';
|
||||
import RNFetchBlob from 'rn-fetch-blob';
|
||||
import { AttachmentItem } from '../../../../components/AttachmentDialog/attachment-item';
|
||||
import { AttachmentItem } from '../../../../components/attachments/attachment-item';
|
||||
import { eSendEvent, presentSheet, ToastEvent } from '../../../../services/EventManager';
|
||||
import PremiumService from '../../../../services/PremiumService';
|
||||
import { editing } from '../../../../utils';
|
||||
@@ -13,7 +13,7 @@ import { editing, InteractionManager } from '../../utils';
|
||||
import { db } from '../../utils/database';
|
||||
import { eOnLoadNote } from '../../utils/events';
|
||||
import { tabBarRef } from '../../utils/global-refs';
|
||||
import { getNote } from '../Editor/Functions';
|
||||
import { getNote } from '../editor/Functions';
|
||||
|
||||
export const Home = ({ navigation }) => {
|
||||
const notes = useNoteStore(state => state.notes);
|
||||
@@ -11,7 +11,7 @@ import Navigation from '../../services/Navigation';
|
||||
import SearchService from '../../services/SearchService';
|
||||
import { InteractionManager } from '../../utils';
|
||||
|
||||
export const Folders = ({ navigation }) => {
|
||||
export const Notebooks = ({ navigation }) => {
|
||||
const notebooks = useNotebookStore(state => state.notebooks);
|
||||
const setNotebooks = useNotebookStore(state => state.setNotebooks);
|
||||
let ranAfterInteractions = false;
|
||||
@@ -103,4 +103,4 @@ export const Folders = ({ navigation }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Folders;
|
||||
export default Notebooks;
|
||||
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { FloatingButton } from '../../components/container/floating-button';
|
||||
import { ContainerHeader } from '../../components/container/containerheader';
|
||||
import { Header } from '../../components/header';
|
||||
import { MoveNotes } from '../../components/MoveNoteDialog/movenote';
|
||||
import { MoveNotes } from '../../components/sheets/move-notes/movenote';
|
||||
import SelectionHeader from '../../components/selection-header';
|
||||
import List from '../../components/list';
|
||||
import { useTracked } from '../../provider';
|
||||
@@ -17,7 +17,7 @@ import { db } from '../../utils/database';
|
||||
import { eOnLoadNote, eOpenAddTopicDialog, refreshNotesPage } from '../../utils/events';
|
||||
import { openLinkInBrowser } from '../../utils/functions';
|
||||
import { tabBarRef } from '../../utils/global-refs';
|
||||
import { getNote } from '../Editor/Functions';
|
||||
import { getNote } from '../editor/Functions';
|
||||
|
||||
const getNotes = params => {
|
||||
if (!params) return [];
|
||||
@@ -3,7 +3,7 @@ import { Linking, Platform, ScrollView, View } from 'react-native';
|
||||
import { APP_VERSION } from '../../../version';
|
||||
import { Button as MButton } from '../../components/ui/button/index';
|
||||
import { ContainerHeader } from '../../components/container/containerheader';
|
||||
import { Issue } from '../../components/Github/issue';
|
||||
import { Issue } from '../../components/sheets/github/issue';
|
||||
import { Header as TopHeader } from '../../components/header/index';
|
||||
import Seperator from '../../components/ui/seperator';
|
||||
import Paragraph from '../../components/ui/typography/paragraph';
|
||||
@@ -2,7 +2,7 @@ import { useMessageStore } from '../provider/stores';
|
||||
import { eOpenLoginDialog, eOpenRateDialog, eOpenRecoveryKeyDialog } from '../utils/events';
|
||||
import { eSendEvent } from './EventManager';
|
||||
import PremiumService from './PremiumService';
|
||||
import { verifyUser } from '../views/Settings/functions';
|
||||
import { verifyUser } from '../screens/settings/functions';
|
||||
import { MMKV } from '../utils/database/mmkv';
|
||||
import { Platform } from 'react-native';
|
||||
import umami from '../utils/analytics';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user