Files
otunes/apps/mobile/lib/navigation.ts
T

45 lines
1.3 KiB
TypeScript

import type { NativeStackNavigationOptions } from "expo-router"
import { Platform } from "react-native"
import { useThemeColors } from "@/lib/theme"
type StackScreenOptions = NativeStackNavigationOptions
export const tabStackScreenTitles: Record<string, string> = {
"browse/albums": "Albums",
"browse/artists": "Artists",
"browse/songs": "Songs",
"browse/playlists": "Playlists",
"recently-played": "Recently Played",
"recently-added": "Recently Added",
settings: "Settings",
"downloads/index": "Downloads",
"downloads/other": "Other Downloaded Songs",
}
export function useStackScreenOptions(
overrides?: StackScreenOptions
): StackScreenOptions {
const theme = useThemeColors()
return {
headerLargeTitle: true,
headerTransparent: true,
headerTintColor: theme.foreground,
headerLargeTitleStyle: { color: theme.foreground },
headerBackButtonDisplayMode: "minimal",
...(Platform.OS === "android"
? {
animation: "fade",
headerLargeTitle: false,
headerTransparent: false,
headerStyle: { backgroundColor: theme.background },
headerShadowVisible: false,
statusBarStyle: "light" as const,
contentStyle: { backgroundColor: theme.background },
}
: {}),
...overrides,
}
}