diff --git a/apps/mobile/App.js b/apps/mobile/App.js index b6d327c1c..18aadde3a 100644 --- a/apps/mobile/App.js +++ b/apps/mobile/App.js @@ -1,4 +1,3 @@ -import Storage from 'notes-core/api/index'; import React, {useEffect, useState} from 'react'; import {Platform, StatusBar, View, Text} from 'react-native'; import * as Animatable from 'react-native-animatable'; @@ -30,16 +29,12 @@ import { import NavigationService, { AppContainer, } from './src/services/NavigationService'; -import {DeviceDetectionService} from './src/utils/deviceDetection'; -import StorageInterface from './src/utils/storage'; -import {w} from './src/utils/utils'; +import {w, DDS, db} from './src/utils/utils'; import Editor from './src/views/Editor'; import Animated from 'react-native-reanimated'; import MMKV from 'react-native-mmkv-storage'; import {defaultState} from './src/provider/defaultState'; import {EditorPosition} from './src/utils/animations'; -export const DDS = new DeviceDetectionService(); -export const db = new Storage(StorageInterface); let sideMenuRef; let editorRef; diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js index c32b9e630..1d77eba66 100644 --- a/apps/mobile/src/components/ActionSheetComponent/index.js +++ b/apps/mobile/src/components/ActionSheetComponent/index.js @@ -10,7 +10,6 @@ import { import MMKV from 'react-native-mmkv-storage'; import Share from 'react-native-share'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {db, DDS} from '../../../App'; import { ACCENT, COLOR_SCHEME, @@ -26,7 +25,7 @@ import { import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; import NavigationService from '../../services/NavigationService'; -import {timeConverter, ToastEvent} from '../../utils/utils'; +import {timeConverter, ToastEvent, DDS, db} from '../../utils/utils'; import {openVault} from '../../services/eventManager'; const w = Dimensions.get('window').width; diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js index 8bfd710f2..12ef1321a 100644 --- a/apps/mobile/src/components/AddNotebookDialog/index.js +++ b/apps/mobile/src/components/AddNotebookDialog/index.js @@ -9,10 +9,10 @@ import { } from 'react-native'; import {FlatList, TextInput} from 'react-native-gesture-handler'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {db, DDS} from '../../../App'; + import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {ACTIONS} from '../../provider/actions'; -import {getElevation, ToastEvent} from '../../utils/utils'; +import {getElevation, ToastEvent, db, DDS} from '../../utils/utils'; import {updateEvent} from '../DialogManager/recievers'; let refs = []; diff --git a/apps/mobile/src/components/AddTopicDialog/index.js b/apps/mobile/src/components/AddTopicDialog/index.js index 0567ce153..6bad0f2f8 100644 --- a/apps/mobile/src/components/AddTopicDialog/index.js +++ b/apps/mobile/src/components/AddTopicDialog/index.js @@ -4,8 +4,8 @@ import {TextInput} from 'react-native-gesture-handler'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; -import {getElevation, ToastEvent} from '../../utils/utils'; -import {db} from '../../../App'; +import {getElevation, ToastEvent, db} from '../../utils/utils'; + import {eSendEvent} from '../../services/eventManager'; import {eOnNewTopicAdded} from '../../services/events'; diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.js index 20ad03b8e..bed23b9ab 100644 --- a/apps/mobile/src/components/Container/index.js +++ b/apps/mobile/src/components/Container/index.js @@ -12,14 +12,14 @@ import * as Animatable from 'react-native-animatable'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {br, opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; +import {ACTIONS} from '../../provider/actions'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; -import {eScrollEvent, eOpenLoginDialog} from '../../services/events'; -import {getElevation, h, w, ToastEvent} from '../../utils/utils'; +import {eScrollEvent} from '../../services/events'; +import {db, getElevation, ToastEvent} from '../../utils/utils'; import {Header} from '../header'; import {Search} from '../SearchInput'; import SelectionHeader from '../SelectionHeader'; -import {DDS, db} from '../../../App'; -import {ACTIONS} from '../../provider/actions'; + export const AnimatedSafeAreaView = Animatable.createAnimatableComponent( SafeAreaView, ); diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js index 9390cf5ec..0387b864c 100644 --- a/apps/mobile/src/components/Dialog/index.js +++ b/apps/mobile/src/components/Dialog/index.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import {Modal, Text, TouchableOpacity, View} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {db, DDS} from '../../../App'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; @@ -12,7 +11,14 @@ import { } from '../../services/events'; import NavigationService from '../../services/NavigationService'; import {exitEditorAnimation} from '../../utils/animations'; -import {editing, getElevation, history, ToastEvent} from '../../utils/utils'; +import { + editing, + getElevation, + history, + ToastEvent, + db, + DDS, +} from '../../utils/utils'; import {updateEvent} from '../DialogManager/recievers'; import {dialogActions} from '../DialogManager/dialogActions'; diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js index 0ccdb06a0..da2cc69a2 100644 --- a/apps/mobile/src/components/DialogManager/index.js +++ b/apps/mobile/src/components/DialogManager/index.js @@ -1,5 +1,4 @@ import React, {Component} from 'react'; -import {DDS} from '../../../App'; import { eSubscribeEvent, eUnSubscribeEvent, @@ -28,7 +27,7 @@ import {Dialog} from '../Dialog'; import LoginDialog from '../LoginDialog'; import MoveNoteDialog from '../MoveNoteDialog'; import {VaultDialog} from '../VaultDialog'; -import {hexToRGBA} from '../../utils/utils'; +import {hexToRGBA, DDS} from '../../utils/utils'; import {Platform} from 'react-native'; import {TEMPLATE_DELETE, TEMPLATE_PERMANANT_DELETE} from './templates'; import {moveNoteEvent} from './recievers'; diff --git a/apps/mobile/src/components/EditorMenu/index.js b/apps/mobile/src/components/EditorMenu/index.js index 11dd874ec..6c2a294d6 100644 --- a/apps/mobile/src/components/EditorMenu/index.js +++ b/apps/mobile/src/components/EditorMenu/index.js @@ -23,8 +23,7 @@ import { import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; import {AnimatedSafeAreaView} from '../../views/Home'; -import {db} from '../../../App'; -import {w, hexToRGBA} from '../../utils/utils'; +import {w, hexToRGBA, db} from '../../utils/utils'; let tagsInputRef; let tagsList; diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js index 2c66e3ab9..ea66d8fdf 100644 --- a/apps/mobile/src/components/LoginDialog/index.js +++ b/apps/mobile/src/components/LoginDialog/index.js @@ -3,12 +3,11 @@ import {Modal, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; import {createAppContainer} from 'react-navigation'; import {createStackNavigator} from 'react-navigation-stack'; -import {DDS} from '../../../App'; import {normalize} from '../../common/common'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eLoginDialogNavigateBack} from '../../services/events'; -import {getElevation} from '../../utils/utils'; +import {getElevation, DDS} from '../../utils/utils'; import ForgotPassword from '../../views/ForgotPassword'; import Login from '../../views/Login'; import Signup from '../../views/Signup'; diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js index 86e75341b..feeebb55e 100644 --- a/apps/mobile/src/components/Menu/index.js +++ b/apps/mobile/src/components/Menu/index.js @@ -10,7 +10,6 @@ import { } from 'react-native'; import MMKV from 'react-native-mmkv-storage'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {DDS, db} from '../../../App'; import { ACCENT, COLOR_SCHEME, @@ -29,7 +28,7 @@ import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eOpenModalMenu, eSendSideMenuOverlayRef} from '../../services/events'; import NavigationService from '../../services/NavigationService'; -import {timeSince, getElevation, hexToRGBA} from '../../utils/utils'; +import {timeSince, getElevation, hexToRGBA, db, DDS} from '../../utils/utils'; import {inputRef} from '../SearchInput'; export const Menu = ({ diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.js index c4fa311a9..7b49c23e1 100644 --- a/apps/mobile/src/components/MoveNoteDialog/index.js +++ b/apps/mobile/src/components/MoveNoteDialog/index.js @@ -3,11 +3,10 @@ import {Modal, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; import {createAppContainer} from 'react-navigation'; import {createStackNavigator} from 'react-navigation-stack'; -import {DDS} from '../../../App'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eMoveNoteDialogNavigateBack} from '../../services/events'; -import {getElevation} from '../../utils/utils'; +import {getElevation, DDS} from '../../utils/utils'; import Folders from '../../views/Folders'; import Notebook from '../../views/Notebook'; import Notes from '../../views/Notes'; diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js index 8f2a99866..ff40b7182 100644 --- a/apps/mobile/src/components/NoteItem/index.js +++ b/apps/mobile/src/components/NoteItem/index.js @@ -1,12 +1,11 @@ import React from 'react'; import {Dimensions, Text, TouchableOpacity, View} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {DDS} from '../../../App'; import {ph, pv, SIZE, WEIGHT} from '../../common/common'; import {eSendEvent, openVault} from '../../services/eventManager'; import {eOnLoadNote} from '../../services/events'; import {openEditorAnimation} from '../../utils/animations'; -import {getElevation, timeSince} from '../../utils/utils'; +import {getElevation, timeSince, DDS} from '../../utils/utils'; import {ActionSheetEvent, simpleDialogEvent} from '../DialogManager/recievers'; import {TEMPLATE_TRASH} from '../DialogManager/templates'; diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.js index b6df14a88..ae75db5af 100644 --- a/apps/mobile/src/components/NotebookItem/index.js +++ b/apps/mobile/src/components/NotebookItem/index.js @@ -4,9 +4,9 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; import NavigationService from '../../services/NavigationService'; -import {ToastEvent, w, getElevation} from '../../utils/utils'; +import {ToastEvent, w, getElevation, db, DDS} from '../../utils/utils'; import {ActionSheetEvent, moveNoteHideEvent} from '../DialogManager'; -import {db} from '../../../App'; + import {ACTIONS} from '../../provider/actions'; export const NotebookItem = ({ diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.js index b46dcc584..07446212f 100644 --- a/apps/mobile/src/components/NotesList/index.js +++ b/apps/mobile/src/components/NotesList/index.js @@ -13,11 +13,11 @@ import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eScrollEvent} from '../../services/events'; -import {ToastEvent, hexToRGBA} from '../../utils/utils'; +import {ToastEvent, hexToRGBA, DDS, db} from '../../utils/utils'; import {NotesPlaceHolder} from '../ListPlaceholders'; import NoteItem from '../NoteItem'; import SelectionWrapper from '../SelectionWrapper'; -import {db, DDS} from '../../../App'; + import {inputRef} from '../SearchInput'; import {useIsFocused} from 'react-navigation-hooks'; diff --git a/apps/mobile/src/components/SearchInput/index.js b/apps/mobile/src/components/SearchInput/index.js index b1ed132ae..60529fe35 100644 --- a/apps/mobile/src/components/SearchInput/index.js +++ b/apps/mobile/src/components/SearchInput/index.js @@ -2,9 +2,10 @@ import React, {createRef, useEffect, useState} from 'react'; import {TextInput} from 'react-native'; import Animated, {Easing} from 'react-native-reanimated'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {DDS} from '../../../App'; + import {br, SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; +import {DDS} from '../../utils/utils'; const {Value, timing, block} = Animated; diff --git a/apps/mobile/src/components/SelectionHeader/index.js b/apps/mobile/src/components/SelectionHeader/index.js index 75a2e7438..327206d55 100644 --- a/apps/mobile/src/components/SelectionHeader/index.js +++ b/apps/mobile/src/components/SelectionHeader/index.js @@ -12,10 +12,10 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; -import {w, ToastEvent} from '../../utils/utils'; +import {w, ToastEvent, db} from '../../utils/utils'; import {eSendEvent} from '../../services/eventManager'; import {eOpenMoveNoteDialog, eOpenSimpleDialog} from '../../services/events'; -import {db} from '../../../App'; + import {TEMPLATE_DELETE} from '../DialogManager'; export const AnimatedSafeAreaView = Animatable.createAnimatableComponent( diff --git a/apps/mobile/src/components/Toast/index.js b/apps/mobile/src/components/Toast/index.js index a28cac01e..e1102915f 100644 --- a/apps/mobile/src/components/Toast/index.js +++ b/apps/mobile/src/components/Toast/index.js @@ -5,9 +5,8 @@ import {opacity, ph, SIZE, WEIGHT, normalize, pv} from '../../common/common'; import {useTracked} from '../../provider'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; import {eHideToast, eShowToast} from '../../services/events'; -import {h, w} from '../../utils/utils'; +import {h, w, DDS} from '../../utils/utils'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {DDS} from '../../../App'; const AnimatedTouchableOpacity = Animatable.createAnimatableComponent( TouchableOpacity, diff --git a/apps/mobile/src/components/VaultDialog/index.js b/apps/mobile/src/components/VaultDialog/index.js index a43cdc5e8..54082b955 100644 --- a/apps/mobile/src/components/VaultDialog/index.js +++ b/apps/mobile/src/components/VaultDialog/index.js @@ -3,8 +3,8 @@ import {View, Text, TouchableOpacity, Modal, ToastAndroid} from 'react-native'; import {SIZE, ph, pv, opacity, WEIGHT} from '../../common/common'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {TextInput} from 'react-native-gesture-handler'; -import {db, DDS} from '../../../App'; -import {getElevation, ToastEvent, editing} from '../../utils/utils'; + +import {getElevation, ToastEvent, db, DDS} from '../../utils/utils'; import Share from 'react-native-share'; import { eSendEvent, diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js index c94f64dd1..7a29a0140 100644 --- a/apps/mobile/src/components/header/index.js +++ b/apps/mobile/src/components/header/index.js @@ -1,13 +1,13 @@ import React, {createRef} from 'react'; import {Platform, StatusBar, Text, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; -import {DDS} from '../../../App'; + import {SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; import {eSendEvent} from '../../services/eventManager'; import {eCloseLoginDialog} from '../../services/events'; import NavigationService from '../../services/NavigationService'; -import {SideMenuEvent} from '../../utils/utils'; +import {SideMenuEvent, DDS} from '../../utils/utils'; import {moveNoteHideEvent} from '../DialogManager'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Menu, {MenuItem, MenuDivider} from 'react-native-material-menu'; diff --git a/apps/mobile/src/provider/reducer.js b/apps/mobile/src/provider/reducer.js index 8c3730c49..1f5229918 100644 --- a/apps/mobile/src/provider/reducer.js +++ b/apps/mobile/src/provider/reducer.js @@ -1,5 +1,4 @@ -import {db} from '../../App'; -import {SideMenuEvent, history} from '../utils/utils'; +import {SideMenuEvent, history, db} from '../utils/utils'; import {ACTIONS} from './actions'; export const reducer = (state, action) => { diff --git a/apps/mobile/src/utils/utils.js b/apps/mobile/src/utils/utils.js index 192c9c267..e1f01789d 100755 --- a/apps/mobile/src/utils/utils.js +++ b/apps/mobile/src/utils/utils.js @@ -1,4 +1,5 @@ -import {DeviceEventEmitter, Dimensions} from 'react-native'; +import Storage from 'notes-core/api/index'; +import {Dimensions} from 'react-native'; import {eSendEvent} from '../services/eventManager'; import { eOpenSideMenu, @@ -8,6 +9,11 @@ import { eShowToast, eHideToast, } from '../services/events'; +import {DeviceDetectionService} from './deviceDetection'; +import StorageInterface from './storage'; +export const DDS = new DeviceDetectionService(); +export const db = new Storage(StorageInterface); + export const getElevation = elevation => { return { elevation, diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js index 7997012bd..30dbd4946 100755 --- a/apps/mobile/src/views/Editor/index.js +++ b/apps/mobile/src/views/Editor/index.js @@ -12,7 +12,7 @@ import { } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import WebView from 'react-native-webview'; -import {db, DDS} from '../../../App'; + import {normalize, SIZE, WEIGHT} from '../../common/common'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; @@ -33,6 +33,8 @@ import { SideMenuEvent, timeConverter, ToastEvent, + DDS, + db, } from '../../utils/utils'; import { ActionSheetEvent, diff --git a/apps/mobile/src/views/Favorites/index.js b/apps/mobile/src/views/Favorites/index.js index eb38fad61..6c15af349 100644 --- a/apps/mobile/src/views/Favorites/index.js +++ b/apps/mobile/src/views/Favorites/index.js @@ -7,7 +7,7 @@ import NoteItem from '../../components/NoteItem'; import SelectionWrapper from '../../components/SelectionWrapper'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; -import {ToastEvent, w} from '../../utils/utils'; +import {ToastEvent, w, db} from '../../utils/utils'; import SimpleList from '../../components/SimpleList'; export const Favorites = ({navigation}) => { diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js index 425d528db..666f4bec5 100644 --- a/apps/mobile/src/views/Folders/index.js +++ b/apps/mobile/src/views/Folders/index.js @@ -11,7 +11,7 @@ import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eScrollEvent} from '../../services/events'; import {slideLeft, slideRight} from '../../utils/animations'; -import {ToastEvent, w} from '../../utils/utils'; +import {ToastEvent, w, db} from '../../utils/utils'; import {AddNotebookEvent} from '../../components/DialogManager/recievers'; export const Folders = ({navigation}) => { diff --git a/apps/mobile/src/views/ForgotPassword/index.js b/apps/mobile/src/views/ForgotPassword/index.js index a3c27d5dd..bd59a6209 100644 --- a/apps/mobile/src/views/ForgotPassword/index.js +++ b/apps/mobile/src/views/ForgotPassword/index.js @@ -2,8 +2,7 @@ import React, {createRef, useEffect} from 'react'; import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native'; import {TextInput} from 'react-native-gesture-handler'; import {useIsFocused} from 'react-navigation-hooks'; -import {DDS} from '../../../App'; -import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; +import {opacity, pv, SIZE, WEIGHT, DDS} from '../../common/common'; import {Header} from '../../components/header'; import {useTracked} from '../../provider'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js index 62d5fd242..e7c710a15 100755 --- a/apps/mobile/src/views/Home/index.js +++ b/apps/mobile/src/views/Home/index.js @@ -2,15 +2,13 @@ import React, {useEffect} from 'react'; import {SafeAreaView} from 'react-native'; import * as Animatable from 'react-native-animatable'; import {useIsFocused} from 'react-navigation-hooks'; -import {DDS, db} from '../../../App'; import Container from '../../components/Container'; import {NotesList} from '../../components/NotesList'; import SelectionHeader from '../../components/SelectionHeader'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; -import NavigationService from '../../services/NavigationService'; -import {SideMenuEvent} from '../../utils/utils'; +import {SideMenuEvent, DDS} from '../../utils/utils'; import {eScrollEvent, eOnLoadNote} from '../../services/events'; import {openEditorAnimation} from '../../utils/animations'; let count = 0; diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.js index 24282038a..8fee26a57 100644 --- a/apps/mobile/src/views/Login/index.js +++ b/apps/mobile/src/views/Login/index.js @@ -9,7 +9,7 @@ import { } from 'react-native'; import {TextInput} from 'react-native-gesture-handler'; import {useIsFocused} from 'react-navigation-hooks'; -import {DDS, db} from '../../../App'; + import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {Header} from '../../components/header'; import {useTracked} from '../../provider'; @@ -22,7 +22,7 @@ import { validateUsername, } from '../../services/validation'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {ToastEvent} from '../../utils/utils'; +import {ToastEvent, db, DDS} from '../../utils/utils'; import {ACTIONS} from '../../provider/actions'; export const Login = ({navigation}) => { diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js index dc7486670..f39ca2305 100644 --- a/apps/mobile/src/views/Notebook/index.js +++ b/apps/mobile/src/views/Notebook/index.js @@ -1,6 +1,5 @@ import React, {useEffect, useState} from 'react'; import {useIsFocused} from 'react-navigation-hooks'; -import {db} from '../../../App'; import Container from '../../components/Container'; import {NotebookItem} from '../../components/NotebookItem'; import SelectionWrapper from '../../components/SelectionWrapper'; @@ -16,7 +15,7 @@ import { eOnNewTopicAdded, eScrollEvent, } from '../../services/events'; -import {ToastEvent, w} from '../../utils/utils'; +import {ToastEvent, w, db} from '../../utils/utils'; import SimpleList from '../../components/SimpleList'; import {NotebookPlaceHolder} from '../../components/ListPlaceholders'; import {AddTopicEvent} from '../../components/DialogManager/recievers'; diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js index b43b17916..12b916793 100644 --- a/apps/mobile/src/views/Notes/index.js +++ b/apps/mobile/src/views/Notes/index.js @@ -1,35 +1,24 @@ import React, {useEffect, useState} from 'react'; -import { - FlatList, - Text, - View, - Platform, - RefreshControl, - ActivityIndicator, -} from 'react-native'; -import {db, DDS} from '../../../App'; +import {useIsFocused} from 'react-navigation-hooks'; import Container from '../../components/Container'; +import {NotesPlaceHolder} from '../../components/ListPlaceholders'; import NoteItem from '../../components/NoteItem'; import SelectionWrapper from '../../components/SelectionWrapper'; +import SimpleList from '../../components/SimpleList'; import {useTracked} from '../../provider'; -import {SIZE, WEIGHT} from '../../common/common'; import {ACTIONS} from '../../provider/actions'; -import {ToastEvent, editing, SideMenuEvent} from '../../utils/utils'; import { eSendEvent, eSubscribeEvent, eUnSubscribeEvent, } from '../../services/eventManager'; import { + eOnLoadNote, eScrollEvent, refreshNotesPage, - eOnLoadNote, } from '../../services/events'; -import {NotesPlaceHolder} from '../../components/ListPlaceholders'; -import {useIsFocused} from 'react-navigation-hooks'; import {openEditorAnimation} from '../../utils/animations'; -import {inputRef} from '../../components/SearchInput'; -import SimpleList from '../../components/SimpleList'; +import {db, DDS, editing, SideMenuEvent, ToastEvent} from '../../utils/utils'; export const Notes = ({navigation}) => { const [state, dispatch] = useTracked(); diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js index 521d66625..abc693808 100644 --- a/apps/mobile/src/views/Settings/index.js +++ b/apps/mobile/src/views/Settings/index.js @@ -9,7 +9,6 @@ import { } from 'react-native'; import MMKV from 'react-native-mmkv-storage'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {DDS} from '../../../App'; import { ACCENT, COLOR_SCHEME, @@ -28,7 +27,7 @@ import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eOpenLoginDialog} from '../../services/events'; import NavigationService from '../../services/NavigationService'; -import {hexToRGBA, w} from '../../utils/utils'; +import {hexToRGBA, w, DDS} from '../../utils/utils'; export async function setSetting(settings, name, value) { let s = {...settings}; diff --git a/apps/mobile/src/views/Signup/index.js b/apps/mobile/src/views/Signup/index.js index 4a0aea022..8fa3bd563 100644 --- a/apps/mobile/src/views/Signup/index.js +++ b/apps/mobile/src/views/Signup/index.js @@ -2,7 +2,6 @@ import React, {createRef, useEffect, useState} from 'react'; import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native'; import {TextInput} from 'react-native-gesture-handler'; import {useIsFocused} from 'react-navigation-hooks'; -import {DDS, db} from '../../../App'; import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {Header} from '../../components/header'; import {useTracked} from '../../provider'; @@ -12,15 +11,15 @@ import * as Animatable from 'react-native-animatable'; const _email = createRef(); const _pass = createRef(); const _username = createRef(); - import { validateUsername, validateEmail, validatePass, } from '../../services/validation'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {ToastEvent} from '../../utils/utils'; +import {ToastEvent, db, DDS} from '../../utils/utils'; import {ACTIONS} from '../../provider/actions'; + export const Signup = ({navigation}) => { const [state, dispatch] = useTracked(); const {colors, isLoginNavigator} = state; diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js index 2b98f5a45..0a57139f0 100644 --- a/apps/mobile/src/views/Trash/index.js +++ b/apps/mobile/src/views/Trash/index.js @@ -1,6 +1,5 @@ import React, {useEffect, useState} from 'react'; -import {FlatList, Text, View, RefreshControl} from 'react-native'; -import {SIZE, WEIGHT} from '../../common/common'; +import {useIsFocused} from 'react-navigation-hooks'; import Container from '../../components/Container'; import { simpleDialogEvent, @@ -9,13 +8,11 @@ import { import {TrashPlaceHolder} from '../../components/ListPlaceholders'; import {NotebookItem} from '../../components/NotebookItem'; import NoteItem from '../../components/NoteItem'; +import SelectionWrapper from '../../components/SelectionWrapper'; +import SimpleList from '../../components/SimpleList'; import {useTracked} from '../../provider'; import {ACTIONS} from '../../provider/actions'; -import {w, ToastEvent} from '../../utils/utils'; -import SelectionWrapper from '../../components/SelectionWrapper'; -import {useIsFocused} from 'react-navigation-hooks'; -import {inputRef} from '../../components/SearchInput'; -import SimpleList from '../../components/SimpleList'; +import {db, ToastEvent, w} from '../../utils/utils'; export const Trash = ({navigation}) => { const [state, dispatch] = useTracked();