diff --git a/app/(auth)/(tabs)/_layout.tsx b/app/(auth)/(tabs)/_layout.tsx index 15d8b239..4dfc2d4b 100644 --- a/app/(auth)/(tabs)/_layout.tsx +++ b/app/(auth)/(tabs)/_layout.tsx @@ -25,9 +25,7 @@ export default function TabLayout() { ( ), - headerLeft: () => ( - { - router.push("/(auth)/downloads"); - }} - > - - - ), - headerRight: () => ( - - - { - router.push("/(auth)/settings"); - }} - > - - - - - - ), }} /> ( diff --git a/app/(auth)/(tabs)/index/_layout.tsx b/app/(auth)/(tabs)/index/_layout.tsx new file mode 100644 index 00000000..dbe6fe21 --- /dev/null +++ b/app/(auth)/(tabs)/index/_layout.tsx @@ -0,0 +1,48 @@ +import { Chromecast } from "@/components/Chromecast"; +import { Feather } from "@expo/vector-icons"; +import { Stack, useRouter } from "expo-router"; +import { Platform, View } from "react-native"; +import { TouchableOpacity } from "react-native"; + +export default function IndexLayout() { + const router = useRouter(); + return ( + + ( + { + router.push("/(auth)/downloads"); + }} + > + + + ), + headerRight: () => ( + + + { + router.push("/(auth)/settings"); + }} + > + + + + + + ), + }} + /> + + ); +} diff --git a/app/(auth)/(tabs)/index.tsx b/app/(auth)/(tabs)/index/index.tsx similarity index 99% rename from app/(auth)/(tabs)/index.tsx rename to app/(auth)/(tabs)/index/index.tsx index 63b98b6f..07483337 100644 --- a/app/(auth)/(tabs)/index.tsx +++ b/app/(auth)/(tabs)/index/index.tsx @@ -237,6 +237,7 @@ export default function index() { return ( } diff --git a/app/(auth)/(tabs)/search/_layout.tsx b/app/(auth)/(tabs)/search/_layout.tsx new file mode 100644 index 00000000..3270a520 --- /dev/null +++ b/app/(auth)/(tabs)/search/_layout.tsx @@ -0,0 +1,17 @@ +import { Stack } from "expo-router"; + +export default function SearchLayout() { + return ( + + + + ); +} diff --git a/app/(auth)/(tabs)/search.tsx b/app/(auth)/(tabs)/search/search.tsx similarity index 84% rename from app/(auth)/(tabs)/search.tsx rename to app/(auth)/(tabs)/search/search.tsx index 3c0d3779..b5d55be9 100644 --- a/app/(auth)/(tabs)/search.tsx +++ b/app/(auth)/(tabs)/search/search.tsx @@ -11,10 +11,10 @@ import { getUserItemData } from "@/utils/jellyfin/user-library/getUserItemData"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getSearchApi } from "@jellyfin/sdk/lib/utils/api"; import { useQuery } from "@tanstack/react-query"; -import { router } from "expo-router"; +import { router, useNavigation } from "expo-router"; import { useAtom } from "jotai"; -import React, { useState } from "react"; -import { ScrollView, TouchableOpacity, View } from "react-native"; +import React, { useLayoutEffect, useState } from "react"; +import { Platform, ScrollView, TouchableOpacity, View } from "react-native"; export default function search() { const [search, setSearch] = useState(""); @@ -22,6 +22,18 @@ export default function search() { const [api] = useAtom(apiAtom); const [user] = useAtom(userAtom); + const navigation = useNavigation(); + useLayoutEffect(() => { + if (Platform.OS === "ios") + navigation.setOptions({ + headerSearchBarOptions: { + placeholder: "Search...", + onChangeText: (e: any) => setSearch(e.nativeEvent.text), + hideWhenScrolling: false, + }, + }); + }, [navigation]); + const { data: movies } = useQuery({ queryKey: ["search-movies", search], queryFn: async () => { @@ -67,19 +79,23 @@ export default function search() { }); return ( - + - - setSearch(text)} - /> - - + {Platform.OS === "android" && ( + + setSearch(text)} + /> + + )} Movies m.Id!)}