diff --git a/apps/mobile/app/(app)/(tabs)/_layout.tsx b/apps/mobile/app/(app)/(tabs)/_layout.tsx index bd5f1ae..6bca97e 100644 --- a/apps/mobile/app/(app)/(tabs)/_layout.tsx +++ b/apps/mobile/app/(app)/(tabs)/_layout.tsx @@ -96,15 +96,7 @@ export default function TabsLayout() { Library - - - Playlists - - - + Search diff --git a/apps/mobile/app/(app)/(tabs)/home/_layout.tsx b/apps/mobile/app/(app)/(tabs)/home/_layout.tsx index 8d84403..438f058 100644 --- a/apps/mobile/app/(app)/(tabs)/home/_layout.tsx +++ b/apps/mobile/app/(app)/(tabs)/home/_layout.tsx @@ -1,7 +1,21 @@ import { Stack } from "expo-router" -import { useStackScreenOptions } from "@/lib/navigation" +import { tabStackScreenTitles, useStackScreenOptions } from "@/lib/navigation" + +export const unstable_settings = { + initialRouteName: "index", +} export default function HomeLayout() { - return + const baseOptions = useStackScreenOptions({ title: "Home" }) + + return ( + ({ + ...baseOptions, + title: tabStackScreenTitles[route.name] ?? "Home", + })} + /> + ) } diff --git a/apps/mobile/app/(app)/album/[id].tsx b/apps/mobile/app/(app)/(tabs)/home/album/[id].tsx similarity index 94% rename from apps/mobile/app/(app)/album/[id].tsx rename to apps/mobile/app/(app)/(tabs)/home/album/[id].tsx index e585698..d4159c8 100644 --- a/apps/mobile/app/(app)/album/[id].tsx +++ b/apps/mobile/app/(app)/(tabs)/home/album/[id].tsx @@ -1,6 +1,6 @@ import { useQuery } from "convex/react" import { Image } from "expo-image" -import { Stack, useLocalSearchParams, useRouter } from "expo-router" +import { Stack, useLocalSearchParams } from "expo-router" import { useState } from "react" import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native" import { Ionicons } from "@expo/vector-icons" @@ -16,15 +16,19 @@ import { api } from "@otunes/convex/_generated/api" import type { Id } from "@otunes/convex/_generated/dataModel" import type { BrowseAlbumTrack } from "@otunes/convex/types" import { formatDuration, formatMetadata } from "@/lib/format" +import { useAppNavigation } from "@/lib/app-navigation" import { albumCoverUrl } from "@/lib/urls" import { radius, spacing, useThemeColors } from "@/lib/theme" export default function AlbumScreen() { const { id } = useLocalSearchParams<{ id: string }>() - const router = useRouter() + const { push } = useAppNavigation() const colors = useThemeColors() const { config } = useServerConfig() - const album = useQuery(api.library.browseAlbumDetail, { id: id as Id<"albums"> }) + const album = useQuery( + api.library.browseAlbumDetail, + typeof id === "string" ? { id: id as Id<"albums"> } : "skip" + ) const { playAlbum, playAlbumShuffled, playFromSong } = usePlayback() const { isAlbumFavorite, toggleAlbumFavorite } = useFavorites() const { openAddAlbumToPlaylist } = useAddToPlaylist() @@ -84,7 +88,7 @@ export default function AlbumScreen() { contentFit="cover" /> {album.title} - router.push(`/artist/${album.artist.id}`)}> + push(`/artist/${album.artist.id}`)}> {album.artist.name} {metadata ? ( diff --git a/apps/mobile/app/(app)/artist/[id].tsx b/apps/mobile/app/(app)/(tabs)/home/artist/[id].tsx similarity index 100% rename from apps/mobile/app/(app)/artist/[id].tsx rename to apps/mobile/app/(app)/(tabs)/home/artist/[id].tsx diff --git a/apps/mobile/app/(app)/library/albums.tsx b/apps/mobile/app/(app)/(tabs)/home/browse/albums.tsx similarity index 100% rename from apps/mobile/app/(app)/library/albums.tsx rename to apps/mobile/app/(app)/(tabs)/home/browse/albums.tsx diff --git a/apps/mobile/app/(app)/library/artists.tsx b/apps/mobile/app/(app)/(tabs)/home/browse/artists.tsx similarity index 92% rename from apps/mobile/app/(app)/library/artists.tsx rename to apps/mobile/app/(app)/(tabs)/home/browse/artists.tsx index 9a86866..e46ab8c 100644 --- a/apps/mobile/app/(app)/library/artists.tsx +++ b/apps/mobile/app/(app)/(tabs)/home/browse/artists.tsx @@ -1,18 +1,18 @@ import { useQuery } from "convex/react" -import { useRouter } from "expo-router" import { Pressable, ScrollView, StyleSheet, Text } from "react-native" import { Image } from "expo-image" import { LoadingView } from "@/components/ui/primitives" import { contentBottomInset } from "@/components/player" import { useServerConfig } from "@/contexts/server-config" +import { useAppNavigation } from "@/lib/app-navigation" import { api } from "@otunes/convex/_generated/api" import type { BrowseArtist } from "@otunes/convex/types" import { artistCoverUrl } from "@/lib/urls" import { radius, spacing, useThemeColors } from "@/lib/theme" export default function ArtistsScreen() { - const router = useRouter() + const { push } = useAppNavigation() const colors = useThemeColors() const { config } = useServerConfig() const artists = useQuery(api.library.browseArtists) @@ -31,7 +31,7 @@ export default function ArtistsScreen() { router.push(`/artist/${artist.id}`)} + onPress={() => push(`/artist/${artist.id}`)} > ( setMenuOpen(true)} hitSlop={8}> diff --git a/apps/mobile/app/(app)/playlist/favorites.tsx b/apps/mobile/app/(app)/(tabs)/home/playlist/favorites.tsx similarity index 87% rename from apps/mobile/app/(app)/playlist/favorites.tsx rename to apps/mobile/app/(app)/(tabs)/home/playlist/favorites.tsx index 5bc42c8..c6f33d9 100644 --- a/apps/mobile/app/(app)/playlist/favorites.tsx +++ b/apps/mobile/app/(app)/(tabs)/home/playlist/favorites.tsx @@ -1,7 +1,7 @@ import { useQuery } from "convex/react" import { Image } from "expo-image" import { useState } from "react" -import { ScrollView, StyleSheet, Text, View } from "react-native" +import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native" import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet" import { Button, LoadingView } from "@/components/ui/primitives" @@ -14,6 +14,8 @@ import { api } from "@otunes/convex/_generated/api" import type { BrowseSong } from "@otunes/convex/types" import { playlistCoverUrl } from "@/lib/urls" import { radius, spacing, useThemeColors } from "@/lib/theme" +import { Ionicons } from "@expo/vector-icons" +import { Stack } from "expo-router" export default function FavoritesScreen() { const colors = useThemeColors() @@ -54,6 +56,12 @@ export default function FavoritesScreen() { return ( <> + - {favorites.title} + + {favorites.title} +