From 91be34123a0ee000667e34aa9b57a8d6511f4b2a Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sat, 29 Aug 2026 00:22:57 +0800 Subject: [PATCH] fix: add back navigation to snippets --- app/components/Screen.tsx | 7 ++++++- app/tabs/settings/Snippets.tsx | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/components/Screen.tsx b/app/components/Screen.tsx index c116875..b6f85b5 100644 --- a/app/components/Screen.tsx +++ b/app/components/Screen.tsx @@ -9,12 +9,14 @@ import { Text } from "@/app/components/ui"; export function Screen({ title, subtitle, + headerLeft, headerRight, children, scrollableHeader, }: { title?: string; subtitle?: string; + headerLeft?: React.ReactNode; headerRight?: React.ReactNode; children: React.ReactNode; /** When true, the header is part of the scroll content (caller handles it). */ @@ -25,7 +27,10 @@ export function Screen({ return ( {title && !scrollableHeader ? ( - + + {headerLeft ? ( + {headerLeft} + ) : null} {title} diff --git a/app/tabs/settings/Snippets.tsx b/app/tabs/settings/Snippets.tsx index c483d90..618d0de 100644 --- a/app/tabs/settings/Snippets.tsx +++ b/app/tabs/settings/Snippets.tsx @@ -2,6 +2,7 @@ import { useState, useEffect, useCallback } from "react"; import { View, ScrollView, Pressable, RefreshControl } from "react-native"; import * as Clipboard from "expo-clipboard"; import { + ArrowLeft, ChevronRight, Copy, FolderOpen, @@ -10,6 +11,7 @@ import { Trash2, Check, } from "lucide-react-native"; +import { useRouter } from "expo-router"; import { getSnippets, getSnippetFolders, @@ -34,6 +36,7 @@ type SnippetFormData = { export default function Snippets() { const color = useThemeColor(); + const router = useRouter(); const [snippets, setSnippets] = useState([]); const [folders, setFolders] = useState([]); @@ -321,6 +324,16 @@ export default function Snippets() { return ( router.back()} + accessibilityRole="button" + accessibilityLabel="Back" + hitSlop={8} + > + + + } headerRight={