Skip to content

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

change editor open animation

ammarahm-edb2d20b127b35
diff --git a/apps/mobile/index.mobile.js b/apps/mobile/index.mobile.js
index 7c8156c30..3f0450c64 100644
--- a/apps/mobile/index.mobile.js
+++ b/apps/mobile/index.mobile.js
@@ -6,7 +6,7 @@ import Animated from 'react-native-reanimated';
import {Menu} from './src/components/Menu';
import {useTracked} from './src/provider';
import {NavigationStack} from './src/services/Navigator';
-import {EditorOpacity, EditorPosition} from './src/utils/animations';
+import {EditorOpacity, EditorPosition, EditorScale} from './src/utils/animations';
import {sideMenuRef} from './src/utils/refs';
import {DDS} from './src/utils/utils';
import Editor from './src/views/Editor';
@@ -100,6 +100,12 @@ export const Initialize = () => {
{
translateX: EditorPosition,
},
+ {
+ scaleX:EditorScale,
+ },
+ {
+ scaleY:EditorScale
+ }
],
}}>
<Editor noMenu={false} />
diff --git a/apps/mobile/src/components/AddTopicDialog/index.js b/apps/mobile/src/components/AddTopicDialog/index.js
index 807c7bc03..6a89d6807 100644
--- a/apps/mobile/src/components/AddTopicDialog/index.js
+++ b/apps/mobile/src/components/AddTopicDialog/index.js
@@ -3,9 +3,7 @@ import {Modal, Text, TouchableOpacity, View} from 'react-native';
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, db} from '../../utils/utils';
-
import {eSendEvent} from '../../services/eventManager';
import {eOnNewTopicAdded} from '../../services/events';
import {Toast} from '../Toast';
@@ -26,11 +24,13 @@ export class AddTopicDialog extends React.Component {
if (!this.title)
return ToastEvent.show('Title is required', 'error', 'local');
- await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
+ if (!this.props.toEdit) {
+ await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
+ } else {
+ }
this.close();
- eSendEvent(eOnNewTopicAdded);
-
ToastEvent.show('New topic added', 'success');
+ eSendEvent(eOnNewTopicAdded);
};
open() {
@@ -165,7 +165,7 @@ export class AddTopicDialog extends React.Component {
color: 'white',
fontSize: SIZE.sm,
}}>
- Add
+ {toEdit ? 'Save' : 'Add'}
</Text>
</TouchableOpacity>
diff --git a/apps/mobile/src/utils/animations.js b/apps/mobile/src/utils/animations.js
index ec9628664..4fff4d9b6 100644
--- a/apps/mobile/src/utils/animations.js
+++ b/apps/mobile/src/utils/animations.js
@@ -5,7 +5,7 @@ import {editing} from './utils';
const {color, Value, timing} = Animated;
export const EditorPosition = new Value(Dimensions.get('window').width * 1.5);
-
+export const EditorScale = new Value(0.99);
export const EditorOpacity = new Value(0);
export function openEditorAnimation() {
@@ -18,8 +18,13 @@ export function openEditorAnimation() {
easing: Easing.in(Easing.linear),
};
+ timing(EditorScale, {
+ duration:300,
+ toValue:1,
+ easing: Easing.in(Easing.linear),
+ }).start();
timing(EditorOpacity, {
- duration:150,
+ duration:50,
toValue:1,
easing: Easing.in(Easing.linear),
}).start();
@@ -40,6 +45,11 @@ export function exitEditorAnimation() {
toValue:0,
easing: Easing.in(Easing.linear),
}).start();
+ timing(EditorScale, {
+ duration:150,
+ toValue:0.99,
+ easing: Easing.in(Easing.linear),
+ }).start();
timing(EditorPosition, openConfigH).start();
}
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 22b123250..ba1f57162 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -615,6 +615,7 @@ const Editor = ({noMenu}) => {
style={{
height: '100%',
maxHeight: '100%',
+ width:"100%",
backgroundColor: 'transparent',
}}
onMessage={_onMessage}
diff --git a/apps/mobile/src/views/Tags/index.js b/apps/mobile/src/views/Tags/index.js
index 3f2f0d3ce..594e46d27 100644
--- a/apps/mobile/src/views/Tags/index.js
+++ b/apps/mobile/src/views/Tags/index.js
@@ -1,12 +1,11 @@
-import React, {useEffect} from 'react';
-import {Text, TouchableOpacity, View} from 'react-native';
-import {useIsFocused} from '@react-navigation/native';
-import {pv, SIZE, WEIGHT} from '../../common/common';
-import Container from '../../components/Container';
-import {TagsPlaceHolder} from '../../components/ListPlaceholders';
+import { useIsFocused } from '@react-navigation/native';
+import React, { useEffect } from 'react';
+import { Text, TouchableOpacity, View } from 'react-native';
+import { pv, SIZE, WEIGHT } from '../../common/common';
+import { TagsPlaceHolder } from '../../components/ListPlaceholders';
import SimpleList from '../../components/SimpleList';
-import {useTracked} from '../../provider';
-import {ACTIONS} from '../../provider/actions';
+import { useTracked } from '../../provider';
+import { ACTIONS } from '../../provider/actions';
import NavigationService from '../../services/NavigationService';
export const Tags = ({route, navigation}) => {