Files
otunes/apps/mobile/app/(app)/(tabs)/library/_layout.tsx
T

38 lines
1.0 KiB
TypeScript

import { useTabletLayout } from "@/hooks/use-tablet-layout"
import { renderTabScreenContent } from "@/components/tab-screen-content"
import { Stack } from "expo-router"
import { ProfileHeaderButton } from "@/components/profile-header-button"
import {
inlineTitleOptions,
showHeaderProfile,
tabStackScreenTitles,
useStackScreenOptions,
} from "@/lib/navigation"
export const unstable_settings = {
anchor: "index",
}
export default function LibraryLayout() {
const tabletLayout = useTabletLayout()
const baseOptions = useStackScreenOptions({ title: "Library" })
return (
<Stack
screenLayout={renderTabScreenContent}
screenOptions={({ route }) => ({
...baseOptions,
...inlineTitleOptions,
title:
tabStackScreenTitles[route.name] ??
(tabletLayout ? "Recently Added" : "Library"),
// iOS shows the profile button inline with the screen title instead.
headerRight: showHeaderProfile(route.name)
? () => <ProfileHeaderButton />
: undefined,
})}
/>
)
}