api: add Person and StreamingService contexts
This commit is contained in:
@@ -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
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user