A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
make navigation transition smooth
Ammar Ahmedb8d304325230
diff --git a/apps/mobile/src/components/delaylayout/index.tsx b/apps/mobile/src/components/delaylayout/index.tsxindex 213db3f0a..2357eeb3c 100644--- a/apps/mobile/src/components/delaylayout/index.tsx+++ b/apps/mobile/src/components/delaylayout/index.tsx@@ -19,7 +19,7 @@ const placeholder = {export default function DelayLayout(props: IDelayLayoutProps) {const colors = useThemeStore(state => state.colors);- const loading = useDelayLayout(props.delay || 300);+ const loading = useDelayLayout(!props.delay || props.delay < 300 ? 300 : props.delay);const Placeholder = placeholder[props.type || 'default'];diff --git a/apps/mobile/src/screens/settings/group.tsx b/apps/mobile/src/screens/settings/group.tsxindex 52c63f334..47ac70785 100644--- a/apps/mobile/src/screens/settings/group.tsx+++ b/apps/mobile/src/screens/settings/group.tsx@@ -38,7 +38,7 @@ const Group = ({ navigation, route }: NativeStackScreenProps<RouteParams, 'Setti);return (- <DelayLayout type="settings" delay={100}>+ <DelayLayout type="settings" delay={300}><Viewstyle={{flex: 1diff --git a/apps/mobile/src/screens/settings/home.tsx b/apps/mobile/src/screens/settings/home.tsxindex 50112a0b0..7247f1320 100644--- a/apps/mobile/src/screens/settings/home.tsx+++ b/apps/mobile/src/screens/settings/home.tsx@@ -44,7 +44,7 @@ const Home = ({ navigation, route }: NativeStackScreenProps<RouteParams, 'Settin}, []);return (- <DelayLayout delay={100} type="settings">+ <DelayLayout delay={300} type="settings"><View>{loading && (//@ts-ignorediff --git a/apps/mobile/src/utils/hooks/useDelayLayout.ts b/apps/mobile/src/utils/hooks/useDelayLayout.tsindex d9eec5d7c..9d11a03b2 100644--- a/apps/mobile/src/utils/hooks/useDelayLayout.ts+++ b/apps/mobile/src/utils/hooks/useDelayLayout.ts@@ -1,13 +1,18 @@import { useEffect, useState } from 'react';+import { InteractionManager } from 'react-native';export const useDelayLayout = (delay: number) => {const [loading, setLoading] = useState(true);useEffect(() => {+ let cancel: () => void;let timeout = setTimeout(() => {- setLoading(false);+ cancel = InteractionManager.runAfterInteractions(() => {+ setLoading(false);+ }).cancel;}, delay);return () => {+ cancel && cancel();clearTimeout(timeout);};}, [delay]);