Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

minor fixes and improvements

ammarahm-ed6555124234d8
diff --git a/apps/mobile/App.js b/apps/mobile/App.js
index 6bed146eb..2a2552df3 100644
--- a/apps/mobile/App.js
+++ b/apps/mobile/App.js
@@ -27,6 +27,7 @@ import {DeviceDetectionService} from './src/utils/deviceDetection';
import StorageInterface from './src/utils/storage';
import {w} from './src/utils/utils';
import Editor from './src/views/Editor';
+import Animated, {Easing} from 'react-native-reanimated';
export const DDS = new DeviceDetectionService();
export const db = new Storage(StorageInterface);
@@ -34,6 +35,9 @@ export const db = new Storage(StorageInterface);
let sideMenuRef;
let editorRef;
let outColors;
+
+const {color, Value, timing, interpolate} = Animated;
+
const App = () => {
const [state, dispatch] = useTracked();
const {colors, loading} = state;
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 4abe78d67..4d8f72c45 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -336,23 +336,17 @@ export const ActionSheetComponent = ({
const _renderColor = color => (
<TouchableOpacity
key={color}
- onPress={() => {
+ onPress={async () => {
let noteColors = note.colors;
if (noteColors.includes(color)) {
- noteColors.splice(color, 1);
+ await db.notes.note(note.id).uncolor(color);
} else {
noteColors.push(color);
}
- //db.notes.note(note.id).
- // TODO
- /* db.addNote({
- dateCreated: note.dateCreated,
- colors: noteColors,
- content: note.content,
- title: note.title,
- }); */
+ await db.notes.note(note.id).color(color);
+
localRefresh(item.type);
}}
style={{
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index 8aff9f39d..fd6ecbb03 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -401,7 +401,7 @@ export class DialogManager extends Component {
}
: null
}
- initialOffsetFromBottom={DDS.isTab ? 1 : 0.5}
+ initialOffsetFromBottom={DDS.isTab || item.type !== 'note' ? 1 : 0.5}
bounceOnOpen={true}
gestureEnabled={true}
onClose={() => {
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index a6078cf65..ebb1fc927 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -6,6 +6,7 @@ import {
Text,
TouchableOpacity,
View,
+ SafeAreaView,
} from 'react-native';
import FastStorage from 'react-native-fast-storage';
import Icon from 'react-native-vector-icons/Feather';
@@ -124,14 +125,12 @@ export const Menu = ({
];
return (
- <AnimatedSafeAreaView
- transition="backgroundColor"
- duration={400}
+ <SafeAreaView
style={{
height: '100%',
opacity: hide ? 0 : 1,
- backgroundColor: colors.shade,
width: '100%',
+ backgroundColor: colors.shade,
borderRightWidth: noTextMode ? 1 : 0,
borderRightColor: noTextMode ? colors.accent : 'transparent',
}}>
@@ -537,6 +536,6 @@ export const Menu = ({
</Text>
</View> */}
</View>
- </AnimatedSafeAreaView>
+ </SafeAreaView>
);
};
diff --git a/apps/mobile/src/components/SearchInput/index.js b/apps/mobile/src/components/SearchInput/index.js
index 6785cd1a5..cdca5f892 100644
--- a/apps/mobile/src/components/SearchInput/index.js
+++ b/apps/mobile/src/components/SearchInput/index.js
@@ -1,19 +1,44 @@
-import React, {createRef, useState} from 'react';
+import React, {createRef, useState, useEffect} from 'react';
import {TextInput} from 'react-native';
import * as Animatable from 'react-native-animatable';
import Icon from 'react-native-vector-icons/Feather';
import {DDS} from '../../../App';
import {br, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider';
+import Animated, {Easing} from 'react-native-reanimated';
+
+const {Value, timing, block} = Animated;
+
export const Search = props => {
const [state, dispatch] = useTracked();
const {colors} = state;
const [focus, setFocus] = useState(false);
const inputRef = createRef();
+ const _marginAnim = new Value(0);
+ const _opacity = new Value(1);
+ const _borderAnim = new Value(1.5);
+
+ useEffect(() => {
+ timing(_marginAnim, {
+ toValue: props.hide ? -65 : 0,
+ duration: 230,
+ easing: Easing.inOut(Easing.ease),
+ }).start();
+ timing(_opacity, {
+ toValue: props.hide ? 0 : 1,
+ duration: 250,
+ easing: Easing.inOut(Easing.ease),
+ }).start();
+ timing(_borderAnim, {
+ toValue: props.hide ? 0 : 1.5,
+ duration: 270,
+ easing: Easing.inOut(Easing.ease),
+ }).start();
+ }, [props.hide]);
return (
- <Animatable.View
+ <Animated.View
transition={['marginTop', 'opacity']}
duration={200}
style={{
@@ -23,7 +48,7 @@ export const Search = props => {
marginTop: props.hide ? -65 : 0,
paddingHorizontal: 12,
}}>
- <Animatable.View
+ <Animated.View
transition={['borderWidth']}
duration={300}
style={{
@@ -74,7 +99,7 @@ export const Search = props => {
color={focus ? colors.accent : colors.icon}
size={SIZE.xl}
/>
- </Animatable.View>
- </Animatable.View>
+ </Animated.View>
+ </Animated.View>
);
};
diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js
index b4a5207f8..118231069 100644
--- a/apps/mobile/src/components/SelectionWrapper/index.js
+++ b/apps/mobile/src/components/SelectionWrapper/index.js
@@ -4,6 +4,8 @@ import Icon from 'react-native-vector-icons/Feather';
import {SIZE} from '../../common/common';
import {useTracked} from '../../provider';
import {ACTIONS} from '../../provider/actions';
+import Animated from 'react-native-reanimated';
+
const SelectionWrapper = ({children, item, currentEditingNote, index}) => {
const [state, dispatch] = useTracked();
const {colors, selectionMode, selectedItemsList} = state;
@@ -72,6 +74,7 @@ const SelectionWrapper = ({children, item, currentEditingNote, index}) => {
</View>
</TouchableWithoutFeedback>
</View>
+
{children}
</View>
);