Skip to content

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

minor fixes

ammarahm-ed3a66e5bfdfb8
diff --git a/apps/mobile/src/navigation/Drawer.js b/apps/mobile/src/navigation/Drawer.js
index 3d284621a..dd4a751c4 100644
--- a/apps/mobile/src/navigation/Drawer.js
+++ b/apps/mobile/src/navigation/Drawer.js
@@ -43,7 +43,7 @@ export const NavigationStack = ({component = NavigatorStack}) => {
}, []);
return (
- <NavigationContainer ref={sideMenuRef}>
+ <NavigationContainer ref={sideMenuRef}>
<Drawer.Navigator
screenOptions={{
swipeEnabled: locked || deviceMode !== 'mobile' ? false : true,
diff --git a/apps/mobile/src/navigation/NavigatorStack.js b/apps/mobile/src/navigation/NavigatorStack.js
index a318ac5cb..f09aff1bd 100644
--- a/apps/mobile/src/navigation/NavigatorStack.js
+++ b/apps/mobile/src/navigation/NavigatorStack.js
@@ -65,11 +65,16 @@ const forSlide = ({current, next, inverted, layouts: {screen}}) => {
};
};
+const screenOptionsForAnimation = {
+ animationEnabled: true,
+ cardStyleInterpolator: forSlide,
+};
+
export const NavigatorStack = React.memo(
() => {
React.useEffect(() => {
sleep(1000).then(() => {
- console.log(SettingsService.get().homepage)
+ console.log(SettingsService.get().homepage);
let headerState = {
heading: SettingsService.get().homepage,
id: SettingsService.get().homepage.toLowerCase() + '_navigation',
@@ -86,25 +91,29 @@ export const NavigatorStack = React.memo(
initialRouteName={SettingsService.get().homepage}
screenOptions={{
headerShown: false,
- cardStyleInterpolator: forFade,
+ animationEnabled: false,
}}>
<Stack.Screen name="Notes" component={Home} />
- <Stack.Screen
- initialParams={{
- title: 'Notebooks',
- canGoBack: false,
- root: true,
- }}
- name="Notebooks"
- component={Folders}
- />
+ <Stack.Screen name="Notebooks" component={Folders} />
<Stack.Screen name="Favorites" component={Favorites} />
<Stack.Screen name="Trash" component={Trash} />
- <Stack.Screen name="NotesPage" component={Notes} />
+ <Stack.Screen
+ options={screenOptionsForAnimation}
+ name="NotesPage"
+ component={Notes}
+ />
<Stack.Screen name="Tags" component={Tags} />
- <Stack.Screen name="Notebook" component={Notebook} />
+ <Stack.Screen
+ options={screenOptionsForAnimation}
+ name="Notebook"
+ component={Notebook}
+ />
<Stack.Screen name="Settings" component={Settings} />
- <Stack.Screen name="Search" component={Search} />
+ <Stack.Screen
+ options={screenOptionsForAnimation}
+ name="Search"
+ component={Search}
+ />
</Stack.Navigator>
</NavigationContainer>
</Container>
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index a1923be1d..039c820f1 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -1,4 +1,4 @@
-import React, {createRef, useCallback, useEffect} from 'react';
+import React, {createRef, useCallback, useEffect, useState} from 'react';
import {
Appearance,
Linking,
@@ -207,6 +207,7 @@ const CustomButton = ({
}) => {
const [state] = useTracked();
const {colors} = state;
+ const [visible, setVisible] = useState(false);
return (
<PressableButton
color="transparent"
@@ -244,7 +245,7 @@ const CustomButton = ({
const SettingsUserSection = () => {
const [state, dispatch] = useTracked();
const {colors, user} = state;
-
+ const [visible, setVisible] = useState(false);
const getTimeLeft = (t2) => {
let d1 = new Date(Date.now());
let d2 = new Date(t2 * 1000);
@@ -256,6 +257,36 @@ const SettingsUserSection = () => {
return user ? (
<>
+ {visible && (
+ <BaseDialog visible={true}>
+ <View
+ style={{
+ ...getElevation(5),
+ width: DDS.isTab ? 350 : '80%',
+ maxHeight: 350,
+ borderRadius: 5,
+ backgroundColor: colors.bg,
+ paddingHorizontal: ph,
+ paddingVertical: pv,
+ }}>
+ <DialogHeader
+ title="Logout"
+ paragraph="Clear all your data and reset the app."
+ />
+ <DialogButtons
+ positiveTitle="Logout"
+ negativeTitle="Cancel"
+ onPressNegative={() => setVisible(false)}
+ onPressPositive={async () => {
+ await db.user.logout();
+ dispatch({type: Actions.USER, user: null});
+ dispatch({type: Actions.CLEAR_ALL});
+ dispatch({type: Actions.SYNCING, syncing: false});
+ }}
+ />
+ </View>
+ </BaseDialog>
+ )}
<View
style={{
paddingHorizontal: 12,
@@ -360,18 +391,14 @@ const SettingsUserSection = () => {
eSendEvent(eOpenRecoveryKeyDialog);
},
desc:
- 'If you lose your password, you can recover your data using your recovery key.',
+ 'Recover your data using the recovery key if your password is lost.',
},
{
name: 'Logout',
func: async () => {
- await db.user.logout();
- dispatch({type: Actions.USER, user: null});
- dispatch({type: Actions.CLEAR_ALL});
- dispatch({type: Actions.SYNCING, syncing: false});
+ setVisible(true);
},
- desc:
- 'Logout of your account, this will clear everything and reset the app.',
+ desc: 'This will clear all data and reset the app.',
},
].map((item) => (
<CustomButton