Skip to content

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

fix tabs on mobile

ammarahm-ed21f3872404e0
diff --git a/apps/mobile/src/components/tabs/index.tsx b/apps/mobile/src/components/tabs/index.tsx
index f25af060e..af46a21c1 100644
--- a/apps/mobile/src/components/tabs/index.tsx
+++ b/apps/mobile/src/components/tabs/index.tsx
@@ -46,6 +46,7 @@ export const FluidTabs = forwardRef<TabsRef, TabProps>(
ref
) => {
const deviceMode = useSettingStore(state => state.deviceMode);
+ const introCompleted = useSettingStore(state => state.settings.introCompleted);
const translateX = useSharedValue(widths ? widths.a : 0);
const startX = useSharedValue(0);
const currentTab = useSharedValue(1);
@@ -68,9 +69,11 @@ export const FluidTabs = forwardRef<TabsRef, TabProps>(
const isLoaded = useRef(false);
useEffect(() => {
- if (!isLoaded.current) {
+ if (!isLoaded.current && introCompleted && deviceMode === 'tablet') {
translateX.value = 0;
isLoaded.current = true;
+ } else {
+ isLoaded.current = true;
}
const sub = BackHandler.addEventListener('hardwareBackPress', () => {
if (isDrawerOpen.value) {
@@ -90,7 +93,6 @@ export const FluidTabs = forwardRef<TabsRef, TabProps>(
ref,
(): TabsRef => ({
goToPage: (page: number) => {
- translateX.value = 0;
if (deviceMode === 'tablet') {
translateX.value = withTiming(0);
return;
diff --git a/apps/mobile/src/screens/editor/wrapper.js b/apps/mobile/src/screens/editor/wrapper.js
index a1da06554..85008d6f5 100644
--- a/apps/mobile/src/screens/editor/wrapper.js
+++ b/apps/mobile/src/screens/editor/wrapper.js
@@ -57,7 +57,9 @@ export const EditorWrapper = ({ width }) => {
marginBottom:
Platform.OS === 'ios'
? keyboard?.keyboardShown && !floating
- ? 16
+ ? Platform.isPad
+ ? 16
+ : insets.bottom
: insets.bottom
: 6
}}