chore: url parsing stuff for later when I have time

This commit is contained in:
Adrian Castro
2024-04-01 18:20:56 +02:00
parent 2399926cbc
commit 30e52c2b72
4 changed files with 21 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import { Platform } from "react-native";
import * as Haptics from "expo-haptics";
import { Tabs } from "expo-router";
import * as Linking from "expo-linking";
import { Tabs, useRouter } from "expo-router";
import * as ScreenOrientation from "expo-screen-orientation";
import { useTheme, View } from "tamagui";
@@ -11,6 +12,21 @@ import TabBarIcon from "~/components/TabBarIcon";
export default function TabLayout() {
const theme = useTheme();
// const url = Linking.useURL();
// const router = useRouter();
//
// if (url) {
// const { hostname, queryParams } = Linking.parse(url);
//
// switch (hostname) {
// case "media":
// return router.push({
// pathname: "/videoPlayer",
// params: { data: JSON.stringify(queryParams) }
// });
// }
// }
return (
<Tabs
sceneContainerStyle={{

View File

@@ -16,7 +16,7 @@ export default function VideoPlayerWrapper() {
const params = useLocalSearchParams();
const data = params.data
? (JSON.parse(params.data as string) as ItemData)
? (JSON.parse(params.data as string) as Partial<ItemData>)
: undefined;
const media = params.media
? (JSON.parse(params.media as string) as ScrapeMedia)