Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix(mobile): drop the use of custom safe areas in bookmark lists

Mohamed Bassem447d2cc887d6
diff --git a/apps/mobile/app/dashboard/_layout.tsx b/apps/mobile/app/dashboard/_layout.tsx
index c5140db4..d8f9a2c7 100644
--- a/apps/mobile/app/dashboard/_layout.tsx
+++ b/apps/mobile/app/dashboard/_layout.tsx
@@ -43,8 +43,15 @@ export default function Dashboard() {
headerClassName="dark:text-white"
screenOptions={{
...Platform.select({
- ios: { headerTransparent: true },
+ ios: {
+ headerTransparent: true,
+ headerBlurEffect: "systemMaterial",
+ headerLargeTitle: true,
+ headerLargeTitleShadowVisible: false,
+ headerLargeStyle: { backgroundColor: "transparent" },
+ },
}),
+ headerShadowVisible: false,
}}
>
<Stack.Screen
@@ -54,11 +61,8 @@ export default function Dashboard() {
<Stack.Screen
name="favourites"
options={{
- headerTitle: "",
+ headerTitle: "⭐️ Favourites",
headerBackTitle: "Back",
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
}}
/>
<Stack.Screen
@@ -66,9 +70,7 @@ export default function Dashboard() {
options={{
headerTitle: "",
headerBackTitle: "Back",
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
+ headerLargeTitle: false,
}}
/>
<Stack.Screen
@@ -77,6 +79,7 @@ export default function Dashboard() {
headerTitle: "New Bookmark",
headerBackTitle: "Back",
headerTransparent: false,
+ headerLargeTitle: false,
presentation: "formSheet",
sheetGrabberVisible: true,
sheetAllowedDetents: [0.35, 0.7],
@@ -87,6 +90,7 @@ export default function Dashboard() {
options={{
headerTitle: "Manage Tags",
headerTransparent: false,
+ headerLargeTitle: false,
presentation: "formSheet",
sheetGrabberVisible: true,
}}
@@ -96,6 +100,7 @@ export default function Dashboard() {
options={{
headerTitle: "Manage Lists",
headerTransparent: false,
+ headerLargeTitle: false,
presentation: "formSheet",
sheetGrabberVisible: true,
}}
@@ -105,6 +110,7 @@ export default function Dashboard() {
options={{
headerTitle: "Info",
headerTransparent: false,
+ headerLargeTitle: false,
presentation: "formSheet",
sheetGrabberVisible: true,
}}
@@ -114,10 +120,8 @@ export default function Dashboard() {
options={{
headerTitle: "New List",
headerBackTitle: "Back",
+ headerLargeTitle: false,
presentation: "modal",
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
}}
/>
<Stack.Screen
@@ -125,20 +129,15 @@ export default function Dashboard() {
options={{
headerTitle: "Edit List",
headerBackTitle: "Back",
+ headerLargeTitle: false,
presentation: "modal",
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
}}
/>
<Stack.Screen
name="archive"
options={{
- headerTitle: "",
+ headerTitle: "🗄️ Archive",
headerBackTitle: "Back",
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
}}
/>
<Stack.Screen
@@ -149,9 +148,6 @@ export default function Dashboard() {
headerShown: false,
animation: "fade_from_bottom",
animationDuration: 100,
- ...Platform.select({
- ios: { headerTransparent: true },
- }),
}}
/>
<Stack.Screen
@@ -160,6 +156,7 @@ export default function Dashboard() {
title: "Theme",
headerTitle: "Theme",
headerBackTitle: "Back",
+ headerLargeTitle: false,
}}
/>
<Stack.Screen
@@ -168,6 +165,7 @@ export default function Dashboard() {
title: "Bookmark View Mode",
headerTitle: "Bookmark View Mode",
headerBackTitle: "Back",
+ headerLargeTitle: false,
}}
/>
<Stack.Screen
@@ -176,6 +174,7 @@ export default function Dashboard() {
title: "Reader Settings",
headerTitle: "Reader Settings",
headerBackTitle: "Back",
+ headerLargeTitle: false,
}}
/>
</StyledStack>
diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx
index a582cad6..b17339cf 100644
--- a/apps/mobile/app/dashboard/archive.tsx
+++ b/apps/mobile/app/dashboard/archive.tsx
@@ -1,22 +1,5 @@
-import { useLayoutEffect } from "react";
-import { Platform } from "react-native";
-import { useNavigation } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
-import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
export default function Archive() {
- const navigator = useNavigation();
- useLayoutEffect(() => {
- navigator.setOptions({
- headerTitle: "🗄️ Archive",
- ...Platform.select({
- ios: { headerLargeTitle: true },
- }),
- });
- }, [navigator]);
- return (
- <CustomSafeAreaView>
- <UpdatingBookmarkList query={{ archived: true }} />
- </CustomSafeAreaView>
- );
+ return <UpdatingBookmarkList query={{ archived: true }} />;
}
diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx
index 6166ed66..d4741d23 100644
--- a/apps/mobile/app/dashboard/favourites.tsx
+++ b/apps/mobile/app/dashboard/favourites.tsx
@@ -1,26 +1,11 @@
-import { useLayoutEffect } from "react";
-import { Platform } from "react-native";
-import { useNavigation } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
-import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
export default function Favourites() {
- const navigator = useNavigation();
- useLayoutEffect(() => {
- navigator.setOptions({
- headerTitle: "⭐️ Favourites",
- ...Platform.select({
- ios: { headerLargeTitle: true },
- }),
- });
- }, [navigator]);
return (
- <CustomSafeAreaView>
- <UpdatingBookmarkList
- query={{
- favourited: true,
- }}
- />
- </CustomSafeAreaView>
+ <UpdatingBookmarkList
+ query={{
+ favourited: true,
+ }}
+ />
);
}
diff --git a/apps/mobile/app/dashboard/lists/[slug]/index.tsx b/apps/mobile/app/dashboard/lists/[slug]/index.tsx
index f074388d..36ce491e 100644
--- a/apps/mobile/app/dashboard/lists/[slug]/index.tsx
+++ b/apps/mobile/app/dashboard/lists/[slug]/index.tsx
@@ -1,9 +1,8 @@
-import { Alert, Platform, View } from "react-native";
+import { Alert, Platform } from "react-native";
import * as Haptics from "expo-haptics";
import { router, Stack, useLocalSearchParams } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
import FullPageError from "@/components/FullPageError";
-import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import { MenuView } from "@react-native-menu/menu";
import { useMutation, useQuery } from "@tanstack/react-query";
@@ -25,14 +24,11 @@ export default function ListView() {
} = useQuery(api.lists.get.queryOptions({ listId: slug }));
return (
- <CustomSafeAreaView>
+ <>
<Stack.Screen
options={{
headerTitle: list ? `${list.icon} ${list.name}` : "",
headerBackTitle: "Back",
- ...Platform.select({
- ios: { headerLargeTitle: true },
- }),
headerRight: () => (
<ListActionsMenu listId={slug} role={list?.userRole ?? "viewer"} />
),
@@ -41,17 +37,15 @@ export default function ListView() {
{error ? (
<FullPageError error={error.message} onRetry={() => refetch()} />
) : list ? (
- <View>
- <UpdatingBookmarkList
- query={{
- listId: list.id,
- }}
- />
- </View>
+ <UpdatingBookmarkList
+ query={{
+ listId: list.id,
+ }}
+ />
) : (
<FullPageSpinner />
)}
- </CustomSafeAreaView>
+ </>
);
}
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx
index 2cdae41f..5fd9b886 100644
--- a/apps/mobile/app/dashboard/tags/[slug].tsx
+++ b/apps/mobile/app/dashboard/tags/[slug].tsx
@@ -1,8 +1,6 @@
-import { Platform, View } from "react-native";
import { Stack, useLocalSearchParams } from "expo-router";
import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
import FullPageError from "@/components/FullPageError";
-import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import { useQuery } from "@tanstack/react-query";
@@ -22,29 +20,24 @@ export default function TagView() {
} = useQuery(api.tags.get.queryOptions({ tagId: slug }));
return (
- <CustomSafeAreaView>
+ <>
<Stack.Screen
options={{
headerTitle: tag?.name ?? "",
headerBackTitle: "Back",
- ...Platform.select({
- ios: { headerTransparent: true, headerLargeTitle: true },
- }),
}}
/>
{error ? (
<FullPageError error={error.message} onRetry={() => refetch()} />
) : tag ? (
- <View>
- <UpdatingBookmarkList
- query={{
- tagId: tag.id,
- }}
- />
- </View>
+ <UpdatingBookmarkList
+ query={{
+ tagId: tag.id,
+ }}
+ />
) : (
<FullPageSpinner />
)}
- </CustomSafeAreaView>
+ </>
);
}
diff --git a/apps/mobile/components/ui/CustomSafeAreaView.tsx b/apps/mobile/components/ui/CustomSafeAreaView.tsx
index 0dd4202d..de3fb9c8 100644
--- a/apps/mobile/components/ui/CustomSafeAreaView.tsx
+++ b/apps/mobile/components/ui/CustomSafeAreaView.tsx
@@ -22,6 +22,7 @@ export default function CustomSafeAreaView({
return (
<SafeAreaView
+ edges={edges}
style={{
flex: 1,
backgroundColor: colors.background,