mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-03 08:58:07 +00:00
feat(tv): live tv initial commit
This commit is contained in:
@@ -7,7 +7,8 @@ import type {
|
||||
ParamListBase,
|
||||
TabNavigationState,
|
||||
} from "@react-navigation/native";
|
||||
import { Stack, withLayoutContext } from "expo-router";
|
||||
import { Slot, Stack, withLayoutContext } from "expo-router";
|
||||
import { Platform } from "react-native";
|
||||
|
||||
const { Navigator } = createMaterialTopTabNavigator();
|
||||
|
||||
@@ -19,6 +20,17 @@ export const Tab = withLayoutContext<
|
||||
>(Navigator);
|
||||
|
||||
const Layout = () => {
|
||||
// On TV, skip the Material Top Tab Navigator and render children directly
|
||||
// The TV version handles its own tab navigation internally
|
||||
if (Platform.isTV) {
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen options={{ headerShown: false }} />
|
||||
<Slot />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen options={{ title: "Live TV" }} />
|
||||
|
||||
@@ -2,12 +2,21 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLiveTvApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { useAtom } from "jotai";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ScrollView, View } from "react-native";
|
||||
import { Platform, ScrollView, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { ScrollingCollectionList } from "@/components/home/ScrollingCollectionList";
|
||||
import { TVLiveTVPage } from "@/components/livetv/TVLiveTVPage";
|
||||
import { apiAtom, userAtom } from "@/providers/JellyfinProvider";
|
||||
|
||||
export default function page() {
|
||||
if (Platform.isTV) {
|
||||
return <TVLiveTVPage />;
|
||||
}
|
||||
|
||||
return <MobileLiveTVPrograms />;
|
||||
}
|
||||
|
||||
function MobileLiveTVPrograms() {
|
||||
const [api] = useAtom(apiAtom);
|
||||
const [user] = useAtom(userAtom);
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
Reference in New Issue
Block a user