This commit is contained in:
ammarahm-ed
2020-03-14 13:54:16 +05:00
parent e07b70032e
commit a2a6e645e7
32 changed files with 67 additions and 86 deletions

View File

@@ -1,4 +1,3 @@
import Storage from 'notes-core/api/index';
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {Platform, StatusBar, View, Text} from 'react-native'; import {Platform, StatusBar, View, Text} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
@@ -30,16 +29,12 @@ import {
import NavigationService, { import NavigationService, {
AppContainer, AppContainer,
} from './src/services/NavigationService'; } from './src/services/NavigationService';
import {DeviceDetectionService} from './src/utils/deviceDetection'; import {w, DDS, db} from './src/utils/utils';
import StorageInterface from './src/utils/storage';
import {w} from './src/utils/utils';
import Editor from './src/views/Editor'; import Editor from './src/views/Editor';
import Animated from 'react-native-reanimated'; import Animated from 'react-native-reanimated';
import MMKV from 'react-native-mmkv-storage'; import MMKV from 'react-native-mmkv-storage';
import {defaultState} from './src/provider/defaultState'; import {defaultState} from './src/provider/defaultState';
import {EditorPosition} from './src/utils/animations'; import {EditorPosition} from './src/utils/animations';
export const DDS = new DeviceDetectionService();
export const db = new Storage(StorageInterface);
let sideMenuRef; let sideMenuRef;
let editorRef; let editorRef;

View File

@@ -10,7 +10,6 @@ import {
import MMKV from 'react-native-mmkv-storage'; import MMKV from 'react-native-mmkv-storage';
import Share from 'react-native-share'; import Share from 'react-native-share';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {db, DDS} from '../../../App';
import { import {
ACCENT, ACCENT,
COLOR_SCHEME, COLOR_SCHEME,
@@ -26,7 +25,7 @@ import {
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import NavigationService from '../../services/NavigationService'; import NavigationService from '../../services/NavigationService';
import {timeConverter, ToastEvent} from '../../utils/utils'; import {timeConverter, ToastEvent, DDS, db} from '../../utils/utils';
import {openVault} from '../../services/eventManager'; import {openVault} from '../../services/eventManager';
const w = Dimensions.get('window').width; const w = Dimensions.get('window').width;

View File

@@ -9,10 +9,10 @@ import {
} from 'react-native'; } from 'react-native';
import {FlatList, TextInput} from 'react-native-gesture-handler'; import {FlatList, TextInput} from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {db, DDS} from '../../../App';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {getElevation, ToastEvent} from '../../utils/utils'; import {getElevation, ToastEvent, db, DDS} from '../../utils/utils';
import {updateEvent} from '../DialogManager/recievers'; import {updateEvent} from '../DialogManager/recievers';
let refs = []; let refs = [];

View File

@@ -4,8 +4,8 @@ import {TextInput} from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {getElevation, ToastEvent} from '../../utils/utils'; import {getElevation, ToastEvent, db} from '../../utils/utils';
import {db} from '../../../App';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eOnNewTopicAdded} from '../../services/events'; import {eOnNewTopicAdded} from '../../services/events';

View File

@@ -12,14 +12,14 @@ import * as Animatable from 'react-native-animatable';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {br, opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {br, opacity, pv, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';
import {eScrollEvent, eOpenLoginDialog} from '../../services/events'; import {eScrollEvent} from '../../services/events';
import {getElevation, h, w, ToastEvent} from '../../utils/utils'; import {db, getElevation, ToastEvent} from '../../utils/utils';
import {Header} from '../header'; import {Header} from '../header';
import {Search} from '../SearchInput'; import {Search} from '../SearchInput';
import SelectionHeader from '../SelectionHeader'; import SelectionHeader from '../SelectionHeader';
import {DDS, db} from '../../../App';
import {ACTIONS} from '../../provider/actions';
export const AnimatedSafeAreaView = Animatable.createAnimatableComponent( export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(
SafeAreaView, SafeAreaView,
); );

View File

@@ -1,7 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Modal, Text, TouchableOpacity, View} from 'react-native'; import {Modal, Text, TouchableOpacity, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {db, DDS} from '../../../App';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
@@ -12,7 +11,14 @@ import {
} from '../../services/events'; } from '../../services/events';
import NavigationService from '../../services/NavigationService'; import NavigationService from '../../services/NavigationService';
import {exitEditorAnimation} from '../../utils/animations'; 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 {updateEvent} from '../DialogManager/recievers';
import {dialogActions} from '../DialogManager/dialogActions'; import {dialogActions} from '../DialogManager/dialogActions';

View File

@@ -1,5 +1,4 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {DDS} from '../../../App';
import { import {
eSubscribeEvent, eSubscribeEvent,
eUnSubscribeEvent, eUnSubscribeEvent,
@@ -28,7 +27,7 @@ import {Dialog} from '../Dialog';
import LoginDialog from '../LoginDialog'; import LoginDialog from '../LoginDialog';
import MoveNoteDialog from '../MoveNoteDialog'; import MoveNoteDialog from '../MoveNoteDialog';
import {VaultDialog} from '../VaultDialog'; import {VaultDialog} from '../VaultDialog';
import {hexToRGBA} from '../../utils/utils'; import {hexToRGBA, DDS} from '../../utils/utils';
import {Platform} from 'react-native'; import {Platform} from 'react-native';
import {TEMPLATE_DELETE, TEMPLATE_PERMANANT_DELETE} from './templates'; import {TEMPLATE_DELETE, TEMPLATE_PERMANANT_DELETE} from './templates';
import {moveNoteEvent} from './recievers'; import {moveNoteEvent} from './recievers';

View File

@@ -23,8 +23,7 @@ import {
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {AnimatedSafeAreaView} from '../../views/Home'; import {AnimatedSafeAreaView} from '../../views/Home';
import {db} from '../../../App'; import {w, hexToRGBA, db} from '../../utils/utils';
import {w, hexToRGBA} from '../../utils/utils';
let tagsInputRef; let tagsInputRef;
let tagsList; let tagsList;

View File

@@ -3,12 +3,11 @@ import {Modal, TouchableOpacity, View} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import {createAppContainer} from 'react-navigation'; import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack'; import {createStackNavigator} from 'react-navigation-stack';
import {DDS} from '../../../App';
import {normalize} from '../../common/common'; import {normalize} from '../../common/common';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eLoginDialogNavigateBack} from '../../services/events'; import {eLoginDialogNavigateBack} from '../../services/events';
import {getElevation} from '../../utils/utils'; import {getElevation, DDS} from '../../utils/utils';
import ForgotPassword from '../../views/ForgotPassword'; import ForgotPassword from '../../views/ForgotPassword';
import Login from '../../views/Login'; import Login from '../../views/Login';
import Signup from '../../views/Signup'; import Signup from '../../views/Signup';

View File

@@ -10,7 +10,6 @@ import {
} from 'react-native'; } from 'react-native';
import MMKV from 'react-native-mmkv-storage'; import MMKV from 'react-native-mmkv-storage';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {DDS, db} from '../../../App';
import { import {
ACCENT, ACCENT,
COLOR_SCHEME, COLOR_SCHEME,
@@ -29,7 +28,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eOpenModalMenu, eSendSideMenuOverlayRef} from '../../services/events'; import {eOpenModalMenu, eSendSideMenuOverlayRef} from '../../services/events';
import NavigationService from '../../services/NavigationService'; 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'; import {inputRef} from '../SearchInput';
export const Menu = ({ export const Menu = ({

View File

@@ -3,11 +3,10 @@ import {Modal, TouchableOpacity, View} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import {createAppContainer} from 'react-navigation'; import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack'; import {createStackNavigator} from 'react-navigation-stack';
import {DDS} from '../../../App';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eMoveNoteDialogNavigateBack} from '../../services/events'; import {eMoveNoteDialogNavigateBack} from '../../services/events';
import {getElevation} from '../../utils/utils'; import {getElevation, DDS} from '../../utils/utils';
import Folders from '../../views/Folders'; import Folders from '../../views/Folders';
import Notebook from '../../views/Notebook'; import Notebook from '../../views/Notebook';
import Notes from '../../views/Notes'; import Notes from '../../views/Notes';

View File

@@ -1,12 +1,11 @@
import React from 'react'; import React from 'react';
import {Dimensions, Text, TouchableOpacity, View} from 'react-native'; import {Dimensions, Text, TouchableOpacity, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {DDS} from '../../../App';
import {ph, pv, SIZE, WEIGHT} from '../../common/common'; import {ph, pv, SIZE, WEIGHT} from '../../common/common';
import {eSendEvent, openVault} from '../../services/eventManager'; import {eSendEvent, openVault} from '../../services/eventManager';
import {eOnLoadNote} from '../../services/events'; import {eOnLoadNote} from '../../services/events';
import {openEditorAnimation} from '../../utils/animations'; 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 {ActionSheetEvent, simpleDialogEvent} from '../DialogManager/recievers';
import {TEMPLATE_TRASH} from '../DialogManager/templates'; import {TEMPLATE_TRASH} from '../DialogManager/templates';

View File

@@ -4,9 +4,9 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import NavigationService from '../../services/NavigationService'; 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 {ActionSheetEvent, moveNoteHideEvent} from '../DialogManager';
import {db} from '../../../App';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
export const NotebookItem = ({ export const NotebookItem = ({

View File

@@ -13,11 +13,11 @@ import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eScrollEvent} from '../../services/events'; import {eScrollEvent} from '../../services/events';
import {ToastEvent, hexToRGBA} from '../../utils/utils'; import {ToastEvent, hexToRGBA, DDS, db} from '../../utils/utils';
import {NotesPlaceHolder} from '../ListPlaceholders'; import {NotesPlaceHolder} from '../ListPlaceholders';
import NoteItem from '../NoteItem'; import NoteItem from '../NoteItem';
import SelectionWrapper from '../SelectionWrapper'; import SelectionWrapper from '../SelectionWrapper';
import {db, DDS} from '../../../App';
import {inputRef} from '../SearchInput'; import {inputRef} from '../SearchInput';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';

View File

@@ -2,9 +2,10 @@ import React, {createRef, useEffect, useState} from 'react';
import {TextInput} from 'react-native'; import {TextInput} from 'react-native';
import Animated, {Easing} from 'react-native-reanimated'; import Animated, {Easing} from 'react-native-reanimated';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {DDS} from '../../../App';
import {br, SIZE, WEIGHT} from '../../common/common'; import {br, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {DDS} from '../../utils/utils';
const {Value, timing, block} = Animated; const {Value, timing, block} = Animated;

View File

@@ -12,10 +12,10 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {SIZE, WEIGHT} from '../../common/common'; import {SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {w, ToastEvent} from '../../utils/utils'; import {w, ToastEvent, db} from '../../utils/utils';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eOpenMoveNoteDialog, eOpenSimpleDialog} from '../../services/events'; import {eOpenMoveNoteDialog, eOpenSimpleDialog} from '../../services/events';
import {db} from '../../../App';
import {TEMPLATE_DELETE} from '../DialogManager'; import {TEMPLATE_DELETE} from '../DialogManager';
export const AnimatedSafeAreaView = Animatable.createAnimatableComponent( export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(

View File

@@ -5,9 +5,8 @@ import {opacity, ph, SIZE, WEIGHT, normalize, pv} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';
import {eHideToast, eShowToast} from '../../services/events'; 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 Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {DDS} from '../../../App';
const AnimatedTouchableOpacity = Animatable.createAnimatableComponent( const AnimatedTouchableOpacity = Animatable.createAnimatableComponent(
TouchableOpacity, TouchableOpacity,

View File

@@ -3,8 +3,8 @@ import {View, Text, TouchableOpacity, Modal, ToastAndroid} from 'react-native';
import {SIZE, ph, pv, opacity, WEIGHT} from '../../common/common'; import {SIZE, ph, pv, opacity, WEIGHT} from '../../common/common';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {TextInput} from 'react-native-gesture-handler'; 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 Share from 'react-native-share';
import { import {
eSendEvent, eSendEvent,

View File

@@ -1,13 +1,13 @@
import React, {createRef} from 'react'; import React, {createRef} from 'react';
import {Platform, StatusBar, Text, TouchableOpacity, View} from 'react-native'; import {Platform, StatusBar, Text, TouchableOpacity, View} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import {DDS} from '../../../App';
import {SIZE, WEIGHT} from '../../common/common'; import {SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eCloseLoginDialog} from '../../services/events'; import {eCloseLoginDialog} from '../../services/events';
import NavigationService from '../../services/NavigationService'; import NavigationService from '../../services/NavigationService';
import {SideMenuEvent} from '../../utils/utils'; import {SideMenuEvent, DDS} from '../../utils/utils';
import {moveNoteHideEvent} from '../DialogManager'; import {moveNoteHideEvent} from '../DialogManager';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import Menu, {MenuItem, MenuDivider} from 'react-native-material-menu'; import Menu, {MenuItem, MenuDivider} from 'react-native-material-menu';

View File

@@ -1,5 +1,4 @@
import {db} from '../../App'; import {SideMenuEvent, history, db} from '../utils/utils';
import {SideMenuEvent, history} from '../utils/utils';
import {ACTIONS} from './actions'; import {ACTIONS} from './actions';
export const reducer = (state, action) => { export const reducer = (state, action) => {

View File

@@ -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 {eSendEvent} from '../services/eventManager';
import { import {
eOpenSideMenu, eOpenSideMenu,
@@ -8,6 +9,11 @@ import {
eShowToast, eShowToast,
eHideToast, eHideToast,
} from '../services/events'; } 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 => { export const getElevation = elevation => {
return { return {
elevation, elevation,

View File

@@ -12,7 +12,7 @@ import {
} from 'react-native'; } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import WebView from 'react-native-webview'; import WebView from 'react-native-webview';
import {db, DDS} from '../../../App';
import {normalize, SIZE, WEIGHT} from '../../common/common'; import {normalize, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
@@ -33,6 +33,8 @@ import {
SideMenuEvent, SideMenuEvent,
timeConverter, timeConverter,
ToastEvent, ToastEvent,
DDS,
db,
} from '../../utils/utils'; } from '../../utils/utils';
import { import {
ActionSheetEvent, ActionSheetEvent,

View File

@@ -7,7 +7,7 @@ import NoteItem from '../../components/NoteItem';
import SelectionWrapper from '../../components/SelectionWrapper'; import SelectionWrapper from '../../components/SelectionWrapper';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {ToastEvent, w} from '../../utils/utils'; import {ToastEvent, w, db} from '../../utils/utils';
import SimpleList from '../../components/SimpleList'; import SimpleList from '../../components/SimpleList';
export const Favorites = ({navigation}) => { export const Favorites = ({navigation}) => {

View File

@@ -11,7 +11,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eScrollEvent} from '../../services/events'; import {eScrollEvent} from '../../services/events';
import {slideLeft, slideRight} from '../../utils/animations'; 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'; import {AddNotebookEvent} from '../../components/DialogManager/recievers';
export const Folders = ({navigation}) => { export const Folders = ({navigation}) => {

View File

@@ -2,8 +2,7 @@ import React, {createRef, useEffect} from 'react';
import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native'; import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native';
import {TextInput} from 'react-native-gesture-handler'; import {TextInput} from 'react-native-gesture-handler';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {DDS} from '../../../App'; import {opacity, pv, SIZE, WEIGHT, DDS} from '../../common/common';
import {opacity, pv, SIZE, WEIGHT} from '../../common/common';
import {Header} from '../../components/header'; import {Header} from '../../components/header';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager'; import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';

View File

@@ -2,15 +2,13 @@ import React, {useEffect} from 'react';
import {SafeAreaView} from 'react-native'; import {SafeAreaView} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {DDS, db} from '../../../App';
import Container from '../../components/Container'; import Container from '../../components/Container';
import {NotesList} from '../../components/NotesList'; import {NotesList} from '../../components/NotesList';
import SelectionHeader from '../../components/SelectionHeader'; import SelectionHeader from '../../components/SelectionHeader';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import NavigationService from '../../services/NavigationService'; import {SideMenuEvent, DDS} from '../../utils/utils';
import {SideMenuEvent} from '../../utils/utils';
import {eScrollEvent, eOnLoadNote} from '../../services/events'; import {eScrollEvent, eOnLoadNote} from '../../services/events';
import {openEditorAnimation} from '../../utils/animations'; import {openEditorAnimation} from '../../utils/animations';
let count = 0; let count = 0;

View File

@@ -9,7 +9,7 @@ import {
} from 'react-native'; } from 'react-native';
import {TextInput} from 'react-native-gesture-handler'; import {TextInput} from 'react-native-gesture-handler';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {DDS, db} from '../../../App';
import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, pv, SIZE, WEIGHT} from '../../common/common';
import {Header} from '../../components/header'; import {Header} from '../../components/header';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
@@ -22,7 +22,7 @@ import {
validateUsername, validateUsername,
} from '../../services/validation'; } from '../../services/validation';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; 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'; import {ACTIONS} from '../../provider/actions';
export const Login = ({navigation}) => { export const Login = ({navigation}) => {

View File

@@ -1,6 +1,5 @@
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {db} from '../../../App';
import Container from '../../components/Container'; import Container from '../../components/Container';
import {NotebookItem} from '../../components/NotebookItem'; import {NotebookItem} from '../../components/NotebookItem';
import SelectionWrapper from '../../components/SelectionWrapper'; import SelectionWrapper from '../../components/SelectionWrapper';
@@ -16,7 +15,7 @@ import {
eOnNewTopicAdded, eOnNewTopicAdded,
eScrollEvent, eScrollEvent,
} from '../../services/events'; } from '../../services/events';
import {ToastEvent, w} from '../../utils/utils'; import {ToastEvent, w, db} from '../../utils/utils';
import SimpleList from '../../components/SimpleList'; import SimpleList from '../../components/SimpleList';
import {NotebookPlaceHolder} from '../../components/ListPlaceholders'; import {NotebookPlaceHolder} from '../../components/ListPlaceholders';
import {AddTopicEvent} from '../../components/DialogManager/recievers'; import {AddTopicEvent} from '../../components/DialogManager/recievers';

View File

@@ -1,35 +1,24 @@
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import { import {useIsFocused} from 'react-navigation-hooks';
FlatList,
Text,
View,
Platform,
RefreshControl,
ActivityIndicator,
} from 'react-native';
import {db, DDS} from '../../../App';
import Container from '../../components/Container'; import Container from '../../components/Container';
import {NotesPlaceHolder} from '../../components/ListPlaceholders';
import NoteItem from '../../components/NoteItem'; import NoteItem from '../../components/NoteItem';
import SelectionWrapper from '../../components/SelectionWrapper'; import SelectionWrapper from '../../components/SelectionWrapper';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {SIZE, WEIGHT} from '../../common/common';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {ToastEvent, editing, SideMenuEvent} from '../../utils/utils';
import { import {
eSendEvent, eSendEvent,
eSubscribeEvent, eSubscribeEvent,
eUnSubscribeEvent, eUnSubscribeEvent,
} from '../../services/eventManager'; } from '../../services/eventManager';
import { import {
eOnLoadNote,
eScrollEvent, eScrollEvent,
refreshNotesPage, refreshNotesPage,
eOnLoadNote,
} from '../../services/events'; } from '../../services/events';
import {NotesPlaceHolder} from '../../components/ListPlaceholders';
import {useIsFocused} from 'react-navigation-hooks';
import {openEditorAnimation} from '../../utils/animations'; import {openEditorAnimation} from '../../utils/animations';
import {inputRef} from '../../components/SearchInput'; import {db, DDS, editing, SideMenuEvent, ToastEvent} from '../../utils/utils';
import SimpleList from '../../components/SimpleList';
export const Notes = ({navigation}) => { export const Notes = ({navigation}) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();

View File

@@ -9,7 +9,6 @@ import {
} from 'react-native'; } from 'react-native';
import MMKV from 'react-native-mmkv-storage'; import MMKV from 'react-native-mmkv-storage';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {DDS} from '../../../App';
import { import {
ACCENT, ACCENT,
COLOR_SCHEME, COLOR_SCHEME,
@@ -28,7 +27,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager'; import {eSendEvent} from '../../services/eventManager';
import {eOpenLoginDialog} from '../../services/events'; import {eOpenLoginDialog} from '../../services/events';
import NavigationService from '../../services/NavigationService'; 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) { export async function setSetting(settings, name, value) {
let s = {...settings}; let s = {...settings};

View File

@@ -2,7 +2,6 @@ import React, {createRef, useEffect, useState} from 'react';
import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native'; import {SafeAreaView, Text, TouchableOpacity, View} from 'react-native';
import {TextInput} from 'react-native-gesture-handler'; import {TextInput} from 'react-native-gesture-handler';
import {useIsFocused} from 'react-navigation-hooks'; import {useIsFocused} from 'react-navigation-hooks';
import {DDS, db} from '../../../App';
import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, pv, SIZE, WEIGHT} from '../../common/common';
import {Header} from '../../components/header'; import {Header} from '../../components/header';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
@@ -12,15 +11,15 @@ import * as Animatable from 'react-native-animatable';
const _email = createRef(); const _email = createRef();
const _pass = createRef(); const _pass = createRef();
const _username = createRef(); const _username = createRef();
import { import {
validateUsername, validateUsername,
validateEmail, validateEmail,
validatePass, validatePass,
} from '../../services/validation'; } from '../../services/validation';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; 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'; import {ACTIONS} from '../../provider/actions';
export const Signup = ({navigation}) => { export const Signup = ({navigation}) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();
const {colors, isLoginNavigator} = state; const {colors, isLoginNavigator} = state;

View File

@@ -1,6 +1,5 @@
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {FlatList, Text, View, RefreshControl} from 'react-native'; import {useIsFocused} from 'react-navigation-hooks';
import {SIZE, WEIGHT} from '../../common/common';
import Container from '../../components/Container'; import Container from '../../components/Container';
import { import {
simpleDialogEvent, simpleDialogEvent,
@@ -9,13 +8,11 @@ import {
import {TrashPlaceHolder} from '../../components/ListPlaceholders'; import {TrashPlaceHolder} from '../../components/ListPlaceholders';
import {NotebookItem} from '../../components/NotebookItem'; import {NotebookItem} from '../../components/NotebookItem';
import NoteItem from '../../components/NoteItem'; import NoteItem from '../../components/NoteItem';
import SelectionWrapper from '../../components/SelectionWrapper';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions'; import {ACTIONS} from '../../provider/actions';
import {w, ToastEvent} from '../../utils/utils'; import {db, ToastEvent, w} from '../../utils/utils';
import SelectionWrapper from '../../components/SelectionWrapper';
import {useIsFocused} from 'react-navigation-hooks';
import {inputRef} from '../../components/SearchInput';
import SimpleList from '../../components/SimpleList';
export const Trash = ({navigation}) => { export const Trash = ({navigation}) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();