A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
refactor
ammarahm-ed928e8debefc2
diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.jsindex 127ec3443..a4052ee0c 100644--- a/apps/mobile/src/components/AddNotebookDialog/index.js+++ b/apps/mobile/src/components/AddNotebookDialog/index.js@@ -10,7 +10,7 @@ import {db} from '../../utils/database';import {ph, pv, SIZE} from '../../utils/SizeUtils';import {sleep} from '../../utils/TimeUtils';import {ActionIcon} from '../ActionIcon';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import DialogHeader from '../Dialog/dialog-header';import Input from '../Input';@@ -254,7 +254,7 @@ export class AddNotebookDialog extends React.Component {const {topics, visible, topicInputFocused} = this.state;if (!visible) return null;return (- <ActionSheetWrapper+ <SheetWrapperonOpen={async () => {this.topicsToDelete = [];await sleep(300);@@ -408,7 +408,7 @@ export class AddNotebookDialog extends React.Component {</View><Toast context="local" />- </ActionSheetWrapper>+ </SheetWrapper>);}}diff --git a/apps/mobile/src/components/AttachmentDialog/index.js b/apps/mobile/src/components/AttachmentDialog/index.jsindex 3b11314e8..3e0254928 100644--- a/apps/mobile/src/components/AttachmentDialog/index.js+++ b/apps/mobile/src/components/AttachmentDialog/index.js@@ -17,7 +17,7 @@ import {import filesystem from '../../utils/filesystem';import { SIZE } from '../../utils/SizeUtils';import { ActionIcon } from '../ActionIcon';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import DialogHeader from '../Dialog/dialog-header';import GeneralSheet from '../GeneralSheet';import Paragraph from '../Typography/Paragraph';@@ -57,7 +57,7 @@ export const AttachmentDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrappercentered={false}fwdRef={actionSheetRef}onClose={async () => {@@ -107,7 +107,7 @@ export const AttachmentDialog = () => {{' '}All attachments are end-to-end encrypted.</Paragraph></View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/Dialog/BaseDialog.js b/apps/mobile/src/components/Dialog/BaseDialog.jsindex 649ea14a2..669a46b36 100644--- a/apps/mobile/src/components/Dialog/BaseDialog.js+++ b/apps/mobile/src/components/Dialog/BaseDialog.js@@ -8,7 +8,7 @@ import {TouchableOpacity} from 'react-native';import useIsFloatingKeyboard from '../../utils/use-is-floating-keyboard';-import { BouncingView } from '../ActionSheetComponent/BouncingView';+import { BouncingView } from '../Transitions/bouncing-view';const BaseDialog = ({visible,diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.jsindex 2c1e72652..d91a10ea0 100644--- a/apps/mobile/src/components/DialogManager/index.js+++ b/apps/mobile/src/components/DialogManager/index.js@@ -21,8 +21,8 @@ import {eThemeUpdated} from '../../utils/Events';import { EditorSettings } from '../../views/Editor/EditorSettings';-import { ActionSheetComponent } from '../ActionSheetComponent';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import { Properties } from '../Properties';+import SheetWrapper from '../sheet';import { AddNotebookDialog } from '../AddNotebookDialog';import { AddTopicDialog } from '../AddTopicDialog';import { AnnouncementDialog } from '../Announcements';@@ -237,7 +237,7 @@ export class DialogManager extends Component {return (<>{!this.state.actionSheetVisible ? null : (- <ActionSheetWrapper+ <SheetWrapperfwdRef={this.actionSheet}onClose={() => {eSendEvent(eShowGetPremium, null);@@ -246,15 +246,11 @@ export class DialogManager extends Component {actionSheetVisible: false});}}>- <ActionSheetComponent+ <Propertiesitem={item}- setWillRefresh={value => {- this.willRefresh = true;- }}getRef={() => this.actionSheet}hasColors={actionSheetData.colors}hasTags={actionSheetData.colors}- overlayColor="rgba(0,0,0,0.3)"rowItems={actionSheetData.rowItems}columnItems={actionSheetData.columnItems}close={value => {@@ -264,7 +260,7 @@ export class DialogManager extends Component {this.actionSheet.current?.setModalVisible();}}/>- </ActionSheetWrapper>+ </SheetWrapper>)}<Dialog context="global" /><AddTopicDialogdiff --git a/apps/mobile/src/components/ExportDialog/index.js b/apps/mobile/src/components/ExportDialog/index.jsindex 54547c570..b2c4bed68 100644--- a/apps/mobile/src/components/ExportDialog/index.js+++ b/apps/mobile/src/components/ExportDialog/index.js@@ -10,7 +10,7 @@ import Exporter from '../../services/Exporter';import { getElevation } from '../../utils';import { ph, pv, SIZE } from '../../utils/SizeUtils';import { sleep } from '../../utils/TimeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import { Button } from '../Button';import DialogHeader from '../Dialog/dialog-header';import { PressableButton } from '../PressableButton';@@ -132,7 +132,7 @@ const ExportDialog = () => {];return !visible ? null : (- <ActionSheetWrapper fwdRef={actionSheetRef} onClose={close} visible={true}>+ <SheetWrapper fwdRef={actionSheetRef} onClose={close} visible={true}><View><Viewstyle={{@@ -269,7 +269,7 @@ const ExportDialog = () => {</View></View></View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/GeneralSheet/index.js b/apps/mobile/src/components/GeneralSheet/index.jsindex 2fbd755df..2f2b9bc19 100644--- a/apps/mobile/src/components/GeneralSheet/index.js+++ b/apps/mobile/src/components/GeneralSheet/index.js@@ -6,7 +6,7 @@ import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';import {eCloseProgressDialog, eOpenProgressDialog} from '../../utils/Events';import {SIZE} from '../../utils/SizeUtils';import {sleep} from '../../utils/TimeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import Heading from '../Typography/Heading';import Paragraph from '../Typography/Paragraph';@@ -50,7 +50,7 @@ const GeneralSheet = ({context}) => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrapperfwdRef={actionSheetRef}gestureEnabled={dialogData?.noProgress}closeOnTouchBackdrop={dialogData?.noProgress}@@ -166,7 +166,7 @@ const GeneralSheet = ({context}) => {/>))}</View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.jsindex 65e173803..73bdd0b37 100644--- a/apps/mobile/src/components/LoginDialog/index.js+++ b/apps/mobile/src/components/LoginDialog/index.js@@ -25,7 +25,7 @@ import {MMKV} from '../../utils/mmkv';import {SIZE} from '../../utils/SizeUtils';import Storage from '../../utils/storage';import {sleep} from '../../utils/TimeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import BaseDialog from '../Dialog/base-dialog';import DialogButtons from '../Dialog/dialog-buttons';import DialogContainer from '../Dialog/dialog-container';@@ -410,7 +410,7 @@ const LoginDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrapperfwdRef={actionSheetRef}animation={DDS.isTab ? 'fade' : 'slide'}statusBarTranslucent={false}@@ -755,7 +755,7 @@ const LoginDialog = () => {}}/></ScrollView>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/Menu/TagsSection.js b/apps/mobile/src/components/Menu/TagsSection.jsindex 81eb81ae4..9af1d518b 100644--- a/apps/mobile/src/components/Menu/TagsSection.js+++ b/apps/mobile/src/components/Menu/TagsSection.js@@ -12,7 +12,7 @@ import Navigation from '../../services/Navigation';import {db} from '../../utils/database';import {eOnNewTopicAdded, refreshNotesPage} from '../../utils/Events';import {normalize, SIZE} from '../../utils/SizeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import {ActionSheetEvent} from '../DialogManager/recievers';import {PressableButton} from '../PressableButton';@@ -126,7 +126,7 @@ const PinItem = ({item, index, onPress}) => {return (<>{visible && (- <ActionSheetWrapper+ <SheetWrapperonClose={() => {setVisible(false);}}@@ -149,7 +149,7 @@ const PinItem = ({item, index, onPress}) => {marginBottom: 30}}/>- </ActionSheetWrapper>+ </SheetWrapper>)}<PressableButtontype={headerTextState?.id === item.id ? 'grayBg' : 'gray'}diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.jsindex a856bbd8f..456671856 100644--- a/apps/mobile/src/components/MoveNoteDialog/index.js+++ b/apps/mobile/src/components/MoveNoteDialog/index.js@@ -17,7 +17,7 @@ import {getTotalNotes} from '../../utils';import {db} from '../../utils/database';import {eOpenMoveNoteDialog} from '../../utils/Events';import {pv, SIZE} from '../../utils/SizeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import DialogHeader from '../Dialog/dialog-header';import {PressableButton} from '../PressableButton';@@ -68,9 +68,9 @@ const MoveNoteDialog = () => {};return !visible ? null : (- <ActionSheetWrapper fwdRef={actionSheetRef} onClose={_onClose}>+ <SheetWrapper fwdRef={actionSheetRef} onClose={_onClose}><MoveNoteComponent close={close} note={note} setNote={update} />- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/ActionSheetComponent/colortags.js b/apps/mobile/src/components/Properties/colortags.jssimilarity index 100%rename from apps/mobile/src/components/ActionSheetComponent/colortags.jsrename to apps/mobile/src/components/Properties/colortags.jsdiff --git a/apps/mobile/src/components/ActionSheetComponent/datemeta.js b/apps/mobile/src/components/Properties/datemeta.jssimilarity index 100%rename from apps/mobile/src/components/ActionSheetComponent/datemeta.jsrename to apps/mobile/src/components/Properties/datemeta.jsdiff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/Properties/index.jssimilarity index 99%rename from apps/mobile/src/components/ActionSheetComponent/index.jsrename to apps/mobile/src/components/Properties/index.jsindex f2057f447..9f645de3f 100644--- a/apps/mobile/src/components/ActionSheetComponent/index.js+++ b/apps/mobile/src/components/Properties/index.js@@ -65,7 +65,7 @@ import {Topics} from './topics';const w = Dimensions.get('window').width;let htmlToText;-export const ActionSheetComponent = ({+export const Properties = ({close = () => {},item,hasColors = false,diff --git a/apps/mobile/src/components/ActionSheetComponent/tags.js b/apps/mobile/src/components/Properties/tags.jssimilarity index 100%rename from apps/mobile/src/components/ActionSheetComponent/tags.jsrename to apps/mobile/src/components/Properties/tags.jsdiff --git a/apps/mobile/src/components/ActionSheetComponent/topics.js b/apps/mobile/src/components/Properties/topics.jssimilarity index 100%rename from apps/mobile/src/components/ActionSheetComponent/topics.jsrename to apps/mobile/src/components/Properties/topics.jsdiff --git a/apps/mobile/src/components/PublishNoteDialog/index.js b/apps/mobile/src/components/PublishNoteDialog/index.jsindex 085eb892d..dd75bca1b 100644--- a/apps/mobile/src/components/PublishNoteDialog/index.js+++ b/apps/mobile/src/components/PublishNoteDialog/index.js@@ -17,7 +17,7 @@ import {import {openLinkInBrowser} from '../../utils/functions';import {SIZE} from '../../utils/SizeUtils';import {ActionIcon} from '../ActionIcon';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import DialogHeader from '../Dialog/dialog-header';import Input from '../Input';@@ -129,7 +129,7 @@ const PublishNoteDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrappercentered={false}fwdRef={actionSheetRef}closeOnTouchBackdrop={!publishing}@@ -366,7 +366,7 @@ const PublishNoteDialog = () => {Learn more about Notesnook Monograph</Paragraph></View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/RateDialog/index.js b/apps/mobile/src/components/RateDialog/index.jsindex b87d08f2c..71c778fc0 100644--- a/apps/mobile/src/components/RateDialog/index.js+++ b/apps/mobile/src/components/RateDialog/index.js@@ -4,7 +4,7 @@ import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';import {eCloseRateDialog, eOpenRateDialog} from '../../utils/Events';import {MMKV} from '../../utils/mmkv';import {SIZE} from '../../utils/SizeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import Seperator from '../Seperator';import Heading from '../Typography/Heading';@@ -37,7 +37,7 @@ const RateDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrappercentered={false}fwdRef={actionSheetRef}onClose={async () => {@@ -117,7 +117,7 @@ const RateDialog = () => {/></View></View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/RecoveryKeyDialog/index.js b/apps/mobile/src/components/RecoveryKeyDialog/index.jsindex ab0f16d05..cdba7479f 100644--- a/apps/mobile/src/components/RecoveryKeyDialog/index.js+++ b/apps/mobile/src/components/RecoveryKeyDialog/index.js@@ -16,7 +16,7 @@ import {sanitizeFilename} from '../../utils/filename';import {SIZE} from '../../utils/SizeUtils';import Storage from '../../utils/storage';import {sleep} from '../../utils/TimeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import DialogHeader from '../Dialog/dialog-header';import Seperator from '../Seperator';@@ -185,7 +185,7 @@ class RecoveryKeyDialog extends React.Component {const {colors} = this.props;if (!this.state.visible) return null;return (- <ActionSheetWrapper+ <SheetWrappercloseOnTouchBackdrop={false}gestureEnabled={false}onOpen={this.onOpen}@@ -317,7 +317,7 @@ class RecoveryKeyDialog extends React.Component {onPress={this.close}/></View>- </ActionSheetWrapper>+ </SheetWrapper>);}}diff --git a/apps/mobile/src/components/RestoreDialog/index.js b/apps/mobile/src/components/RestoreDialog/index.jsindex 97db117aa..840c91ffd 100644--- a/apps/mobile/src/components/RestoreDialog/index.js+++ b/apps/mobile/src/components/RestoreDialog/index.js@@ -15,7 +15,7 @@ import {MMKV} from '../../utils/mmkv';import {SIZE} from '../../utils/SizeUtils';import storage from '../../utils/storage';import {sleep, timeConverter} from '../../utils/TimeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import {Button} from '../Button';import DialogHeader from '../Dialog/dialog-header';import Seperator from '../Seperator';@@ -60,7 +60,7 @@ const RestoreDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrapperfwdRef={actionSheetRef}gestureEnabled={!restoring}closeOnTouchBackdrop={!restoring}@@ -70,7 +70,7 @@ const RestoreDialog = () => {restoring={restoring}setRestoring={setRestoring}/>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/TagsDialog/index.js b/apps/mobile/src/components/TagsDialog/index.jsindex af14ba500..e84c8d182 100644--- a/apps/mobile/src/components/TagsDialog/index.js+++ b/apps/mobile/src/components/TagsDialog/index.js@@ -8,7 +8,7 @@ import Navigation from '../../services/Navigation';import {db} from '../../utils/database';import {eCloseTagsDialog, eOpenTagsDialog, refreshNotesPage} from '../../utils/Events';import {SIZE} from '../../utils/SizeUtils';-import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../sheet';import Input from '../Input';import {PressableButton} from '../PressableButton';import Paragraph from '../Typography/Paragraph';@@ -117,7 +117,7 @@ const TagsDialog = () => {};return !visible ? null : (- <ActionSheetWrapper+ <SheetWrappercentered={false}fwdRef={actionSheetRef}onOpen={async () => {@@ -203,7 +203,7 @@ const TagsDialog = () => {))}</ScrollView></View>- </ActionSheetWrapper>+ </SheetWrapper>);};diff --git a/apps/mobile/src/components/ActionSheetComponent/BouncingView.js b/apps/mobile/src/components/Transitions/bouncingview.jssimilarity index 100%rename from apps/mobile/src/components/ActionSheetComponent/BouncingView.jsrename to apps/mobile/src/components/Transitions/bouncingview.jsdiff --git a/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js b/apps/mobile/src/components/sheet/index.jssimilarity index 83%rename from apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.jsrename to apps/mobile/src/components/sheet/index.jsindex bb6d04da0..407da1560 100644--- a/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js+++ b/apps/mobile/src/components/sheet/index.js@@ -1,14 +1,14 @@import React from 'react';-import { Platform, View } from 'react-native';+import {Platform, View} from 'react-native';import ActionSheet from 'react-native-actions-sheet';-import { useSafeAreaInsets } from 'react-native-safe-area-context';-import { useTracked } from '../../provider';-import { useSettingStore } from '../../provider/stores';-import { PremiumToast } from '../Premium/premium-toast';-import { Toast } from '../Toast';-import { BouncingView } from './BouncingView';+import {useSafeAreaInsets} from 'react-native-safe-area-context';+import {useTracked} from '../../provider';+import {useSettingStore} from '../../provider/stores';+import {PremiumToast} from '../Premium/premium-toast';+import {Toast} from '../Toast';+import {BouncingView} from '../Transitions/bouncing-view';-const ActionSheetWrapper = ({+const SheetWrapper = ({children,fwdRef,gestureEnabled = true,@@ -48,7 +48,6 @@ const ActionSheetWrapper = ({};const _onClose = async () => {- //await reFocusEditor();if (onClose) {onClose();}@@ -96,4 +95,4 @@ const ActionSheetWrapper = ({);};-export default ActionSheetWrapper;+export default SheetWrapper;diff --git a/apps/mobile/src/views/Editor/EditorSettings.js b/apps/mobile/src/views/Editor/EditorSettings.jsindex 0ffe2b970..969b53445 100644--- a/apps/mobile/src/views/Editor/EditorSettings.js+++ b/apps/mobile/src/views/Editor/EditorSettings.js@@ -2,7 +2,7 @@ import React, {createRef, useEffect, useRef, useState} from 'react';import {View} from 'react-native';import Menu, {MenuItem} from 'react-native-reanimated-material-menu';import Icon from 'react-native-vector-icons/MaterialCommunityIcons';-import ActionSheetWrapper from '../../components/ActionSheetComponent/ActionSheetWrapper';+import SheetWrapper from '../../components/sheet';import {Button} from '../../components/Button';import BaseDialog from '../../components/Dialog/base-dialog';import DialogButtons from '../../components/Dialog/dialog-buttons';@@ -161,7 +161,7 @@ export const EditorSettings = () => {return (visible && (- <ActionSheetWrapper+ <SheetWrapperfwdRef={actionSheetRef}onClose={() => {setVisible(false);@@ -209,7 +209,7 @@ export const EditorSettings = () => {<SettingsButton {...item} />))}</View>- </ActionSheetWrapper>+ </SheetWrapper>));};