style: added new screens and designs
This commit is contained in:
@@ -1,16 +1,42 @@
|
||||
import styles from "@/app/styles/indexStyles";
|
||||
import styles from "@/app/tabStyles/indexStyles";
|
||||
import ShowCard from "@/components/ui/ShowCard";
|
||||
import { useShowContext } from "@/contexts/ShowContext";
|
||||
import { router } from "expo-router";
|
||||
import React from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { ActivityIndicator, Text, View } from "react-native";
|
||||
import {
|
||||
GestureHandlerRootView,
|
||||
ScrollView,
|
||||
} from "react-native-gesture-handler";
|
||||
|
||||
export default function HomeScreen() {
|
||||
const { shows } = useShowContext();
|
||||
const { shows, error, loading } = useShowContext();
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.mainContainer,
|
||||
{ justifyContent: "center", alignItems: "center" },
|
||||
]}
|
||||
>
|
||||
<ActivityIndicator size="large" color="#ffffff" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.mainContainer,
|
||||
{ justifyContent: "center", alignItems: "center" },
|
||||
]}
|
||||
>
|
||||
<Text>Error: {error}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView>
|
||||
@@ -20,12 +46,25 @@ export default function HomeScreen() {
|
||||
</View>
|
||||
<ScrollView contentContainerStyle={{ paddingBottom: 30 }}>
|
||||
{shows.map((show) => {
|
||||
const showLiveBadge = show.endDate === null;
|
||||
const showLiveBadge = show.running;
|
||||
return (
|
||||
<ShowCard
|
||||
key={show.id}
|
||||
onPress={() => router.push("/showDetails")}
|
||||
imageUri={show.bannerUri || show.thumbnailUri}
|
||||
title={show.title}
|
||||
onPress={() =>
|
||||
router.push({
|
||||
pathname: "/showDetails",
|
||||
params: {
|
||||
title: show.title,
|
||||
bannerUri: show.bannerUri,
|
||||
description: show.description,
|
||||
concept: show.concept,
|
||||
genres: show.genres,
|
||||
streamingService: show.streamingService,
|
||||
},
|
||||
})
|
||||
}
|
||||
imageUri={show.bannerUri}
|
||||
streamingServiceUri={show.streamingService}
|
||||
genres={show.genres}
|
||||
{...(showLiveBadge
|
||||
|
||||
Reference in New Issue
Block a user