api: add Person and StreamingService contexts

This commit is contained in:
Cron1cle
2025-10-07 20:08:51 +02:00
parent de2778d6db
commit 2dacb9fa80
12 changed files with 390 additions and 111 deletions

View File

@@ -1,6 +1,7 @@
import styles from "@/app/tabStyles/indexStyles";
import ShowCard from "@/components/ui/ShowCard";
import { useShowContext } from "@/contexts/ShowContext";
import { useStreamingServiceContext } from "@/contexts/StreamingServiceContext";
import { router } from "expo-router";
import React from "react";
import { ActivityIndicator, Text, View } from "react-native";
@@ -11,6 +12,7 @@ import {
export default function HomeScreen() {
const { shows, error, loading } = useShowContext();
const { streamingServices } = useStreamingServiceContext();
if (loading) {
return (
@@ -47,6 +49,11 @@ export default function HomeScreen() {
<ScrollView contentContainerStyle={{ paddingBottom: 30 }}>
{shows.map((show) => {
const showLiveBadge = show.running;
const streamingService =
streamingServices[
`assets.images.streamingServices.${show.streamingService.toLowerCase()}`
];
return (
<ShowCard
key={show.id}
@@ -66,7 +73,7 @@ export default function HomeScreen() {
})
}
imageUri={show.bannerUri}
streamingServiceUri={show.streamingService}
streamingServiceUri={streamingService}
genres={show.genres}
{...(showLiveBadge
? {