From f4b2bac6b0749e5924f9e9e789cc361a17427364 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Mon, 16 Dec 2024 00:26:12 +0000 Subject: ui(mobile): Make page titles more native --- apps/mobile/app/_layout.tsx | 59 +++++++++++++--------------- apps/mobile/app/dashboard/(tabs)/_layout.tsx | 12 +++++- apps/mobile/app/dashboard/_layout.tsx | 11 +++++- apps/mobile/app/dashboard/archive.tsx | 12 +++--- apps/mobile/app/dashboard/favourites.tsx | 8 +++- apps/mobile/app/dashboard/lists/[slug].tsx | 12 ++---- apps/mobile/app/dashboard/tags/[slug].tsx | 5 +-- 7 files changed, 64 insertions(+), 55 deletions(-) (limited to 'apps/mobile/app') diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index 3a8f99a1..b2688388 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -2,7 +2,6 @@ import "@/globals.css"; import "expo-dev-client"; import { useEffect } from "react"; -import { View } from "react-native"; import { GestureHandlerRootView } from "react-native-gesture-handler"; import { useRouter } from "expo-router"; import { Stack } from "expo-router/stack"; @@ -36,42 +35,38 @@ export default function RootLayout() { - - + - - - - - - - - + /> + + + + + diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsx index 46bf0f77..4e403a99 100644 --- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx +++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx @@ -1,9 +1,17 @@ -import React from "react"; -import { Tabs } from "expo-router"; +import React, { useEffect } from "react"; +import { Tabs, useNavigation } from "expo-router"; import { StyledTabs } from "@/components/navigation/tabs"; import { ClipboardList, Home, Settings } from "lucide-react-native"; export default function TabLayout() { + const navigation = useNavigation(); + // Hide the header on the parent screen + useEffect(() => { + navigation.setOptions({ + headerShown: false, + }); + }, [navigation]); + return ( { + navigation.setOptions({ + headerShown: false, + }); + }, [navigation]); + const isLoggedIn = useIsLoggedIn(); useEffect(() => { if (isLoggedIn !== undefined && !isLoggedIn) { @@ -32,7 +40,6 @@ export default function Dashboard() { return ( - } - /> + ); } diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx index fb39504b..1dddfe31 100644 --- a/apps/mobile/app/dashboard/favourites.tsx +++ b/apps/mobile/app/dashboard/favourites.tsx @@ -1,15 +1,19 @@ +import { useNavigation } from "expo-router"; import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; -import PageTitle from "@/components/ui/PageTitle"; export default function Favourites() { + const navigator = useNavigation(); + navigator.setOptions({ + headerTitle: "⭐️ Favourites", + headerLargeTitle: true, + }); return ( } /> ); diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx index 72e3d0ae..f98dd6d3 100644 --- a/apps/mobile/app/dashboard/lists/[slug].tsx +++ b/apps/mobile/app/dashboard/lists/[slug].tsx @@ -5,7 +5,6 @@ import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import FullPageError from "@/components/FullPageError"; import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; -import PageTitle from "@/components/ui/PageTitle"; import { api } from "@/lib/trpc"; import { MenuView } from "@react-native-menu/menu"; import { Ellipsis } from "lucide-react-native"; @@ -25,9 +24,10 @@ export default function ListView() { , }} /> {error ? ( @@ -38,12 +38,6 @@ export default function ListView() { query={{ listId: list.id, }} - header={ - - - - - } /> ) : ( diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx index 54bbc31b..3f294328 100644 --- a/apps/mobile/app/dashboard/tags/[slug].tsx +++ b/apps/mobile/app/dashboard/tags/[slug].tsx @@ -4,7 +4,6 @@ import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; import FullPageError from "@/components/FullPageError"; import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; import FullPageSpinner from "@/components/ui/FullPageSpinner"; -import PageTitle from "@/components/ui/PageTitle"; import { api } from "@/lib/trpc"; export default function TagView() { @@ -19,9 +18,10 @@ export default function TagView() { {error ? ( @@ -32,7 +32,6 @@ export default function TagView() { query={{ tagId: tag.id, }} - header={} /> ) : ( -- cgit v1.2.3-70-g09d2