A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix(mobile): fix alignment of the header menu in the list page
Mohamed Bassemb1b32f7b8b03
diff --git a/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsxindex 14c27d0c..ab9ae5ee 100644--- a/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx@@ -8,6 +8,7 @@ import { TailwindResolver } from "@/components/TailwindResolver";import { Text } from "@/components/ui/Text";import useAppSettings from "@/lib/settings";import { useUploadAsset } from "@/lib/upload";+import { useMenuIconColors } from "@/lib/useMenuIconColors";import { MenuView } from "@react-native-menu/menu";import { Plus, Search } from "lucide-react-native";import { toast as sonnerToast } from "sonner-native";@@ -18,6 +19,7 @@ function HeaderRight({openNewBookmarkModal: () => void;}) {const { settings } = useAppSettings();+ const { menuIconColor } = useMenuIconColors();const uploadToastIdRef = useRef<string | number | null>(null);const { uploadAsset } = useUploadAsset(settings, {onSuccess: () => {@@ -63,7 +65,10 @@ function HeaderRight({id: "new",title: "New Bookmark",image: Platform.select({- ios: "note.text",+ ios: "square.and.pencil",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{@@ -72,6 +77,9 @@ function HeaderRight({image: Platform.select({ios: "photo",}),+ imageColor: Platform.select({+ ios: menuIconColor,+ }),},]}shouldOpenOnLongPress={false}diff --git a/apps/mobile/app/dashboard/lists/[slug]/index.tsx b/apps/mobile/app/dashboard/lists/[slug]/index.tsxindex 01fbfe9c..aa8063d6 100644--- a/apps/mobile/app/dashboard/lists/[slug]/index.tsx+++ b/apps/mobile/app/dashboard/lists/[slug]/index.tsx@@ -5,6 +5,7 @@ import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";import FullPageError from "@/components/FullPageError";import FullPageSpinner from "@/components/ui/FullPageSpinner";import { useArchiveFilter } from "@/lib/hooks";+import { useMenuIconColors } from "@/lib/useMenuIconColors";import { MenuView } from "@react-native-menu/menu";import { useMutation, useQuery } from "@tanstack/react-query";import { Ellipsis } from "lucide-react-native";@@ -60,6 +61,7 @@ function ListActionsMenu({role: ZBookmarkList["userRole"];}) {const api = useTRPC();+ const { menuIconColor, destructiveMenuIconColor } = useMenuIconColors();const { mutate: deleteList } = useMutation(api.lists.delete.mutationOptions({onSuccess: () => {@@ -119,11 +121,14 @@ function ListActionsMenu({hidden: role !== "owner",},image: Platform.select({- ios: "pencil",+ ios: "square.and.pencil",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{- id: "delete",+ id: "delete_list",title: "Delete List",attributes: {destructive: true,@@ -132,6 +137,9 @@ function ListActionsMenu({image: Platform.select({ios: "trash",}),+ imageColor: Platform.select({+ ios: destructiveMenuIconColor,+ }),},{id: "leave",@@ -141,12 +149,15 @@ function ListActionsMenu({hidden: role === "owner",},image: Platform.select({- ios: "rectangle.portrait.and.arrow.right",+ ios: "arrowshape.turn.up.left",+ }),+ imageColor: Platform.select({+ ios: destructiveMenuIconColor,}),},]}onPressAction={({ nativeEvent }) => {- if (nativeEvent.event === "delete") {+ if (nativeEvent.event === "delete_list") {handleDelete();} else if (nativeEvent.event === "leave") {handleLeave();diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsxindex 7fa688e4..ed479ef8 100644--- a/apps/mobile/components/bookmarks/BookmarkCard.tsx+++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx@@ -15,6 +15,7 @@ import { router, useRouter } from "expo-router";import * as Sharing from "expo-sharing";import { Text } from "@/components/ui/Text";import useAppSettings from "@/lib/settings";+import { useMenuIconColors } from "@/lib/useMenuIconColors";import { buildApiHeaders } from "@/lib/utils";import { MenuView } from "@react-native-menu/menu";import { useQuery } from "@tanstack/react-query";@@ -46,6 +47,7 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {const { toast } = useToast();const { settings } = useAppSettings();const { data: currentUser } = useWhoAmI();+ const { menuIconColor, destructiveMenuIconColor } = useMenuIconColors();// Check if the current user owns this bookmarkconst isOwner = currentUser?.id === bookmark.userId;@@ -196,6 +198,9 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {image: Platform.select({ios: "pencil",}),+ imageColor: Platform.select({+ ios: menuIconColor,+ }),},{id: "manage_list",@@ -203,6 +208,9 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {image: Platform.select({ios: "list.bullet",}),+ imageColor: Platform.select({+ ios: menuIconColor,+ }),},{id: "manage_tags",@@ -210,6 +218,9 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {image: Platform.select({ios: "tag",}),+ imageColor: Platform.select({+ ios: menuIconColor,+ }),},{id: "archive",@@ -217,6 +228,9 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {image: Platform.select({ios: "folder",}),+ imageColor: Platform.select({+ ios: menuIconColor,+ }),},{id: "delete",@@ -227,6 +241,9 @@ function ActionBar({ bookmark }: { bookmark: ZBookmark }) {image: Platform.select({ios: "trash",}),+ imageColor: Platform.select({+ ios: destructiveMenuIconColor,+ }),},);}diff --git a/apps/mobile/components/bookmarks/BookmarkLinkTypeSelector.tsx b/apps/mobile/components/bookmarks/BookmarkLinkTypeSelector.tsxindex 259e53c5..5fd0a7ab 100644--- a/apps/mobile/components/bookmarks/BookmarkLinkTypeSelector.tsx+++ b/apps/mobile/components/bookmarks/BookmarkLinkTypeSelector.tsx@@ -1,5 +1,6 @@import { Platform } from "react-native";import * as Haptics from "expo-haptics";+import { useMenuIconColors } from "@/lib/useMenuIconColors";import { MenuView } from "@react-native-menu/menu";import { ChevronDown } from "lucide-react-native";@@ -51,6 +52,7 @@ export default function BookmarkLinkTypeSelector({bookmark,}: BookmarkLinkTypeSelectorProps) {const availableTypes = getAvailableViewTypes(bookmark);+ const { menuIconColor } = useMenuIconColors();const viewActions = [{@@ -58,7 +60,10 @@ export default function BookmarkLinkTypeSelector({title: "Reader View",state: type === "reader" ? ("on" as const) : undefined,image: Platform.select({- ios: "doc.plaintext",+ ios: "doc.text",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{@@ -66,7 +71,10 @@ export default function BookmarkLinkTypeSelector({title: "Browser",state: type === "browser" ? ("on" as const) : undefined,image: Platform.select({- ios: "globe",+ ios: "safari",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{@@ -74,7 +82,10 @@ export default function BookmarkLinkTypeSelector({title: "Screenshot",state: type === "screenshot" ? ("on" as const) : undefined,image: Platform.select({- ios: "camera.viewfinder",+ ios: "camera",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{@@ -82,7 +93,10 @@ export default function BookmarkLinkTypeSelector({title: "Archived Page",state: type === "archive" ? ("on" as const) : undefined,image: Platform.select({- ios: "archivebox",+ ios: "tray.full",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},{@@ -90,7 +104,10 @@ export default function BookmarkLinkTypeSelector({title: "PDF",state: type === "pdf" ? ("on" as const) : undefined,image: Platform.select({- ios: "doc.fill",+ ios: "doc",+ }),+ imageColor: Platform.select({+ ios: menuIconColor,}),},];diff --git a/apps/mobile/lib/useMenuIconColors.ts b/apps/mobile/lib/useMenuIconColors.tsnew file mode 100644index 00000000..0359e028--- /dev/null+++ b/apps/mobile/lib/useMenuIconColors.ts@@ -0,0 +1,14 @@+import { useColorScheme } from "@/lib/useColorScheme";++export function useMenuIconColors() {+ const { colorScheme } = useColorScheme();++ const menuIconColor = colorScheme === "dark" ? "#d1d5db" : "#4b5563";+ const destructiveMenuIconColor =+ colorScheme === "dark" ? "#f87171" : "#dc2626";++ return {+ menuIconColor,+ destructiveMenuIconColor,+ };+}